Record Class Nutriments
java.lang.Object
java.lang.Record
com.alpermulayim.openfoodfacts_spring_boot_starter.dtos.Nutriments
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecarbohydratesrecord component.energy()Returns the value of theenergyrecord component.final booleanIndicates whether some other object is "equal to" this one.fat()Returns the value of thefatrecord component.final inthashCode()Returns a hash code value for this object.proteins()Returns the value of theproteinsrecord component.salt()Returns the value of thesaltrecord component.Returns the value of thesaturatedFatrecord component.sugars()Returns the value of thesugarsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Nutriments
public Nutriments(Double fat, Double carbohydrates, Double energy, Double salt, Double saturatedFat, Double sugars, Double proteins) Creates an instance of aNutrimentsrecord class.- Parameters:
fat- the value for thefatrecord componentcarbohydrates- the value for thecarbohydratesrecord componentenergy- the value for theenergyrecord componentsalt- the value for thesaltrecord componentsaturatedFat- the value for thesaturatedFatrecord componentsugars- the value for thesugarsrecord componentproteins- the value for theproteinsrecord 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 withObjects::equals(Object,Object). -
fat
Returns the value of thefatrecord component.- Returns:
- the value of the
fatrecord component
-
carbohydrates
Returns the value of thecarbohydratesrecord component.- Returns:
- the value of the
carbohydratesrecord component
-
energy
Returns the value of theenergyrecord component.- Returns:
- the value of the
energyrecord component
-
salt
Returns the value of thesaltrecord component.- Returns:
- the value of the
saltrecord component
-
saturatedFat
Returns the value of thesaturatedFatrecord component.- Returns:
- the value of the
saturatedFatrecord component
-
sugars
Returns the value of thesugarsrecord component.- Returns:
- the value of the
sugarsrecord component
-
proteins
Returns the value of theproteinsrecord component.- Returns:
- the value of the
proteinsrecord component
-