NutritionRecord.Builder
public
static
final
class
NutritionRecord.Builder
extends Object
java.lang.Object | |
↳ | android.health.connect.datatypes.NutritionRecord.Builder |
Builder class for NutritionRecord
Summary
Public constructors | |
---|---|
Builder(Metadata metadata, Instant startTime, Instant endTime)
|
Public methods | |
---|---|
NutritionRecord
|
build()
|
NutritionRecord.Builder
|
clearEndZoneOffset()
Sets the start zone offset of this record to system default. |
NutritionRecord.Builder
|
clearStartZoneOffset()
Sets the start zone offset of this record to system default. |
NutritionRecord.Builder
|
setBiotin(Mass biotin)
Sets the biotin of this activity |
NutritionRecord.Builder
|
setCaffeine(Mass caffeine)
Sets the caffeine of this activity |
NutritionRecord.Builder
|
setCalcium(Mass calcium)
Sets the calcium of this activity |
NutritionRecord.Builder
|
setChloride(Mass chloride)
Sets the chloride of this activity |
NutritionRecord.Builder
|
setCholesterol(Mass cholesterol)
Sets the cholesterol of this activity |
NutritionRecord.Builder
|
setChromium(Mass chromium)
Sets the chromium of this activity |
NutritionRecord.Builder
|
setCopper(Mass copper)
Sets the copper of this activity |
NutritionRecord.Builder
|
setDietaryFiber(Mass dietaryFiber)
Sets the dietaryFiber of this activity |
NutritionRecord.Builder
|
setEndZoneOffset(ZoneOffset endZoneOffset)
Sets the zone offset of the user when the activity ended |
NutritionRecord.Builder
|
setEnergy(Energy energy)
Sets the energy of this activity |
NutritionRecord.Builder
|
setEnergyFromFat(Energy energyFromFat)
Sets the energyFromFat of this activity |
NutritionRecord.Builder
|
setFolate(Mass folate)
Sets the folate of this activity |
NutritionRecord.Builder
|
setFolicAcid(Mass folicAcid)
Sets the folicAcid of this activity |
NutritionRecord.Builder
|
setIodine(Mass iodine)
Sets the iodine of this activity |
NutritionRecord.Builder
|
setIron(Mass iron)
Sets the iron of this activity |
NutritionRecord.Builder
|
setMagnesium(Mass magnesium)
Sets the magnesium of this activity |
NutritionRecord.Builder
|
setManganese(Mass manganese)
Sets the manganese of this activity |
NutritionRecord.Builder
|
setMealName(String mealName)
Sets the name of this activity |
NutritionRecord.Builder
|
setMealType(int mealType)
Sets the mealType of this activity |
NutritionRecord.Builder
|
setMolybdenum(Mass molybdenum)
Sets the molybdenum of this activity |
NutritionRecord.Builder
|
setMonounsaturatedFat(Mass monounsaturatedFat)
Sets the monounsaturatedFat of this activity |
NutritionRecord.Builder
|
setNiacin(Mass niacin)
Sets the niacin of this activity |
NutritionRecord.Builder
|
setPantothenicAcid(Mass pantothenicAcid)
Sets the pantothenicAcid of this activity |
NutritionRecord.Builder
|
setPhosphorus(Mass phosphorus)
Sets the phosphorus of this activity |
NutritionRecord.Builder
|
setPolyunsaturatedFat(Mass polyunsaturatedFat)
Sets the polyunsaturatedFat of this activity |
NutritionRecord.Builder
|
setPotassium(Mass potassium)
Sets the potassium of this activity |
NutritionRecord.Builder
|
setProtein(Mass protein)
Sets the protein of this activity |
NutritionRecord.Builder
|
setRiboflavin(Mass riboflavin)
Sets the riboflavin of this activity |
NutritionRecord.Builder
|
setSaturatedFat(Mass saturatedFat)
Sets the saturatedFat of this activity |
NutritionRecord.Builder
|
setSelenium(Mass selenium)
Sets the selenium of this activity |
NutritionRecord.Builder
|
setSodium(Mass sodium)
Sets the sodium of this activity |
NutritionRecord.Builder
|
setStartZoneOffset(ZoneOffset startZoneOffset)
Sets the zone offset of the user when the activity started |
NutritionRecord.Builder
|
setSugar(Mass sugar)
Sets the sugar of this activity |
NutritionRecord.Builder
|
setThiamin(Mass thiamin)
Sets the thiamin of this activity |
NutritionRecord.Builder
|
setTotalCarbohydrate(Mass totalCarbohydrate)
Sets the totalCarbohydrate of this activity |
NutritionRecord.Builder
|
setTotalFat(Mass totalFat)
Sets the totalFat of this activity |
NutritionRecord.Builder
|
setTransFat(Mass transFat)
Sets the transFat of this activity |
NutritionRecord.Builder
|
setUnsaturatedFat(Mass unsaturatedFat)
Sets the unsaturatedFat of this activity |
NutritionRecord.Builder
|
setVitaminA(Mass vitaminA)
Sets the vitaminA of this activity |
NutritionRecord.Builder
|
setVitaminB12(Mass vitaminB12)
Sets the vitaminB12 of this activity |
NutritionRecord.Builder
|
setVitaminB6(Mass vitaminB6)
Sets the vitaminB6 of this activity |
NutritionRecord.Builder
|
setVitaminC(Mass vitaminC)
Sets the vitaminC of this activity |
NutritionRecord.Builder
|
setVitaminD(Mass vitaminD)
Sets the vitaminD of this activity |
NutritionRecord.Builder
|
setVitaminE(Mass vitaminE)
Sets the vitaminE of this activity |
NutritionRecord.Builder
|
setVitaminK(Mass vitaminK)
Sets the vitaminK of this activity |
NutritionRecord.Builder
|
setZinc(Mass zinc)
Sets the zinc of this activity |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (Metadata metadata, Instant startTime, Instant endTime)
Parameters | |
---|---|
metadata |
Metadata : Metadata to be associated with the record. See Metadata .
This value cannot be null . |
startTime |
Instant : Start time of this activity
This value cannot be null . |
endTime |
Instant : End time of this activity
This value cannot be null . |
Public methods
build
public NutritionRecord build ()
Returns | |
---|---|
NutritionRecord |
Object of NutritionRecord
This value cannot be null . |
clearEndZoneOffset
public NutritionRecord.Builder clearEndZoneOffset ()
Sets the start zone offset of this record to system default.
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
clearStartZoneOffset
public NutritionRecord.Builder clearStartZoneOffset ()
Sets the start zone offset of this record to system default.
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setBiotin
public NutritionRecord.Builder setBiotin (Mass biotin)
Sets the biotin of this activity
Parameters | |
---|---|
biotin |
Mass : Biotin of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setCaffeine
public NutritionRecord.Builder setCaffeine (Mass caffeine)
Sets the caffeine of this activity
Parameters | |
---|---|
caffeine |
Mass : Caffeine of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setCalcium
public NutritionRecord.Builder setCalcium (Mass calcium)
Sets the calcium of this activity
Parameters | |
---|---|
calcium |
Mass : Calcium of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setChloride
public NutritionRecord.Builder setChloride (Mass chloride)
Sets the chloride of this activity
Parameters | |
---|---|
chloride |
Mass : Chloride of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setCholesterol
public NutritionRecord.Builder setCholesterol (Mass cholesterol)
Sets the cholesterol of this activity
Parameters | |
---|---|
cholesterol |
Mass : Cholesterol of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setChromium
public NutritionRecord.Builder setChromium (Mass chromium)
Sets the chromium of this activity
Parameters | |
---|---|
chromium |
Mass : Chromium of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setCopper
public NutritionRecord.Builder setCopper (Mass copper)
Sets the copper of this activity
Parameters | |
---|---|
copper |
Mass : Copper of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setDietaryFiber
public NutritionRecord.Builder setDietaryFiber (Mass dietaryFiber)
Sets the dietaryFiber of this activity
Parameters | |
---|---|
dietaryFiber |
Mass : DietaryFiber of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setEndZoneOffset
public NutritionRecord.Builder setEndZoneOffset (ZoneOffset endZoneOffset)
Sets the zone offset of the user when the activity ended
Parameters | |
---|---|
endZoneOffset |
ZoneOffset : This value cannot be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setEnergy
public NutritionRecord.Builder setEnergy (Energy energy)
Sets the energy of this activity
Parameters | |
---|---|
energy |
Energy : Energy of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setEnergyFromFat
public NutritionRecord.Builder setEnergyFromFat (Energy energyFromFat)
Sets the energyFromFat of this activity
Parameters | |
---|---|
energyFromFat |
Energy : EnergyFromFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setFolate
public NutritionRecord.Builder setFolate (Mass folate)
Sets the folate of this activity
Parameters | |
---|---|
folate |
Mass : Folate of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setFolicAcid
public NutritionRecord.Builder setFolicAcid (Mass folicAcid)
Sets the folicAcid of this activity
Parameters | |
---|---|
folicAcid |
Mass : FolicAcid of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setIodine
public NutritionRecord.Builder setIodine (Mass iodine)
Sets the iodine of this activity
Parameters | |
---|---|
iodine |
Mass : Iodine of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setIron
public NutritionRecord.Builder setIron (Mass iron)
Sets the iron of this activity
Parameters | |
---|---|
iron |
Mass : Iron of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setMagnesium
public NutritionRecord.Builder setMagnesium (Mass magnesium)
Sets the magnesium of this activity
Parameters | |
---|---|
magnesium |
Mass : Magnesium of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setManganese
public NutritionRecord.Builder setManganese (Mass manganese)
Sets the manganese of this activity
Parameters | |
---|---|
manganese |
Mass : Manganese of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setMealName
public NutritionRecord.Builder setMealName (String mealName)
Sets the name of this activity
Parameters | |
---|---|
mealName |
String : Name of this activity
This value cannot be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setMealType
public NutritionRecord.Builder setMealType (int mealType)
Sets the mealType of this activity
Parameters | |
---|---|
mealType |
int : MealType of this activity
Value is MealType.MEAL_TYPE_UNKNOWN , MealType.MEAL_TYPE_BREAKFAST , MealType.MEAL_TYPE_LUNCH , MealType.MEAL_TYPE_DINNER , or MealType.MEAL_TYPE_SNACK |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setMolybdenum
public NutritionRecord.Builder setMolybdenum (Mass molybdenum)
Sets the molybdenum of this activity
Parameters | |
---|---|
molybdenum |
Mass : Molybdenum of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setMonounsaturatedFat
public NutritionRecord.Builder setMonounsaturatedFat (Mass monounsaturatedFat)
Sets the monounsaturatedFat of this activity
Parameters | |
---|---|
monounsaturatedFat |
Mass : MonounsaturatedFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setNiacin
public NutritionRecord.Builder setNiacin (Mass niacin)
Sets the niacin of this activity
Parameters | |
---|---|
niacin |
Mass : Niacin of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setPantothenicAcid
public NutritionRecord.Builder setPantothenicAcid (Mass pantothenicAcid)
Sets the pantothenicAcid of this activity
Parameters | |
---|---|
pantothenicAcid |
Mass : PantothenicAcid of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setPhosphorus
public NutritionRecord.Builder setPhosphorus (Mass phosphorus)
Sets the phosphorus of this activity
Parameters | |
---|---|
phosphorus |
Mass : Phosphorus of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setPolyunsaturatedFat
public NutritionRecord.Builder setPolyunsaturatedFat (Mass polyunsaturatedFat)
Sets the polyunsaturatedFat of this activity
Parameters | |
---|---|
polyunsaturatedFat |
Mass : PolyunsaturatedFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setPotassium
public NutritionRecord.Builder setPotassium (Mass potassium)
Sets the potassium of this activity
Parameters | |
---|---|
potassium |
Mass : Potassium of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setProtein
public NutritionRecord.Builder setProtein (Mass protein)
Sets the protein of this activity
Parameters | |
---|---|
protein |
Mass : Protein of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setRiboflavin
public NutritionRecord.Builder setRiboflavin (Mass riboflavin)
Sets the riboflavin of this activity
Parameters | |
---|---|
riboflavin |
Mass : Riboflavin of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setSaturatedFat
public NutritionRecord.Builder setSaturatedFat (Mass saturatedFat)
Sets the saturatedFat of this activity
Parameters | |
---|---|
saturatedFat |
Mass : SaturatedFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setSelenium
public NutritionRecord.Builder setSelenium (Mass selenium)
Sets the selenium of this activity
Parameters | |
---|---|
selenium |
Mass : Selenium of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setSodium
public NutritionRecord.Builder setSodium (Mass sodium)
Sets the sodium of this activity
Parameters | |
---|---|
sodium |
Mass : Sodium of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setStartZoneOffset
public NutritionRecord.Builder setStartZoneOffset (ZoneOffset startZoneOffset)
Sets the zone offset of the user when the activity started
Parameters | |
---|---|
startZoneOffset |
ZoneOffset : This value cannot be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setSugar
public NutritionRecord.Builder setSugar (Mass sugar)
Sets the sugar of this activity
Parameters | |
---|---|
sugar |
Mass : Sugar of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setThiamin
public NutritionRecord.Builder setThiamin (Mass thiamin)
Sets the thiamin of this activity
Parameters | |
---|---|
thiamin |
Mass : Thiamin of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setTotalCarbohydrate
public NutritionRecord.Builder setTotalCarbohydrate (Mass totalCarbohydrate)
Sets the totalCarbohydrate of this activity
Parameters | |
---|---|
totalCarbohydrate |
Mass : TotalCarbohydrate of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setTotalFat
public NutritionRecord.Builder setTotalFat (Mass totalFat)
Sets the totalFat of this activity
Parameters | |
---|---|
totalFat |
Mass : TotalFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setTransFat
public NutritionRecord.Builder setTransFat (Mass transFat)
Sets the transFat of this activity
Parameters | |
---|---|
transFat |
Mass : TransFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setUnsaturatedFat
public NutritionRecord.Builder setUnsaturatedFat (Mass unsaturatedFat)
Sets the unsaturatedFat of this activity
Parameters | |
---|---|
unsaturatedFat |
Mass : UnsaturatedFat of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminA
public NutritionRecord.Builder setVitaminA (Mass vitaminA)
Sets the vitaminA of this activity
Parameters | |
---|---|
vitaminA |
Mass : VitaminA of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminB12
public NutritionRecord.Builder setVitaminB12 (Mass vitaminB12)
Sets the vitaminB12 of this activity
Parameters | |
---|---|
vitaminB12 |
Mass : VitaminB12 of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminB6
public NutritionRecord.Builder setVitaminB6 (Mass vitaminB6)
Sets the vitaminB6 of this activity
Parameters | |
---|---|
vitaminB6 |
Mass : VitaminB6 of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminC
public NutritionRecord.Builder setVitaminC (Mass vitaminC)
Sets the vitaminC of this activity
Parameters | |
---|---|
vitaminC |
Mass : VitaminC of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminD
public NutritionRecord.Builder setVitaminD (Mass vitaminD)
Sets the vitaminD of this activity
Parameters | |
---|---|
vitaminD |
Mass : VitaminD of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminE
public NutritionRecord.Builder setVitaminE (Mass vitaminE)
Sets the vitaminE of this activity
Parameters | |
---|---|
vitaminE |
Mass : VitaminE of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setVitaminK
public NutritionRecord.Builder setVitaminK (Mass vitaminK)
Sets the vitaminK of this activity
Parameters | |
---|---|
vitaminK |
Mass : VitaminK of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |
setZinc
public NutritionRecord.Builder setZinc (Mass zinc)
Sets the zinc of this activity
Parameters | |
---|---|
zinc |
Mass : Zinc of this activity
This value may be null . |
Returns | |
---|---|
NutritionRecord.Builder |
This value cannot be null . |