Record Class NutrientLevels
java.lang.Object
java.lang.Record
com.alpermulayim.openfoodfacts_spring_boot_starter.dtos.NutrientLevels
-
Constructor Summary
ConstructorsConstructorDescriptionNutrientLevels
(String fat, String salt, String saturatedFat, String sugars) Creates an instance of aNutrientLevels
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.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
-
NutrientLevels
Creates an instance of aNutrientLevels
record class.- Parameters:
fat
- the value for thefat
record componentsalt
- the value for thesalt
record componentsaturatedFat
- the value for thesaturatedFat
record componentsugars
- the value for thesugars
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
-
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
-