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 boolean
Indicates whether some other object is "equal to" this one.fridgeId()
Returns the value of thefridgeId
record component.final int
hashCode()
Returns a hash code value for this object.itemName()
Returns the value of theitemName
record component.price()
Returns the value of theprice
record component.quantity()
Returns the value of thequantity
record component.Returns the value of thestoreName
record component.final String
toString()
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 theprice
record component.- Returns:
- the value of the
price
record component
-
quantity
Returns the value of thequantity
record component.- Returns:
- the value of the
quantity
record component
-
itemName
Returns the value of theitemName
record component.- Returns:
- the value of the
itemName
record component
-
storeName
Returns the value of thestoreName
record component.- Returns:
- the value of the
storeName
record component
-
fridgeId
Returns the value of thefridgeId
record component.- Returns:
- the value of the
fridgeId
record component
-