public static final class NutritionLog.Builder extends GeneratedMessage.Builder<NutritionLog.Builder> implements NutritionLogOrBuilderHolds information about food logged by a user.
There are two ways of creating a nutrition log based on the food type:
- Identified food: Using the food field, which is a reference to a Food
resource. In this case fields
nutrients,energy,energy_from_fat,total_carbohydrate,total_fat,food_display_namewill be populated based on the referenced food. Anonymous food: Using the
food_display_namefield and setting thenutrients,energy,energy_from_fat,total_carbohydrate,total_fatfields manually.The identified food is preferred over the anonymous food. Nutrition logs created from anonymous food are not editable.
Protobuf type google.devicesandservices.health.v4.NutritionLog
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > NutritionLog.BuilderImplements
NutritionLogOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
addAllNutrients(Iterable<? extends NutrientQuantity> values)
public NutritionLog.Builder addAllNutrients(Iterable<? extends NutrientQuantity> values)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<? extends com.google.devicesandservices.health.v4.NutrientQuantity> |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
addNutrients(NutrientQuantity value)
public NutritionLog.Builder addNutrients(NutrientQuantity value)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
NutrientQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
addNutrients(NutrientQuantity.Builder builderForValue)
public NutritionLog.Builder addNutrients(NutrientQuantity.Builder builderForValue)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
NutrientQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
addNutrients(int index, NutrientQuantity value)
public NutritionLog.Builder addNutrients(int index, NutrientQuantity value)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
int |
value |
NutrientQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
addNutrients(int index, NutrientQuantity.Builder builderForValue)
public NutritionLog.Builder addNutrients(int index, NutrientQuantity.Builder builderForValue)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
int |
builderForValue |
NutrientQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
addNutrientsBuilder()
public NutrientQuantity.Builder addNutrientsBuilder()Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutrientQuantity.Builder |
|
addNutrientsBuilder(int index)
public NutrientQuantity.Builder addNutrientsBuilder(int index)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
NutrientQuantity.Builder |
|
build()
public NutritionLog build()| Returns | |
|---|---|
| Type | Description |
NutritionLog |
|
buildPartial()
public NutritionLog buildPartial()| Returns | |
|---|---|
| Type | Description |
NutritionLog |
|
clear()
public NutritionLog.Builder clear()| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearEnergy()
public NutritionLog.Builder clearEnergy() Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearEnergyFromFat()
public NutritionLog.Builder clearEnergyFromFat() Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearFood()
public NutritionLog.Builder clearFood() Optional. The resource name of the Food item. Required when creating a
nutrition log from an identified food. For anonymous food logs, use the
food_display_name field instead.
string food = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
clearFoodDisplayName()
public NutritionLog.Builder clearFoodDisplayName()The display name of the food. For identified food logs, this is populated automatically from the referenced food.
string food_display_name = 16;
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
clearInterval()
public NutritionLog.Builder clearInterval()Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearMealType()
public NutritionLog.Builder clearMealType() Optional. The meal category. One of BREAKFAST, LUNCH, DINNER, or
SNACK.
.google.devicesandservices.health.v4.MealType meal_type = 13 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
clearNutrients()
public NutritionLog.Builder clearNutrients()Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearServing()
public NutritionLog.Builder clearServing()Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearTotalCarbohydrate()
public NutritionLog.Builder clearTotalCarbohydrate()Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearTotalFat()
public NutritionLog.Builder clearTotalFat()Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
getDefaultInstanceForType()
public NutritionLog getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
NutritionLog |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getEnergy()
public EnergyQuantity getEnergy() Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity |
The energy. |
getEnergyBuilder()
public EnergyQuantity.Builder getEnergyBuilder() Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity.Builder |
|
getEnergyFromFat()
public EnergyQuantity getEnergyFromFat() Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity |
The energyFromFat. |
getEnergyFromFatBuilder()
public EnergyQuantity.Builder getEnergyFromFatBuilder() Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity.Builder |
|
getEnergyFromFatOrBuilder()
public EnergyQuantityOrBuilder getEnergyFromFatOrBuilder() Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantityOrBuilder |
|
getEnergyOrBuilder()
public EnergyQuantityOrBuilder getEnergyOrBuilder() Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantityOrBuilder |
|
getFood()
public String getFood() Optional. The resource name of the Food item. Required when creating a
nutrition log from an identified food. For anonymous food logs, use the
food_display_name field instead.
string food = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
String |
The food. |
getFoodBytes()
public ByteString getFoodBytes() Optional. The resource name of the Food item. Required when creating a
nutrition log from an identified food. For anonymous food logs, use the
food_display_name field instead.
string food = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for food. |
getFoodDisplayName()
public String getFoodDisplayName()The display name of the food. For identified food logs, this is populated automatically from the referenced food.
string food_display_name = 16;
| Returns | |
|---|---|
| Type | Description |
String |
The foodDisplayName. |
getFoodDisplayNameBytes()
public ByteString getFoodDisplayNameBytes()The display name of the food. For identified food logs, this is populated automatically from the referenced food.
string food_display_name = 16;
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for foodDisplayName. |
getInterval()
public SessionTimeInterval getInterval()Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
SessionTimeInterval |
The interval. |
getIntervalBuilder()
public SessionTimeInterval.Builder getIntervalBuilder()Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
SessionTimeInterval.Builder |
|
getIntervalOrBuilder()
public SessionTimeIntervalOrBuilder getIntervalOrBuilder()Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
SessionTimeIntervalOrBuilder |
|
getMealType()
public MealType getMealType() Optional. The meal category. One of BREAKFAST, LUNCH, DINNER, or
SNACK.
.google.devicesandservices.health.v4.MealType meal_type = 13 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
MealType |
The mealType. |
getMealTypeValue()
public int getMealTypeValue() Optional. The meal category. One of BREAKFAST, LUNCH, DINNER, or
SNACK.
.google.devicesandservices.health.v4.MealType meal_type = 13 [(.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. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
NutrientQuantity |
|
getNutrientsBuilder(int index)
public NutrientQuantity.Builder getNutrientsBuilder(int index)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
NutrientQuantity.Builder |
|
getNutrientsBuilderList()
public List<NutrientQuantity.Builder> getNutrientsBuilderList()Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
List<Builder> |
|
getNutrientsCount()
public int getNutrientsCount()Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
|
getNutrientsList()
public List<NutrientQuantity> getNutrientsList()Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
List<NutrientQuantity> |
|
getNutrientsOrBuilder(int index)
public NutrientQuantityOrBuilder getNutrientsOrBuilder(int index)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
NutrientQuantityOrBuilder |
|
getNutrientsOrBuilderList()
public List<? extends NutrientQuantityOrBuilder> getNutrientsOrBuilderList()Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
List<? extends com.google.devicesandservices.health.v4.NutrientQuantityOrBuilder> |
|
getServing()
public NutritionLog.Serving getServing()Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving |
The serving. |
getServingBuilder()
public NutritionLog.Serving.Builder getServingBuilder()Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
|
getServingOrBuilder()
public NutritionLog.ServingOrBuilder getServingOrBuilder()Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.ServingOrBuilder |
|
getTotalCarbohydrate()
public WeightQuantity getTotalCarbohydrate()Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity |
The totalCarbohydrate. |
getTotalCarbohydrateBuilder()
public WeightQuantity.Builder getTotalCarbohydrateBuilder()Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
getTotalCarbohydrateOrBuilder()
public WeightQuantityOrBuilder getTotalCarbohydrateOrBuilder()Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantityOrBuilder |
|
getTotalFat()
public WeightQuantity getTotalFat()Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity |
The totalFat. |
getTotalFatBuilder()
public WeightQuantity.Builder getTotalFatBuilder()Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
getTotalFatOrBuilder()
public WeightQuantityOrBuilder getTotalFatOrBuilder()Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantityOrBuilder |
|
hasEnergy()
public boolean hasEnergy() Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the energy field is set. |
hasEnergyFromFat()
public boolean hasEnergyFromFat() Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the energyFromFat field is set. |
hasInterval()
public boolean hasInterval()Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the interval field is set. |
hasServing()
public boolean hasServing()Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the serving field is set. |
hasTotalCarbohydrate()
public boolean hasTotalCarbohydrate()Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the totalCarbohydrate field is set. |
hasTotalFat()
public boolean hasTotalFat()Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the totalFat field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeEnergy(EnergyQuantity value)
public NutritionLog.Builder mergeEnergy(EnergyQuantity value) Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
EnergyQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeEnergyFromFat(EnergyQuantity value)
public NutritionLog.Builder mergeEnergyFromFat(EnergyQuantity value) Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
EnergyQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeFrom(NutritionLog other)
public NutritionLog.Builder mergeFrom(NutritionLog other)| Parameter | |
|---|---|
| Name | Description |
other |
NutritionLog |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public NutritionLog.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public NutritionLog.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeInterval(SessionTimeInterval value)
public NutritionLog.Builder mergeInterval(SessionTimeInterval value)Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
value |
SessionTimeInterval |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeServing(NutritionLog.Serving value)
public NutritionLog.Builder mergeServing(NutritionLog.Serving value)Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
NutritionLog.Serving |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeTotalCarbohydrate(WeightQuantity value)
public NutritionLog.Builder mergeTotalCarbohydrate(WeightQuantity value)Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
WeightQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
mergeTotalFat(WeightQuantity value)
public NutritionLog.Builder mergeTotalFat(WeightQuantity value)Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
WeightQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
removeNutrients(int index)
public NutritionLog.Builder removeNutrients(int index)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setEnergy(EnergyQuantity value)
public NutritionLog.Builder setEnergy(EnergyQuantity value) Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
EnergyQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setEnergy(EnergyQuantity.Builder builderForValue)
public NutritionLog.Builder setEnergy(EnergyQuantity.Builder builderForValue) Optional. The total energy of the food, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
EnergyQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setEnergyFromFat(EnergyQuantity value)
public NutritionLog.Builder setEnergyFromFat(EnergyQuantity value) Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
EnergyQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setEnergyFromFat(EnergyQuantity.Builder builderForValue)
public NutritionLog.Builder setEnergyFromFat(EnergyQuantity.Builder builderForValue) Optional. The energy from fat, measured in kilocalories (kcal).
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
EnergyQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setFood(String value)
public NutritionLog.Builder setFood(String value) Optional. The resource name of the Food item. Required when creating a
nutrition log from an identified food. For anonymous food logs, use the
food_display_name field instead.
string food = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe food to set. |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
setFoodBytes(ByteString value)
public NutritionLog.Builder setFoodBytes(ByteString value) Optional. The resource name of the Food item. Required when creating a
nutrition log from an identified food. For anonymous food logs, use the
food_display_name field instead.
string food = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for food to set. |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
setFoodDisplayName(String value)
public NutritionLog.Builder setFoodDisplayName(String value)The display name of the food. For identified food logs, this is populated automatically from the referenced food.
string food_display_name = 16;
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe foodDisplayName to set. |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
setFoodDisplayNameBytes(ByteString value)
public NutritionLog.Builder setFoodDisplayNameBytes(ByteString value)The display name of the food. For identified food logs, this is populated automatically from the referenced food.
string food_display_name = 16;
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for foodDisplayName to set. |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
setInterval(SessionTimeInterval value)
public NutritionLog.Builder setInterval(SessionTimeInterval value)Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
value |
SessionTimeInterval |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setInterval(SessionTimeInterval.Builder builderForValue)
public NutritionLog.Builder setInterval(SessionTimeInterval.Builder builderForValue)Required. The time window when the food was logged.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
SessionTimeInterval.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setMealType(MealType value)
public NutritionLog.Builder setMealType(MealType value) Optional. The meal category. One of BREAKFAST, LUNCH, DINNER, or
SNACK.
.google.devicesandservices.health.v4.MealType meal_type = 13 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
MealTypeThe mealType to set. |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
setMealTypeValue(int value)
public NutritionLog.Builder setMealTypeValue(int value) Optional. The meal category. One of BREAKFAST, LUNCH, DINNER, or
SNACK.
.google.devicesandservices.health.v4.MealType meal_type = 13 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe enum numeric value on the wire for mealType to set. |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
setNutrients(int index, NutrientQuantity value)
public NutritionLog.Builder setNutrients(int index, NutrientQuantity value)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
int |
value |
NutrientQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setNutrients(int index, NutrientQuantity.Builder builderForValue)
public NutritionLog.Builder setNutrients(int index, NutrientQuantity.Builder builderForValue)Optional. An array of individual nutrient values for the nutrition log.
repeated .google.devicesandservices.health.v4.NutrientQuantity nutrients = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
int |
builderForValue |
NutrientQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setServing(NutritionLog.Serving value)
public NutritionLog.Builder setServing(NutritionLog.Serving value)Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
NutritionLog.Serving |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setServing(NutritionLog.Serving.Builder builderForValue)
public NutritionLog.Builder setServing(NutritionLog.Serving.Builder builderForValue)Optional. The serving information for the logged food.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
NutritionLog.Serving.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setTotalCarbohydrate(WeightQuantity value)
public NutritionLog.Builder setTotalCarbohydrate(WeightQuantity value)Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
WeightQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setTotalCarbohydrate(WeightQuantity.Builder builderForValue)
public NutritionLog.Builder setTotalCarbohydrate(WeightQuantity.Builder builderForValue)Optional. The total carbohydrate content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
WeightQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setTotalFat(WeightQuantity value)
public NutritionLog.Builder setTotalFat(WeightQuantity value)Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
WeightQuantity |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
setTotalFat(WeightQuantity.Builder builderForValue)
public NutritionLog.Builder setTotalFat(WeightQuantity.Builder builderForValue)Optional. The total fat content, measured in grams.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
WeightQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|