Class Food (0.2.0)

public final class Food extends GeneratedMessage implements FoodOrBuilder

Represents a food item.

Protobuf type google.devicesandservices.health.v4.Food

Implements

FoodOrBuilder

Static Fields

ACCESS_LEVEL_FIELD_NUMBER

public static final int ACCESS_LEVEL_FIELD_NUMBER
Field Value
Type Description
int

BRAND_FIELD_NUMBER

public static final int BRAND_FIELD_NUMBER
Field Value
Type Description
int

DEFAULT_SERVING_FIELD_NUMBER

public static final int DEFAULT_SERVING_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

ENERGY_AVG_FIELD_NUMBER

public static final int ENERGY_AVG_FIELD_NUMBER
Field Value
Type Description
int

ENERGY_FROM_FAT_FIELD_NUMBER

public static final int ENERGY_FROM_FAT_FIELD_NUMBER
Field Value
Type Description
int

ENERGY_MAX_FIELD_NUMBER

public static final int ENERGY_MAX_FIELD_NUMBER
Field Value
Type Description
int

ENERGY_MIN_FIELD_NUMBER

public static final int ENERGY_MIN_FIELD_NUMBER
Field Value
Type Description
int

LANGUAGE_CODE_FIELD_NUMBER

public static final int LANGUAGE_CODE_FIELD_NUMBER
Field Value
Type Description
int

MEAL_TYPE_FIELD_NUMBER

public static final int MEAL_TYPE_FIELD_NUMBER
Field Value
Type Description
int

NUTRIENTS_FIELD_NUMBER

public static final int NUTRIENTS_FIELD_NUMBER
Field Value
Type Description
int

SERVINGS_FIELD_NUMBER

public static final int SERVINGS_FIELD_NUMBER
Field Value
Type Description
int

TOTAL_CARBOHYDRATE_FIELD_NUMBER

public static final int TOTAL_CARBOHYDRATE_FIELD_NUMBER
Field Value
Type Description
int

TOTAL_FAT_FIELD_NUMBER

public static final int TOTAL_FAT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Food getDefaultInstance()
Returns
Type Description
Food

getDescriptor()

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

newBuilder()

public static Food.Builder newBuilder()
Returns
Type Description
Food.Builder

newBuilder(Food prototype)

public static Food.Builder newBuilder(Food prototype)
Parameter
Name Description
prototype Food
Returns
Type Description
Food.Builder

parseDelimitedFrom(InputStream input)

public static Food parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Food
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Food parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Food parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Food
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Food parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Food parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Food
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Food parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Food parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Food
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Food parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Food parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Food
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Food parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Food parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Food
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Food parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Food
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Food> parser()
Returns
Type Description
Parser<Food>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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.

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.

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.

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.

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.

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.

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

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>

getParserForType()

public Parser<Food> getParserForType()
Returns
Type Description
Parser<Food>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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

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.

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Food.Builder newBuilderForType()
Returns
Type Description
Food.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected Food.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Food.Builder
Overrides

toBuilder()

public Food.Builder toBuilder()
Returns
Type Description
Food.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException