Record Class NutritionPlanner.MacroTargets
java.lang.Object
java.lang.Record
org.episteme.social.sports.NutritionPlanner.MacroTargets
- All Implemented Interfaces:
Serializable
- Enclosing class:
NutritionPlanner
public static record NutritionPlanner.MacroTargets(double calories, double proteinGrams, double carbsGrams, double fatGrams, double fiberGrams)
extends Record
implements Serializable
Macro-nutrient distribution targets.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMacroTargets(double calories, double proteinGrams, double carbsGrams, double fatGrams, double fiberGrams) Creates an instance of aMacroTargetsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalories()Returns the value of thecaloriesrecord component.doubleReturns the value of thecarbsGramsrecord component.final booleanIndicates whether some other object is "equal to" this one.doublefatGrams()Returns the value of thefatGramsrecord component.doubleReturns the value of thefiberGramsrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theproteinGramsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MacroTargets
public MacroTargets(double calories, double proteinGrams, double carbsGrams, double fatGrams, double fiberGrams) Creates an instance of aMacroTargetsrecord class.- Parameters:
calories- the value for thecaloriesrecord componentproteinGrams- the value for theproteinGramsrecord componentcarbsGrams- the value for thecarbsGramsrecord componentfatGrams- the value for thefatGramsrecord componentfiberGrams- the value for thefiberGramsrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
calories
public double calories()Returns the value of thecaloriesrecord component.- Returns:
- the value of the
caloriesrecord component
-
proteinGrams
public double proteinGrams()Returns the value of theproteinGramsrecord component.- Returns:
- the value of the
proteinGramsrecord component
-
carbsGrams
public double carbsGrams()Returns the value of thecarbsGramsrecord component.- Returns:
- the value of the
carbsGramsrecord component
-
fatGrams
public double fatGrams()Returns the value of thefatGramsrecord component.- Returns:
- the value of the
fatGramsrecord component
-
fiberGrams
public double fiberGrams()Returns the value of thefiberGramsrecord component.- Returns:
- the value of the
fiberGramsrecord component
-