Record Class WasteRequest
java.lang.Object
java.lang.Record
ntnu.idatt2016.v233.SmartMat.dto.request.group.WasteRequest
- Record Components:
groupId
- the id of the groupean
- the ean of the productamount
- the amount of the productunit
- the unit of the product
WasteRequest is a record class representing a request to add a product to a fridge.
-
Constructor Summary
ConstructorsConstructorDescriptionWasteRequest
(long groupId, long ean, double amount, String unit) Creates an instance of aWasteRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
amount()
Returns the value of theamount
record component.long
ean()
Returns the value of theean
record component.final boolean
Indicates whether some other object is "equal to" this one.long
groupId()
Returns the value of thegroupId
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
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 double amount()Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-