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

Added in API level 34
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

Added in API level 34
public NutritionRecord build ()

Returns
NutritionRecord Object of NutritionRecord This value cannot be null.

clearEndZoneOffset

Added in API level 34
public NutritionRecord.Builder clearEndZoneOffset ()

Sets the start zone offset of this record to system default.

Returns
NutritionRecord.Builder This value cannot be null.

clearStartZoneOffset

Added in API level 34
public NutritionRecord.Builder clearStartZoneOffset ()

Sets the start zone offset of this record to system default.

Returns
NutritionRecord.Builder This value cannot be null.

setBiotin

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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.