public static final class Food.FoodServing.Builder extends GeneratedMessage.Builder<Food.FoodServing.Builder> implements Food.FoodServingOrBuilderRepresents different properties and information about the serving of a specific food.
Protobuf type google.devicesandservices.health.v4.Food.FoodServing
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > Food.FoodServing.BuilderImplements
Food.FoodServingOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
build()
public Food.FoodServing build()| Returns | |
|---|---|
| Type | Description |
Food.FoodServing |
|
buildPartial()
public Food.FoodServing buildPartial()| Returns | |
|---|---|
| Type | Description |
Food.FoodServing |
|
clear()
public Food.FoodServing.Builder clear()| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
|
clearAmount()
public Food.FoodServing.Builder clearAmount()Optional. Amount of food consumed, fractional values are supported.
optional double amount = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
clearFoodMeasurementUnit()
public Food.FoodServing.Builder clearFoodMeasurementUnit()Required. Food measurement unit
string food_measurement_unit = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
clearFoodMeasurementUnitDisplayName()
public Food.FoodServing.Builder clearFoodMeasurementUnitDisplayName()Output only. Legacy measurement unit for serving size in singular form (e.g. "piece", "gram").
string food_measurement_unit_display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
clearFoodMeasurementUnitDisplayNamePlural()
public Food.FoodServing.Builder clearFoodMeasurementUnitDisplayNamePlural()Output only. Legacy measurement unit for serving size in plural form (e.g. "pieces", "grams").
string food_measurement_unit_display_name_plural = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
clearMultiplier()
public Food.FoodServing.Builder clearMultiplier()Optional. Value representing the multiplier used to compute the energy when using this serving instead of the default serving.
double multiplier = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
getAmount()
public double getAmount()Optional. Amount of food consumed, fractional values are supported.
optional double amount = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
double |
The amount. |
getDefaultInstanceForType()
public Food.FoodServing getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
Food.FoodServing |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getFoodMeasurementUnit()
public String getFoodMeasurementUnit()Required. Food measurement unit
string food_measurement_unit = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
String |
The foodMeasurementUnit. |
getFoodMeasurementUnitBytes()
public ByteString getFoodMeasurementUnitBytes()Required. Food measurement unit
string food_measurement_unit = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for foodMeasurementUnit. |
getFoodMeasurementUnitDisplayName()
public String getFoodMeasurementUnitDisplayName()Output only. Legacy measurement unit for serving size in singular form (e.g. "piece", "gram").
string food_measurement_unit_display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
String |
The foodMeasurementUnitDisplayName. |
getFoodMeasurementUnitDisplayNameBytes()
public ByteString getFoodMeasurementUnitDisplayNameBytes()Output only. Legacy measurement unit for serving size in singular form (e.g. "piece", "gram").
string food_measurement_unit_display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for foodMeasurementUnitDisplayName. |
getFoodMeasurementUnitDisplayNamePlural()
public String getFoodMeasurementUnitDisplayNamePlural()Output only. Legacy measurement unit for serving size in plural form (e.g. "pieces", "grams").
string food_measurement_unit_display_name_plural = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
String |
The foodMeasurementUnitDisplayNamePlural. |
getFoodMeasurementUnitDisplayNamePluralBytes()
public ByteString getFoodMeasurementUnitDisplayNamePluralBytes()Output only. Legacy measurement unit for serving size in plural form (e.g. "pieces", "grams").
string food_measurement_unit_display_name_plural = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for foodMeasurementUnitDisplayNamePlural. |
getMultiplier()
public double getMultiplier()Optional. Value representing the multiplier used to compute the energy when using this serving instead of the default serving.
double multiplier = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
double |
The multiplier. |
hasAmount()
public boolean hasAmount()Optional. Amount of food consumed, fractional values are supported.
optional double amount = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the amount field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(Food.FoodServing other)
public Food.FoodServing.Builder mergeFrom(Food.FoodServing other)| Parameter | |
|---|---|
| Name | Description |
other |
Food.FoodServing |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Food.FoodServing.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public Food.FoodServing.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
|
setAmount(double value)
public Food.FoodServing.Builder setAmount(double value)Optional. Amount of food consumed, fractional values are supported.
optional double amount = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
doubleThe amount to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setFoodMeasurementUnit(String value)
public Food.FoodServing.Builder setFoodMeasurementUnit(String value)Required. Food measurement unit
string food_measurement_unit = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe foodMeasurementUnit to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setFoodMeasurementUnitBytes(ByteString value)
public Food.FoodServing.Builder setFoodMeasurementUnitBytes(ByteString value)Required. Food measurement unit
string food_measurement_unit = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for foodMeasurementUnit to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setFoodMeasurementUnitDisplayName(String value)
public Food.FoodServing.Builder setFoodMeasurementUnitDisplayName(String value)Output only. Legacy measurement unit for serving size in singular form (e.g. "piece", "gram").
string food_measurement_unit_display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe foodMeasurementUnitDisplayName to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setFoodMeasurementUnitDisplayNameBytes(ByteString value)
public Food.FoodServing.Builder setFoodMeasurementUnitDisplayNameBytes(ByteString value)Output only. Legacy measurement unit for serving size in singular form (e.g. "piece", "gram").
string food_measurement_unit_display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for foodMeasurementUnitDisplayName to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setFoodMeasurementUnitDisplayNamePlural(String value)
public Food.FoodServing.Builder setFoodMeasurementUnitDisplayNamePlural(String value)Output only. Legacy measurement unit for serving size in plural form (e.g. "pieces", "grams").
string food_measurement_unit_display_name_plural = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe foodMeasurementUnitDisplayNamePlural to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setFoodMeasurementUnitDisplayNamePluralBytes(ByteString value)
public Food.FoodServing.Builder setFoodMeasurementUnitDisplayNamePluralBytes(ByteString value)Output only. Legacy measurement unit for serving size in plural form (e.g. "pieces", "grams").
string food_measurement_unit_display_name_plural = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for foodMeasurementUnitDisplayNamePlural to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |
setMultiplier(double value)
public Food.FoodServing.Builder setMultiplier(double value)Optional. Value representing the multiplier used to compute the energy when using this serving instead of the default serving.
double multiplier = 5 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
doubleThe multiplier to set. |
| Returns | |
|---|---|
| Type | Description |
Food.FoodServing.Builder |
This builder for chaining. |