public static final class NutritionLog.Builder extends GeneratedMessage.Builder<NutritionLog.Builder> implements NutritionLogOrBuilderHolds information about a user logged food.
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 be 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearEnergyFromFat()
public NutritionLog.Builder clearEnergyFromFat()Optional. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearFood()
public NutritionLog.Builder clearFood()Required. Represents the food ID.
string food = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
clearFoodDisplayName()
public NutritionLog.Builder clearFoodDisplayName()Value representing the display name of the food. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
string food_display_name = 16;
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
This builder for chaining. |
clearInterval()
public NutritionLog.Builder clearInterval()Required. Observed interval.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearMealType()
public NutritionLog.Builder clearMealType()Optional. Value representing the meal type of the nutrition log.
.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. Value representing the nutrients of 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. Value representing the nutrition log serving.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearTotalCarbohydrate()
public NutritionLog.Builder clearTotalCarbohydrate()Optional. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|
clearTotalFat()
public NutritionLog.Builder clearTotalFat()Optional. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity |
The energy. |
getEnergyBuilder()
public EnergyQuantity.Builder getEnergyBuilder()Optional. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity.Builder |
|
getEnergyFromFat()
public EnergyQuantity getEnergyFromFat()Optional. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantity.Builder |
|
getEnergyFromFatOrBuilder()
public EnergyQuantityOrBuilder getEnergyFromFatOrBuilder()Optional. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy_from_fat = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantityOrBuilder |
|
getEnergyOrBuilder()
public EnergyQuantityOrBuilder getEnergyOrBuilder()Optional. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.EnergyQuantity energy = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
EnergyQuantityOrBuilder |
|
getFood()
public String getFood()Required. Represents the food ID.
string food = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
String |
The food. |
getFoodBytes()
public ByteString getFoodBytes()Required. Represents the food ID.
string food = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for food. |
getFoodDisplayName()
public String getFoodDisplayName()Value representing the display name of the food. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
string food_display_name = 16;
| Returns | |
|---|---|
| Type | Description |
String |
The foodDisplayName. |
getFoodDisplayNameBytes()
public ByteString getFoodDisplayNameBytes()Value representing the display name of the food. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
string food_display_name = 16;
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for foodDisplayName. |
getInterval()
public SessionTimeInterval getInterval()Required. Observed interval.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
SessionTimeInterval |
The interval. |
getIntervalBuilder()
public SessionTimeInterval.Builder getIntervalBuilder()Required. Observed interval.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
SessionTimeInterval.Builder |
|
getIntervalOrBuilder()
public SessionTimeIntervalOrBuilder getIntervalOrBuilder()Required. Observed interval.
.google.devicesandservices.health.v4.SessionTimeInterval interval = 2 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
SessionTimeIntervalOrBuilder |
|
getMealType()
public MealType getMealType()Optional. Value representing the meal type of the nutrition log.
.google.devicesandservices.health.v4.MealType meal_type = 13 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
MealType |
The mealType. |
getMealTypeValue()
public int getMealTypeValue()Optional. Value representing the meal type of the nutrition log.
.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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrition log serving.
.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. Value representing the nutrition log serving.
.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. Value representing the nutrition log serving.
.google.devicesandservices.health.v4.NutritionLog.Serving serving = 14 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.ServingOrBuilder |
|
getTotalCarbohydrate()
public WeightQuantity getTotalCarbohydrate()Optional. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
getTotalCarbohydrateOrBuilder()
public WeightQuantityOrBuilder getTotalCarbohydrateOrBuilder()Optional. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.WeightQuantity total_carbohydrate = 7 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantityOrBuilder |
|
getTotalFat()
public WeightQuantity getTotalFat()Optional. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
getTotalFatOrBuilder()
public WeightQuantityOrBuilder getTotalFatOrBuilder()Optional. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantityOrBuilder |
|
hasEnergy()
public boolean hasEnergy()Optional. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Observed interval.
.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. Value representing the nutrition log serving.
.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. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Observed interval.
.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. Value representing the nutrition log serving.
.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. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the nutrients of 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. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the energy from fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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)Required. Represents the food ID.
string food = 15 [(.google.api.field_behavior) = REQUIRED, (.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)Required. Represents the food ID.
string food = 15 [(.google.api.field_behavior) = REQUIRED, (.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)Value representing the display name of the food. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
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)Value representing the display name of the food. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
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. Observed interval.
.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. Observed interval.
.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. Value representing the meal type of the nutrition log.
.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. Value representing the meal type of the nutrition log.
.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. Value representing the nutrients of 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. Value representing the nutrients of 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. Value representing the nutrition log serving.
.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. Value representing the nutrition log serving.
.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. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total carbohydrate of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.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. Value representing the total fat of the nutrition log. For nutrition logs created from an identified food, this field will be populated based on the referenced food. For anonymous food, this field will be populated manually.
.google.devicesandservices.health.v4.WeightQuantity total_fat = 8 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
WeightQuantity.Builder |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Builder |
|