Record Class FridgeItemLoadDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.items.fridge_items.FridgeItemLoadDTO
public record FridgeItemLoadDTO(@NonNull Long itemId, @NonNull String name, String description, @NonNull String store, double price, String image, double amount, String unit, @NonNull LocalDateTime purchaseDate, @NonNull LocalDateTime expirationDate, String ean)
extends Record
This record represents a data transfer object for loading a fridge item.
-
Constructor Summary
ConstructorsConstructorDescriptionFridgeItemLoadDTO
(@NonNull Long itemId, @NonNull String name, String description, @NonNull String store, double price, String image, double amount, String unit, @NonNull LocalDateTime purchaseDate, @NonNull LocalDateTime expirationDate, String ean) Creates an instance of aFridgeItemLoadDTO
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
amount()
Returns the value of theamount
record component.Returns the value of thedescription
record component.ean()
Returns the value of theean
record component.final boolean
Indicates whether some other object is "equal to" this one.@NonNull LocalDateTime
Returns the value of theexpirationDate
record component.final int
hashCode()
Returns a hash code value for this object.image()
Returns the value of theimage
record component.@NonNull Long
itemId()
Returns the value of theitemId
record component.@NonNull String
name()
Returns the value of thename
record component.double
price()
Returns the value of theprice
record component.@NonNull LocalDateTime
Returns the value of thepurchaseDate
record component.@NonNull String
store()
Returns the value of thestore
record component.final String
toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.
-
Constructor Details
-
FridgeItemLoadDTO
public FridgeItemLoadDTO(@NonNull @NonNull Long itemId, @NonNull @NonNull String name, String description, @NonNull @NonNull String store, double price, String image, double amount, String unit, @NonNull @NonNull LocalDateTime purchaseDate, @NonNull @NonNull LocalDateTime expirationDate, String ean) Creates an instance of aFridgeItemLoadDTO
record class.- Parameters:
itemId
- the value for theitemId
record componentname
- the value for thename
record componentdescription
- the value for thedescription
record componentstore
- the value for thestore
record componentprice
- the value for theprice
record componentimage
- the value for theimage
record componentamount
- the value for theamount
record componentunit
- the value for theunit
record componentpurchaseDate
- the value for thepurchaseDate
record componentexpirationDate
- the value for theexpirationDate
record componentean
- the value for theean
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
itemId
Returns the value of theitemId
record component.- Returns:
- the value of the
itemId
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
store
Returns the value of thestore
record component.- Returns:
- the value of the
store
record component
-
price
public double price()Returns the value of theprice
record component.- Returns:
- the value of the
price
record component
-
image
Returns the value of theimage
record component.- Returns:
- the value of the
image
record component
-
amount
public double amount()Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-
purchaseDate
Returns the value of thepurchaseDate
record component.- Returns:
- the value of the
purchaseDate
record component
-
expirationDate
Returns the value of theexpirationDate
record component.- Returns:
- the value of the
expirationDate
record component
-
ean
Returns the value of theean
record component.- Returns:
- the value of the
ean
record component
-