Added in API level 34

Builder

class Builder
kotlin.Any
   ↳ android.health.connect.datatypes.NutritionRecord.Builder

Builder class for NutritionRecord

Summary

Public constructors
Builder(metadata: Metadata, startTime: Instant, endTime: Instant)

Public methods
NutritionRecord

NutritionRecord.Builder

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

NutritionRecord.Builder

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

NutritionRecord.Builder
setBiotin(biotin: Mass?)

Sets the biotin of this activity

NutritionRecord.Builder
setCaffeine(caffeine: Mass?)

Sets the caffeine of this activity

NutritionRecord.Builder
setCalcium(calcium: Mass?)

Sets the calcium of this activity

NutritionRecord.Builder
setChloride(chloride: Mass?)

Sets the chloride of this activity

NutritionRecord.Builder
setCholesterol(cholesterol: Mass?)

Sets the cholesterol of this activity

NutritionRecord.Builder
setChromium(chromium: Mass?)

Sets the chromium of this activity

NutritionRecord.Builder
setCopper(copper: Mass?)

Sets the copper of this activity

NutritionRecord.Builder
setDietaryFiber(dietaryFiber: Mass?)

Sets the dietaryFiber of this activity

NutritionRecord.Builder
setEndZoneOffset(endZoneOffset: ZoneOffset)

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(energyFromFat: Energy?)

Sets the energyFromFat of this activity

NutritionRecord.Builder
setFolate(folate: Mass?)

Sets the folate of this activity

NutritionRecord.Builder
setFolicAcid(folicAcid: Mass?)

Sets the folicAcid of this activity

NutritionRecord.Builder
setIodine(iodine: Mass?)

Sets the iodine of this activity

NutritionRecord.Builder
setIron(iron: Mass?)

Sets the iron of this activity

NutritionRecord.Builder
setMagnesium(magnesium: Mass?)

Sets the magnesium of this activity

NutritionRecord.Builder
setManganese(manganese: Mass?)

Sets the manganese of this activity

NutritionRecord.Builder
setMealName(mealName: String)

Sets the name of this activity

NutritionRecord.Builder
setMealType(mealType: Int)

Sets the mealType of this activity

NutritionRecord.Builder
setMolybdenum(molybdenum: Mass?)

Sets the molybdenum of this activity

NutritionRecord.Builder
setMonounsaturatedFat(monounsaturatedFat: Mass?)

Sets the monounsaturatedFat of this activity

NutritionRecord.Builder
setNiacin(niacin: Mass?)

Sets the niacin of this activity

NutritionRecord.Builder
setPantothenicAcid(pantothenicAcid: Mass?)

Sets the pantothenicAcid of this activity

NutritionRecord.Builder
setPhosphorus(phosphorus: Mass?)

Sets the phosphorus of this activity

NutritionRecord.Builder
setPolyunsaturatedFat(polyunsaturatedFat: Mass?)

Sets the polyunsaturatedFat of this activity

NutritionRecord.Builder
setPotassium(potassium: Mass?)

Sets the potassium of this activity

NutritionRecord.Builder
setProtein(protein: Mass?)

Sets the protein of this activity

NutritionRecord.Builder
setRiboflavin(riboflavin: Mass?)

Sets the riboflavin of this activity

NutritionRecord.Builder
setSaturatedFat(saturatedFat: Mass?)

Sets the saturatedFat of this activity

NutritionRecord.Builder
setSelenium(selenium: Mass?)

Sets the selenium of this activity

NutritionRecord.Builder
setSodium(sodium: Mass?)

Sets the sodium of this activity

NutritionRecord.Builder
setStartZoneOffset(startZoneOffset: ZoneOffset)

Sets the zone offset of the user when the activity started

NutritionRecord.Builder
setSugar(sugar: Mass?)

Sets the sugar of this activity

NutritionRecord.Builder
setThiamin(thiamin: Mass?)

Sets the thiamin of this activity

NutritionRecord.Builder
setTotalCarbohydrate(totalCarbohydrate: Mass?)

Sets the totalCarbohydrate of this activity

NutritionRecord.Builder
setTotalFat(totalFat: Mass?)

Sets the totalFat of this activity

NutritionRecord.Builder
setTransFat(transFat: Mass?)

Sets the transFat of this activity

NutritionRecord.Builder
setUnsaturatedFat(unsaturatedFat: Mass?)

Sets the unsaturatedFat of this activity

NutritionRecord.Builder
setVitaminA(vitaminA: Mass?)

Sets the vitaminA of this activity

NutritionRecord.Builder
setVitaminB12(vitaminB12: Mass?)

Sets the vitaminB12 of this activity

NutritionRecord.Builder
setVitaminB6(vitaminB6: Mass?)

Sets the vitaminB6 of this activity

NutritionRecord.Builder
setVitaminC(vitaminC: Mass?)

Sets the vitaminC of this activity

NutritionRecord.Builder
setVitaminD(vitaminD: Mass?)

Sets the vitaminD of this activity

NutritionRecord.Builder
setVitaminE(vitaminE: Mass?)

Sets the vitaminE of this activity

NutritionRecord.Builder
setVitaminK(vitaminK: Mass?)

Sets the vitaminK of this activity

NutritionRecord.Builder
setZinc(zinc: Mass?)

Sets the zinc of this activity

Public constructors

Builder

Added in API level 34
Builder(
    metadata: Metadata,
    startTime: Instant,
    endTime: Instant)
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
fun build(): NutritionRecord
Return
NutritionRecord Object of NutritionRecord This value cannot be null.

clearEndZoneOffset

Added in API level 34
fun clearEndZoneOffset(): NutritionRecord.Builder

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

Return
NutritionRecord.Builder This value cannot be null.

clearStartZoneOffset

Added in API level 34
fun clearStartZoneOffset(): NutritionRecord.Builder

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

Return
NutritionRecord.Builder This value cannot be null.

setBiotin

Added in API level 34
fun setBiotin(biotin: Mass?): NutritionRecord.Builder

Sets the biotin of this activity

Parameters
biotin Mass?: Biotin of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setCaffeine

Added in API level 34
fun setCaffeine(caffeine: Mass?): NutritionRecord.Builder

Sets the caffeine of this activity

Parameters
caffeine Mass?: Caffeine of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setCalcium

Added in API level 34
fun setCalcium(calcium: Mass?): NutritionRecord.Builder

Sets the calcium of this activity

Parameters
calcium Mass?: Calcium of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setChloride

Added in API level 34
fun setChloride(chloride: Mass?): NutritionRecord.Builder

Sets the chloride of this activity

Parameters
chloride Mass?: Chloride of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setCholesterol

Added in API level 34
fun setCholesterol(cholesterol: Mass?): NutritionRecord.Builder

Sets the cholesterol of this activity

Parameters
cholesterol Mass?: Cholesterol of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setChromium

Added in API level 34
fun setChromium(chromium: Mass?): NutritionRecord.Builder

Sets the chromium of this activity

Parameters
chromium Mass?: Chromium of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setCopper

Added in API level 34
fun setCopper(copper: Mass?): NutritionRecord.Builder

Sets the copper of this activity

Parameters
copper Mass?: Copper of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setDietaryFiber

Added in API level 34
fun setDietaryFiber(dietaryFiber: Mass?): NutritionRecord.Builder

Sets the dietaryFiber of this activity

Parameters
dietaryFiber Mass?: DietaryFiber of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setEndZoneOffset

Added in API level 34
fun setEndZoneOffset(endZoneOffset: ZoneOffset): NutritionRecord.Builder

Sets the zone offset of the user when the activity ended

Parameters
endZoneOffset ZoneOffset: This value cannot be null.
Return
NutritionRecord.Builder This value cannot be null.

setEnergy

Added in API level 34
fun setEnergy(energy: Energy?): NutritionRecord.Builder

Sets the energy of this activity

Parameters
energy Energy?: Energy of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setEnergyFromFat

Added in API level 34
fun setEnergyFromFat(energyFromFat: Energy?): NutritionRecord.Builder

Sets the energyFromFat of this activity

Parameters
energyFromFat Energy?: EnergyFromFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setFolate

Added in API level 34
fun setFolate(folate: Mass?): NutritionRecord.Builder

Sets the folate of this activity

Parameters
folate Mass?: Folate of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setFolicAcid

Added in API level 34
fun setFolicAcid(folicAcid: Mass?): NutritionRecord.Builder

Sets the folicAcid of this activity

Parameters
folicAcid Mass?: FolicAcid of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setIodine

Added in API level 34
fun setIodine(iodine: Mass?): NutritionRecord.Builder

Sets the iodine of this activity

Parameters
iodine Mass?: Iodine of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setIron

Added in API level 34
fun setIron(iron: Mass?): NutritionRecord.Builder

Sets the iron of this activity

Parameters
iron Mass?: Iron of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setMagnesium

Added in API level 34
fun setMagnesium(magnesium: Mass?): NutritionRecord.Builder

Sets the magnesium of this activity

Parameters
magnesium Mass?: Magnesium of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setManganese

Added in API level 34
fun setManganese(manganese: Mass?): NutritionRecord.Builder

Sets the manganese of this activity

Parameters
manganese Mass?: Manganese of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setMealName

Added in API level 34
fun setMealName(mealName: String): NutritionRecord.Builder

Sets the name of this activity

Parameters
mealName String: Name of this activity This value cannot be null.
Return
NutritionRecord.Builder This value cannot be null.

setMolybdenum

Added in API level 34
fun setMolybdenum(molybdenum: Mass?): NutritionRecord.Builder

Sets the molybdenum of this activity

Parameters
molybdenum Mass?: Molybdenum of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setMonounsaturatedFat

Added in API level 34
fun setMonounsaturatedFat(monounsaturatedFat: Mass?): NutritionRecord.Builder

Sets the monounsaturatedFat of this activity

Parameters
monounsaturatedFat Mass?: MonounsaturatedFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setNiacin

Added in API level 34
fun setNiacin(niacin: Mass?): NutritionRecord.Builder

Sets the niacin of this activity

Parameters
niacin Mass?: Niacin of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setPantothenicAcid

Added in API level 34
fun setPantothenicAcid(pantothenicAcid: Mass?): NutritionRecord.Builder

Sets the pantothenicAcid of this activity

Parameters
pantothenicAcid Mass?: PantothenicAcid of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setPhosphorus

Added in API level 34
fun setPhosphorus(phosphorus: Mass?): NutritionRecord.Builder

Sets the phosphorus of this activity

Parameters
phosphorus Mass?: Phosphorus of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setPolyunsaturatedFat

Added in API level 34
fun setPolyunsaturatedFat(polyunsaturatedFat: Mass?): NutritionRecord.Builder

Sets the polyunsaturatedFat of this activity

Parameters
polyunsaturatedFat Mass?: PolyunsaturatedFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setPotassium

Added in API level 34
fun setPotassium(potassium: Mass?): NutritionRecord.Builder

Sets the potassium of this activity

Parameters
potassium Mass?: Potassium of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setProtein

Added in API level 34
fun setProtein(protein: Mass?): NutritionRecord.Builder

Sets the protein of this activity

Parameters
protein Mass?: Protein of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setRiboflavin

Added in API level 34
fun setRiboflavin(riboflavin: Mass?): NutritionRecord.Builder

Sets the riboflavin of this activity

Parameters
riboflavin Mass?: Riboflavin of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setSaturatedFat

Added in API level 34
fun setSaturatedFat(saturatedFat: Mass?): NutritionRecord.Builder

Sets the saturatedFat of this activity

Parameters
saturatedFat Mass?: SaturatedFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setSelenium

Added in API level 34
fun setSelenium(selenium: Mass?): NutritionRecord.Builder

Sets the selenium of this activity

Parameters
selenium Mass?: Selenium of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setSodium

Added in API level 34
fun setSodium(sodium: Mass?): NutritionRecord.Builder

Sets the sodium of this activity

Parameters
sodium Mass?: Sodium of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setStartZoneOffset

Added in API level 34
fun setStartZoneOffset(startZoneOffset: ZoneOffset): NutritionRecord.Builder

Sets the zone offset of the user when the activity started

Parameters
startZoneOffset ZoneOffset: This value cannot be null.
Return
NutritionRecord.Builder This value cannot be null.

setSugar

Added in API level 34
fun setSugar(sugar: Mass?): NutritionRecord.Builder

Sets the sugar of this activity

Parameters
sugar Mass?: Sugar of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setThiamin

Added in API level 34
fun setThiamin(thiamin: Mass?): NutritionRecord.Builder

Sets the thiamin of this activity

Parameters
thiamin Mass?: Thiamin of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setTotalCarbohydrate

Added in API level 34
fun setTotalCarbohydrate(totalCarbohydrate: Mass?): NutritionRecord.Builder

Sets the totalCarbohydrate of this activity

Parameters
totalCarbohydrate Mass?: TotalCarbohydrate of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setTotalFat

Added in API level 34
fun setTotalFat(totalFat: Mass?): NutritionRecord.Builder

Sets the totalFat of this activity

Parameters
totalFat Mass?: TotalFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setTransFat

Added in API level 34
fun setTransFat(transFat: Mass?): NutritionRecord.Builder

Sets the transFat of this activity

Parameters
transFat Mass?: TransFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setUnsaturatedFat

Added in API level 34
fun setUnsaturatedFat(unsaturatedFat: Mass?): NutritionRecord.Builder

Sets the unsaturatedFat of this activity

Parameters
unsaturatedFat Mass?: UnsaturatedFat of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminA

Added in API level 34
fun setVitaminA(vitaminA: Mass?): NutritionRecord.Builder

Sets the vitaminA of this activity

Parameters
vitaminA Mass?: VitaminA of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminB12

Added in API level 34
fun setVitaminB12(vitaminB12: Mass?): NutritionRecord.Builder

Sets the vitaminB12 of this activity

Parameters
vitaminB12 Mass?: VitaminB12 of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminB6

Added in API level 34
fun setVitaminB6(vitaminB6: Mass?): NutritionRecord.Builder

Sets the vitaminB6 of this activity

Parameters
vitaminB6 Mass?: VitaminB6 of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminC

Added in API level 34
fun setVitaminC(vitaminC: Mass?): NutritionRecord.Builder

Sets the vitaminC of this activity

Parameters
vitaminC Mass?: VitaminC of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminD

Added in API level 34
fun setVitaminD(vitaminD: Mass?): NutritionRecord.Builder

Sets the vitaminD of this activity

Parameters
vitaminD Mass?: VitaminD of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminE

Added in API level 34
fun setVitaminE(vitaminE: Mass?): NutritionRecord.Builder

Sets the vitaminE of this activity

Parameters
vitaminE Mass?: VitaminE of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setVitaminK

Added in API level 34
fun setVitaminK(vitaminK: Mass?): NutritionRecord.Builder

Sets the vitaminK of this activity

Parameters
vitaminK Mass?: VitaminK of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.

setZinc

Added in API level 34
fun setZinc(zinc: Mass?): NutritionRecord.Builder

Sets the zinc of this activity

Parameters
zinc Mass?: Zinc of this activity This value may be null.
Return
NutritionRecord.Builder This value cannot be null.