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 thecarbohydrates
record component.energy()
Returns the value of theenergy
record component.final boolean
Indicates whether some other object is "equal to" this one.fat()
Returns the value of thefat
record component.final int
hashCode()
Returns a hash code value for this object.proteins()
Returns the value of theproteins
record component.salt()
Returns the value of thesalt
record component.Returns the value of thesaturatedFat
record component.sugars()
Returns the value of thesugars
record component.final String
toString()
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 aNutriments
record class.- Parameters:
fat
- the value for thefat
record componentcarbohydrates
- the value for thecarbohydrates
record componentenergy
- the value for theenergy
record componentsalt
- the value for thesalt
record componentsaturatedFat
- the value for thesaturatedFat
record componentsugars
- the value for thesugars
record componentproteins
- the value for theproteins
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 withObjects::equals(Object,Object)
. -
fat
Returns the value of thefat
record component.- Returns:
- the value of the
fat
record component
-
carbohydrates
Returns the value of thecarbohydrates
record component.- Returns:
- the value of the
carbohydrates
record component
-
energy
Returns the value of theenergy
record component.- Returns:
- the value of the
energy
record component
-
salt
Returns the value of thesalt
record component.- Returns:
- the value of the
salt
record component
-
saturatedFat
Returns the value of thesaturatedFat
record component.- Returns:
- the value of the
saturatedFat
record component
-
sugars
Returns the value of thesugars
record component.- Returns:
- the value of the
sugars
record component
-
proteins
Returns the value of theproteins
record component.- Returns:
- the value of the
proteins
record component
-