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 aFridgeItemLoadDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.Returns the value of thedescriptionrecord component.ean()Returns the value of theeanrecord component.final booleanIndicates whether some other object is "equal to" this one.@NonNull LocalDateTimeReturns the value of theexpirationDaterecord component.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.@NonNull LongitemId()Returns the value of theitemIdrecord component.@NonNull Stringname()Returns the value of thenamerecord component.doubleprice()Returns the value of thepricerecord component.@NonNull LocalDateTimeReturns the value of thepurchaseDaterecord component.@NonNull Stringstore()Returns the value of thestorerecord component.final StringtoString()Returns a string representation of this record class.unit()Returns the value of theunitrecord 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 aFridgeItemLoadDTOrecord class.- Parameters:
itemId- the value for theitemIdrecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentstore- the value for thestorerecord componentprice- the value for thepricerecord componentimage- the value for theimagerecord componentamount- the value for theamountrecord componentunit- the value for theunitrecord componentpurchaseDate- the value for thepurchaseDaterecord componentexpirationDate- the value for theexpirationDaterecord componentean- the value for theeanrecord 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 theitemIdrecord component.- Returns:
- the value of the
itemIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
store
Returns the value of thestorerecord component.- Returns:
- the value of the
storerecord component
-
price
public double price()Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
amount
public double amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
unit
Returns the value of theunitrecord component.- Returns:
- the value of the
unitrecord component
-
purchaseDate
Returns the value of thepurchaseDaterecord component.- Returns:
- the value of the
purchaseDaterecord component
-
expirationDate
Returns the value of theexpirationDaterecord component.- Returns:
- the value of the
expirationDaterecord component
-
ean
Returns the value of theeanrecord component.- Returns:
- the value of the
eanrecord component
-