Class Food.Builder (0.2.0)

public static final class Food.Builder extends GeneratedMessage.Builder<Food.Builder> implements FoodOrBuilder

Represents a food item.

Protobuf type google.devicesandservices.health.v4.Food

Implements

FoodOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllNutrients(Iterable<? extends NutrientQuantity> values)

public Food.Builder addAllNutrients(Iterable<? extends NutrientQuantity> values)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<? extends com.google.devicesandservices.health.v4.NutrientQuantity>
Returns
Type Description
Food.Builder

addAllServings(Iterable<? extends Food.FoodServing> values)

public Food.Builder addAllServings(Iterable<? extends Food.FoodServing> values)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<? extends com.google.devicesandservices.health.v4.Food.FoodServing>
Returns
Type Description
Food.Builder

addNutrients(NutrientQuantity value)

public Food.Builder addNutrients(NutrientQuantity value)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value NutrientQuantity
Returns
Type Description
Food.Builder

addNutrients(NutrientQuantity.Builder builderForValue)

public Food.Builder addNutrients(NutrientQuantity.Builder builderForValue)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue NutrientQuantity.Builder
Returns
Type Description
Food.Builder

addNutrients(int index, NutrientQuantity value)

public Food.Builder addNutrients(int index, NutrientQuantity value)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value NutrientQuantity
Returns
Type Description
Food.Builder

addNutrients(int index, NutrientQuantity.Builder builderForValue)

public Food.Builder addNutrients(int index, NutrientQuantity.Builder builderForValue)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue NutrientQuantity.Builder
Returns
Type Description
Food.Builder

addNutrientsBuilder()

public NutrientQuantity.Builder addNutrientsBuilder()

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
NutrientQuantity.Builder

addNutrientsBuilder(int index)

public NutrientQuantity.Builder addNutrientsBuilder(int index)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NutrientQuantity.Builder

addServings(Food.FoodServing value)

public Food.Builder addServings(Food.FoodServing value)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Food.FoodServing
Returns
Type Description
Food.Builder

addServings(Food.FoodServing.Builder builderForValue)

public Food.Builder addServings(Food.FoodServing.Builder builderForValue)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Food.FoodServing.Builder
Returns
Type Description
Food.Builder

addServings(int index, Food.FoodServing value)

public Food.Builder addServings(int index, Food.FoodServing value)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Food.FoodServing
Returns
Type Description
Food.Builder

addServings(int index, Food.FoodServing.Builder builderForValue)

public Food.Builder addServings(int index, Food.FoodServing.Builder builderForValue)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Food.FoodServing.Builder
Returns
Type Description
Food.Builder

addServingsBuilder()

public Food.FoodServing.Builder addServingsBuilder()

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.FoodServing.Builder

addServingsBuilder(int index)

public Food.FoodServing.Builder addServingsBuilder(int index)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Food.FoodServing.Builder

build()

public Food build()
Returns
Type Description
Food

buildPartial()

public Food buildPartial()
Returns
Type Description
Food

clear()

public Food.Builder clear()
Returns
Type Description
Food.Builder
Overrides

clearAccessLevel()

public Food.Builder clearAccessLevel()

Required. The access level of the food.

.google.devicesandservices.health.v4.FoodAccessLevel access_level = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Food.Builder

This builder for chaining.

clearBrand()

public Food.Builder clearBrand()

Optional. The brand of the food.

string brand = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

This builder for chaining.

clearDefaultServing()

public Food.Builder clearDefaultServing()

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Food.Builder

clearDescription()

public Food.Builder clearDescription()

Optional. The description of the food.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

This builder for chaining.

clearDisplayName()

public Food.Builder clearDisplayName()

Required. The display name of the food.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Food.Builder

This builder for chaining.

clearEnergyAvg()

public Food.Builder clearEnergyAvg()

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearEnergyFromFat()

public Food.Builder clearEnergyFromFat()

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearEnergyMax()

public Food.Builder clearEnergyMax()

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearEnergyMin()

public Food.Builder clearEnergyMin()

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearLanguageCode()

public Food.Builder clearLanguageCode()

Optional. The language code where the food is available in format xx-XX. Supported values are defined in Settings.food_language_code.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

This builder for chaining.

clearMealType()

public Food.Builder clearMealType()

Optional. The meal type associated with this food.

.google.devicesandservices.health.v4.MealType meal_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

This builder for chaining.

clearNutrients()

public Food.Builder clearNutrients()

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearServings()

public Food.Builder clearServings()

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearTotalCarbohydrate()

public Food.Builder clearTotalCarbohydrate()

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

clearTotalFat()

public Food.Builder clearTotalFat()

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Food.Builder

getAccessLevel()

public FoodAccessLevel getAccessLevel()

Required. The access level of the food.

.google.devicesandservices.health.v4.FoodAccessLevel access_level = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
FoodAccessLevel

The accessLevel.

getAccessLevelValue()

public int getAccessLevelValue()

Required. The access level of the food.

.google.devicesandservices.health.v4.FoodAccessLevel access_level = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for accessLevel.

getBrand()

public String getBrand()

Optional. The brand of the food.

string brand = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The brand.

getBrandBytes()

public ByteString getBrandBytes()

Optional. The brand of the food.

string brand = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for brand.

getDefaultInstanceForType()

public Food getDefaultInstanceForType()
Returns
Type Description
Food

getDefaultServing()

public Food.FoodServing getDefaultServing()

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Food.FoodServing

The defaultServing.

getDefaultServingBuilder()

public Food.FoodServing.Builder getDefaultServingBuilder()

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Food.FoodServing.Builder

getDefaultServingOrBuilder()

public Food.FoodServingOrBuilder getDefaultServingOrBuilder()

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Food.FoodServingOrBuilder

getDescription()

public String getDescription()

Optional. The description of the food.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. The description of the food.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

Required. The display name of the food.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The display name of the food.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getEnergyAvg()

public EnergyQuantity getEnergyAvg()

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity

The energyAvg.

getEnergyAvgBuilder()

public EnergyQuantity.Builder getEnergyAvgBuilder()

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity.Builder

getEnergyAvgOrBuilder()

public EnergyQuantityOrBuilder getEnergyAvgOrBuilder()

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantityOrBuilder

getEnergyFromFat()

public EnergyQuantity getEnergyFromFat()

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity

The energyFromFat.

getEnergyFromFatBuilder()

public EnergyQuantity.Builder getEnergyFromFatBuilder()

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity.Builder

getEnergyFromFatOrBuilder()

public EnergyQuantityOrBuilder getEnergyFromFatOrBuilder()

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantityOrBuilder

getEnergyMax()

public EnergyQuantity getEnergyMax()

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity

The energyMax.

getEnergyMaxBuilder()

public EnergyQuantity.Builder getEnergyMaxBuilder()

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity.Builder

getEnergyMaxOrBuilder()

public EnergyQuantityOrBuilder getEnergyMaxOrBuilder()

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantityOrBuilder

getEnergyMin()

public EnergyQuantity getEnergyMin()

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity

The energyMin.

getEnergyMinBuilder()

public EnergyQuantity.Builder getEnergyMinBuilder()

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantity.Builder

getEnergyMinOrBuilder()

public EnergyQuantityOrBuilder getEnergyMinOrBuilder()

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
EnergyQuantityOrBuilder

getLanguageCode()

public String getLanguageCode()

Optional. The language code where the food is available in format xx-XX. Supported values are defined in Settings.food_language_code.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

Optional. The language code where the food is available in format xx-XX. Supported values are defined in Settings.food_language_code.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for languageCode.

getMealType()

public MealType getMealType()

Optional. The meal type associated with this food.

.google.devicesandservices.health.v4.MealType meal_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
MealType

The mealType.

getMealTypeValue()

public int getMealTypeValue()

Optional. The meal type associated with this food.

.google.devicesandservices.health.v4.MealType meal_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for mealType.

getNutrients(int index)

public NutrientQuantity getNutrients(int index)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NutrientQuantity

getNutrientsBuilder(int index)

public NutrientQuantity.Builder getNutrientsBuilder(int index)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NutrientQuantity.Builder

getNutrientsBuilderList()

public List<NutrientQuantity.Builder> getNutrientsBuilderList()

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getNutrientsCount()

public int getNutrientsCount()

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getNutrientsList()

public List<NutrientQuantity> getNutrientsList()

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<NutrientQuantity>

getNutrientsOrBuilder(int index)

public NutrientQuantityOrBuilder getNutrientsOrBuilder(int index)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NutrientQuantityOrBuilder

getNutrientsOrBuilderList()

public List<? extends NutrientQuantityOrBuilder> getNutrientsOrBuilderList()

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.devicesandservices.health.v4.NutrientQuantityOrBuilder>

getServings(int index)

public Food.FoodServing getServings(int index)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Food.FoodServing

getServingsBuilder(int index)

public Food.FoodServing.Builder getServingsBuilder(int index)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Food.FoodServing.Builder

getServingsBuilderList()

public List<Food.FoodServing.Builder> getServingsBuilderList()

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getServingsCount()

public int getServingsCount()

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getServingsList()

public List<Food.FoodServing> getServingsList()

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<FoodServing>

getServingsOrBuilder(int index)

public Food.FoodServingOrBuilder getServingsOrBuilder(int index)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Food.FoodServingOrBuilder

getServingsOrBuilderList()

public List<? extends Food.FoodServingOrBuilder> getServingsOrBuilderList()

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.devicesandservices.health.v4.Food.FoodServingOrBuilder>

getTotalCarbohydrate()

public WeightQuantity getTotalCarbohydrate()

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
WeightQuantity

The totalCarbohydrate.

getTotalCarbohydrateBuilder()

public WeightQuantity.Builder getTotalCarbohydrateBuilder()

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
WeightQuantity.Builder

getTotalCarbohydrateOrBuilder()

public WeightQuantityOrBuilder getTotalCarbohydrateOrBuilder()

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
WeightQuantityOrBuilder

getTotalFat()

public WeightQuantity getTotalFat()

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
WeightQuantity

The totalFat.

getTotalFatBuilder()

public WeightQuantity.Builder getTotalFatBuilder()

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
WeightQuantity.Builder

getTotalFatOrBuilder()

public WeightQuantityOrBuilder getTotalFatOrBuilder()

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
WeightQuantityOrBuilder

hasDefaultServing()

public boolean hasDefaultServing()

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the defaultServing field is set.

hasEnergyAvg()

public boolean hasEnergyAvg()

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the energyAvg field is set.

hasEnergyFromFat()

public boolean hasEnergyFromFat()

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the energyFromFat field is set.

hasEnergyMax()

public boolean hasEnergyMax()

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the energyMax field is set.

hasEnergyMin()

public boolean hasEnergyMin()

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the energyMin field is set.

hasTotalCarbohydrate()

public boolean hasTotalCarbohydrate()

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the totalCarbohydrate field is set.

hasTotalFat()

public boolean hasTotalFat()

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the totalFat field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeDefaultServing(Food.FoodServing value)

public Food.Builder mergeDefaultServing(Food.FoodServing value)

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Food.FoodServing
Returns
Type Description
Food.Builder

mergeEnergyAvg(EnergyQuantity value)

public Food.Builder mergeEnergyAvg(EnergyQuantity value)

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

mergeEnergyFromFat(EnergyQuantity value)

public Food.Builder mergeEnergyFromFat(EnergyQuantity value)

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

mergeEnergyMax(EnergyQuantity value)

public Food.Builder mergeEnergyMax(EnergyQuantity value)

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

mergeEnergyMin(EnergyQuantity value)

public Food.Builder mergeEnergyMin(EnergyQuantity value)

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

mergeFrom(Food other)

public Food.Builder mergeFrom(Food other)
Parameter
Name Description
other Food
Returns
Type Description
Food.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Food.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Food.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Food.Builder
Overrides

mergeTotalCarbohydrate(WeightQuantity value)

public Food.Builder mergeTotalCarbohydrate(WeightQuantity value)

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value WeightQuantity
Returns
Type Description
Food.Builder

mergeTotalFat(WeightQuantity value)

public Food.Builder mergeTotalFat(WeightQuantity value)

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value WeightQuantity
Returns
Type Description
Food.Builder

removeNutrients(int index)

public Food.Builder removeNutrients(int index)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Food.Builder

removeServings(int index)

public Food.Builder removeServings(int index)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Food.Builder

setAccessLevel(FoodAccessLevel value)

public Food.Builder setAccessLevel(FoodAccessLevel value)

Required. The access level of the food.

.google.devicesandservices.health.v4.FoodAccessLevel access_level = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value FoodAccessLevel

The accessLevel to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setAccessLevelValue(int value)

public Food.Builder setAccessLevelValue(int value)

Required. The access level of the food.

.google.devicesandservices.health.v4.FoodAccessLevel access_level = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

The enum numeric value on the wire for accessLevel to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setBrand(String value)

public Food.Builder setBrand(String value)

Optional. The brand of the food.

string brand = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The brand to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setBrandBytes(ByteString value)

public Food.Builder setBrandBytes(ByteString value)

Optional. The brand of the food.

string brand = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for brand to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setDefaultServing(Food.FoodServing value)

public Food.Builder setDefaultServing(Food.FoodServing value)

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Food.FoodServing
Returns
Type Description
Food.Builder

setDefaultServing(Food.FoodServing.Builder builderForValue)

public Food.Builder setDefaultServing(Food.FoodServing.Builder builderForValue)

Required. Value representing the default serving of the food.

.google.devicesandservices.health.v4.Food.FoodServing default_serving = 19 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Food.FoodServing.Builder
Returns
Type Description
Food.Builder

setDescription(String value)

public Food.Builder setDescription(String value)

Optional. The description of the food.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The description to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public Food.Builder setDescriptionBytes(ByteString value)

Optional. The description of the food.

string description = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setDisplayName(String value)

public Food.Builder setDisplayName(String value)

Required. The display name of the food.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public Food.Builder setDisplayNameBytes(ByteString value)

Required. The display name of the food.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setEnergyAvg(EnergyQuantity value)

public Food.Builder setEnergyAvg(EnergyQuantity value)

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

setEnergyAvg(EnergyQuantity.Builder builderForValue)

public Food.Builder setEnergyAvg(EnergyQuantity.Builder builderForValue)

Optional. Value representing the average energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_avg = 17 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue EnergyQuantity.Builder
Returns
Type Description
Food.Builder

setEnergyFromFat(EnergyQuantity value)

public Food.Builder setEnergyFromFat(EnergyQuantity value)

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

setEnergyFromFat(EnergyQuantity.Builder builderForValue)

public Food.Builder setEnergyFromFat(EnergyQuantity.Builder builderForValue)

Optional. Value representing the energy from fat of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 13 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue EnergyQuantity.Builder
Returns
Type Description
Food.Builder

setEnergyMax(EnergyQuantity value)

public Food.Builder setEnergyMax(EnergyQuantity value)

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

setEnergyMax(EnergyQuantity.Builder builderForValue)

public Food.Builder setEnergyMax(EnergyQuantity.Builder builderForValue)

Optional. Value representing the maximum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_max = 18 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue EnergyQuantity.Builder
Returns
Type Description
Food.Builder

setEnergyMin(EnergyQuantity value)

public Food.Builder setEnergyMin(EnergyQuantity value)

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value EnergyQuantity
Returns
Type Description
Food.Builder

setEnergyMin(EnergyQuantity.Builder builderForValue)

public Food.Builder setEnergyMin(EnergyQuantity.Builder builderForValue)

Optional. Value representing the minimum energy of the food for the default serving.

.google.devicesandservices.health.v4.EnergyQuantity energy_min = 16 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue EnergyQuantity.Builder
Returns
Type Description
Food.Builder

setLanguageCode(String value)

public Food.Builder setLanguageCode(String value)

Optional. The language code where the food is available in format xx-XX. Supported values are defined in Settings.food_language_code.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The languageCode to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setLanguageCodeBytes(ByteString value)

public Food.Builder setLanguageCodeBytes(ByteString value)

Optional. The language code where the food is available in format xx-XX. Supported values are defined in Settings.food_language_code.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for languageCode to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setMealType(MealType value)

public Food.Builder setMealType(MealType value)

Optional. The meal type associated with this food.

.google.devicesandservices.health.v4.MealType meal_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value MealType

The mealType to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setMealTypeValue(int value)

public Food.Builder setMealTypeValue(int value)

Optional. The meal type associated with this food.

.google.devicesandservices.health.v4.MealType meal_type = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value int

The enum numeric value on the wire for mealType to set.

Returns
Type Description
Food.Builder

This builder for chaining.

setNutrients(int index, NutrientQuantity value)

public Food.Builder setNutrients(int index, NutrientQuantity value)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value NutrientQuantity
Returns
Type Description
Food.Builder

setNutrients(int index, NutrientQuantity.Builder builderForValue)

public Food.Builder setNutrients(int index, NutrientQuantity.Builder builderForValue)

Optional. Value representing the nutrients of the food for the default serving.

repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 12 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue NutrientQuantity.Builder
Returns
Type Description
Food.Builder

setServings(int index, Food.FoodServing value)

public Food.Builder setServings(int index, Food.FoodServing value)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Food.FoodServing
Returns
Type Description
Food.Builder

setServings(int index, Food.FoodServing.Builder builderForValue)

public Food.Builder setServings(int index, Food.FoodServing.Builder builderForValue)

Optional. The serving of the food.

repeated .google.devicesandservices.health.v4.Food.FoodServing servings = 20 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Food.FoodServing.Builder
Returns
Type Description
Food.Builder

setTotalCarbohydrate(WeightQuantity value)

public Food.Builder setTotalCarbohydrate(WeightQuantity value)

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value WeightQuantity
Returns
Type Description
Food.Builder

setTotalCarbohydrate(WeightQuantity.Builder builderForValue)

public Food.Builder setTotalCarbohydrate(WeightQuantity.Builder builderForValue)

Optional. Value representing the total carbohydrate of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 14 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue WeightQuantity.Builder
Returns
Type Description
Food.Builder

setTotalFat(WeightQuantity value)

public Food.Builder setTotalFat(WeightQuantity value)

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value WeightQuantity
Returns
Type Description
Food.Builder

setTotalFat(WeightQuantity.Builder builderForValue)

public Food.Builder setTotalFat(WeightQuantity.Builder builderForValue)

Optional. Value representing the total fat of the food for the default serving.

.google.devicesandservices.health.v4.WeightQuantity total_fat = 15 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue WeightQuantity.Builder
Returns
Type Description
Food.Builder