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 aWasteRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.longean()Returns the value of theeanrecord component.final booleanIndicates whether some other object is "equal to" this one.longgroupId()Returns the value of thegroupIdrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.unit()Returns the value of theunitrecord 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 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 double amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
unit
Returns the value of theunitrecord component.- Returns:
- the value of the
unitrecord component
-