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 aFridgeProductRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
amount()
Returns the value of theamount
record component.int
days()
Returns the value of thedays
record component.long
ean()
Returns the value of theean
record component.final boolean
Indicates whether some other object is "equal to" this one.long
Returns the value of thefridgeProductId
record component.long
groupId()
Returns the value of thegroupId
record component.final int
hashCode()
Returns a hash code value for this object.double
price()
Returns the value of theprice
record component.final String
toString()
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 aFridgeProductRequest
record class.- Parameters:
fridgeProductId
- the value for thefridgeProductId
record componentgroupId
- the value for thegroupId
record componentean
- the value for theean
record componentamount
- the value for theamount
record componentdays
- the value for thedays
record componentprice
- the value for theprice
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. All components in this record class are compared with '=='. -
fridgeProductId
public long fridgeProductId()Returns the value of thefridgeProductId
record component.- Returns:
- the value of the
fridgeProductId
record component
-
groupId
public long groupId()Returns the value of thegroupId
record component.- Returns:
- the value of the
groupId
record component
-
ean
public long ean()Returns the value of theean
record component.- Returns:
- the value of the
ean
record component
-
amount
public int amount()Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
days
public int days()Returns the value of thedays
record component.- Returns:
- the value of the
days
record component
-
price
public double price()Returns the value of theprice
record component.- Returns:
- the value of the
price
record component
-