public static final class NutritionLog.Serving.Builder extends GeneratedMessage.Builder<NutritionLog.Serving.Builder> implements NutritionLog.ServingOrBuilderRepresents different properties and information about the serving of a specific food.
Protobuf type google.devicesandservices.health.v4.NutritionLog.Serving
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > NutritionLog.Serving.BuilderImplements
NutritionLog.ServingOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
build()
public NutritionLog.Serving build()| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving |
|
buildPartial()
public NutritionLog.Serving buildPartial()| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving |
|
clear()
public NutritionLog.Serving.Builder clear()| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
|
clearAmount()
public NutritionLog.Serving.Builder clearAmount()Optional. Amount of food consumed, fractional values are supported.
optional double amount = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
This builder for chaining. |
clearFoodMeasurementUnit()
public NutritionLog.Serving.Builder clearFoodMeasurementUnit()Required. Food measurement unit
string food_measurement_unit = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
This builder for chaining. |
clearFoodMeasurementUnitDisplayName()
public NutritionLog.Serving.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 |
NutritionLog.Serving.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 NutritionLog.Serving getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving |
|
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. |
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(NutritionLog.Serving other)
public NutritionLog.Serving.Builder mergeFrom(NutritionLog.Serving other)| Parameter | |
|---|---|
| Name | Description |
other |
NutritionLog.Serving |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public NutritionLog.Serving.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public NutritionLog.Serving.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
NutritionLog.Serving.Builder |
|
setAmount(double value)
public NutritionLog.Serving.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 |
NutritionLog.Serving.Builder |
This builder for chaining. |
setFoodMeasurementUnit(String value)
public NutritionLog.Serving.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 |
NutritionLog.Serving.Builder |
This builder for chaining. |
setFoodMeasurementUnitBytes(ByteString value)
public NutritionLog.Serving.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 |
NutritionLog.Serving.Builder |
This builder for chaining. |
setFoodMeasurementUnitDisplayName(String value)
public NutritionLog.Serving.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 |
NutritionLog.Serving.Builder |
This builder for chaining. |
setFoodMeasurementUnitDisplayNameBytes(ByteString value)
public NutritionLog.Serving.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 |
NutritionLog.Serving.Builder |
This builder for chaining. |