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 aNutrientLevelsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.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
-
NutrientLevels
Creates an instance of aNutrientLevelsrecord class.- Parameters:
fat- the value for thefatrecord componentsalt- the value for thesaltrecord componentsaturatedFat- the value for thesaturatedFatrecord componentsugars- the value for thesugarsrecord 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
-
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
-