Record Class FridgeProductRequest
java.lang.Object
java.lang.Record
ntnu.idatt2016.v233.SmartMat.dto.request.product.FridgeProductRequest
- Record Components:
fridgeProductId- the id of the fridge productgroupId- the id of the groupean- the ean of the productamount- the amount of the productdays- the days before expiry date of the productprice- the price of the product
public record FridgeProductRequest(long fridgeProductId, long groupId, long ean, int amount, int days, double price)
extends Record
FridgeProductRequest is a record class representing a request to add a product to a fridge.
-
Constructor Summary
ConstructorsConstructorDescriptionFridgeProductRequest(long fridgeProductId, long groupId, long ean, int amount, int days, double price) Creates an instance of aFridgeProductRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintamount()Returns the value of theamountrecord component.intdays()Returns the value of thedaysrecord component.longean()Returns the value of theeanrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefridgeProductIdrecord component.longgroupId()Returns the value of thegroupIdrecord component.final inthashCode()Returns a hash code value for this object.doubleprice()Returns the value of thepricerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FridgeProductRequest
public FridgeProductRequest(long fridgeProductId, long groupId, long ean, int amount, int days, double price) Creates an instance of aFridgeProductRequestrecord class.- Parameters:
fridgeProductId- the value for thefridgeProductIdrecord componentgroupId- the value for thegroupIdrecord componentean- the value for theeanrecord componentamount- the value for theamountrecord componentdays- the value for thedaysrecord componentprice- the value for thepricerecord 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. All components in this record class are compared with '=='. -
fridgeProductId
public long fridgeProductId()Returns the value of thefridgeProductIdrecord component.- Returns:
- the value of the
fridgeProductIdrecord component
-
groupId
public long groupId()Returns the value of thegroupIdrecord component.- Returns:
- the value of the
groupIdrecord component
-
ean
public long ean()Returns the value of theeanrecord component.- Returns:
- the value of the
eanrecord component
-
amount
public int amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
days
public int days()Returns the value of thedaysrecord component.- Returns:
- the value of the
daysrecord component
-
price
public double price()Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-