public final class Food extends GeneratedMessage implements FoodOrBuilder
Represents a food item.
Protobuf type google.devicesandservices.health.v4.Food
Inherited Members
com.google.protobuf.GeneratedMessage.<ContainingT,T>newFileScopedGeneratedExtension(java.lang.Class<?>,com.google.protobuf.Message)
com.google.protobuf.GeneratedMessage.<ContainingT,T>newMessageScopedGeneratedExtension(com.google.protobuf.Message,int,java.lang.Class<?>,com.google.protobuf.Message)
com.google.protobuf.GeneratedMessage.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessage.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessage.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessage.<V>serializeBooleanMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField<java.lang.Boolean,V>,com.google.protobuf.MapEntry<java.lang.Boolean,V>,int)
com.google.protobuf.GeneratedMessage.<V>serializeIntegerMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField<java.lang.Integer,V>,com.google.protobuf.MapEntry<java.lang.Integer,V>,int)
com.google.protobuf.GeneratedMessage.<V>serializeLongMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField<java.lang.Long,V>,com.google.protobuf.MapEntry<java.lang.Long,V>,int)
com.google.protobuf.GeneratedMessage.<V>serializeStringMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField<java.lang.String,V>,com.google.protobuf.MapEntry<java.lang.String,V>,int)
com.google.protobuf.GeneratedMessage.canUseUnsafe()
com.google.protobuf.GeneratedMessage.emptyBooleanList()
com.google.protobuf.GeneratedMessage.emptyDoubleList()
com.google.protobuf.GeneratedMessage.emptyFloatList()
com.google.protobuf.GeneratedMessage.emptyIntList()
com.google.protobuf.GeneratedMessage.emptyLongList()
com.google.protobuf.GeneratedMessage.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessage.isStringEmpty(java.lang.Object)
com.google.protobuf.GeneratedMessage.mergeFromAndMakeImmutableInternal(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite)
com.google.protobuf.GeneratedMessage.newInstance(com.google.protobuf.GeneratedMessage.UnusedPrivateParameter)
com.google.protobuf.GeneratedMessage.parseUnknownFieldProto3(com.google.protobuf.CodedInputStream,com.google.protobuf.UnknownFieldSet.Builder,com.google.protobuf.ExtensionRegistryLite,int)
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()
newBuilder()
public static Food.Builder newBuilder()
newBuilder(Food prototype)
public static Food.Builder newBuilder(Food prototype)
| Parameter |
| Name |
Description |
prototype |
Food
|
public static Food parseDelimitedFrom(InputStream input)
| Returns |
| Type |
Description |
Food |
|
public static Food parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Food |
|
parseFrom(byte[] data)
public static Food parseFrom(byte[] data)
| Parameter |
| Name |
Description |
data |
byte[]
|
| Returns |
| Type |
Description |
Food |
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Food parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Food |
|
parseFrom(ByteString data)
public static Food parseFrom(ByteString data)
| Returns |
| Type |
Description |
Food |
|
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Food parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Food |
|
public static Food parseFrom(CodedInputStream input)
| Returns |
| Type |
Description |
Food |
|
public static Food parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Food |
|
public static Food parseFrom(InputStream input)
| Returns |
| Type |
Description |
Food |
|
public static Food parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Food |
|
parseFrom(ByteBuffer data)
public static Food parseFrom(ByteBuffer data)
| Returns |
| Type |
Description |
Food |
|
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Food parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
Food |
|
parser()
public static Parser<Food> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
| Parameter |
| Name |
Description |
obj |
Object
|
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];
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()
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];
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];
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];
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];
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];
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];
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];
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];
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];
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];
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
|
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];
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
|
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()
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
|
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];
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
|
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];
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];
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];
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];
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()
| Returns |
| Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Food.Builder newBuilderForType()
newBuilderForType(AbstractMessage.BuilderParent parent)
protected Food.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Overrides
toBuilder()
public Food.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides