Record Class StatAddItemToFridgeDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.stat.StatAddItemToFridgeDTO
- Record Components:
price- The price of the itemquantity- The amount of the itemitemName- The name of the itemstoreName- The name of the store the item comes fromfridgeId- The fridge this statistic is relevant for
public record StatAddItemToFridgeDTO(Double price, Integer quantity, String itemName, String storeName, Long fridgeId)
extends Record
This record represents a dto for adding a statistic.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fridgeId()Returns the value of thefridgeIdrecord component.final inthashCode()Returns a hash code value for this object.itemName()Returns the value of theitemNamerecord component.price()Returns the value of thepricerecord component.quantity()Returns the value of thequantityrecord component.Returns the value of thestoreNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
price
Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-
quantity
Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-
itemName
Returns the value of theitemNamerecord component.- Returns:
- the value of the
itemNamerecord component
-
storeName
Returns the value of thestoreNamerecord component.- Returns:
- the value of the
storeNamerecord component
-
fridgeId
Returns the value of thefridgeIdrecord component.- Returns:
- the value of the
fridgeIdrecord component
-