public static final class WeightQuantity.Builder extends GeneratedMessage.Builder<WeightQuantity.Builder> implements WeightQuantityOrBuilderRepresents the weight quantity.
Protobuf type google.devicesandservices.health.v4.WeightQuantity
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > WeightQuantity.BuilderImplements
WeightQuantityOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
build()
public WeightQuantity build()| Returns | |
|---|---|
| Type | Description |
WeightQuantity |
|
buildPartial()
public WeightQuantity buildPartial()| Returns | |
|---|---|
| Type | Description |
WeightQuantity |
|
clear()
public WeightQuantity.Builder clear()| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
clearGrams()
public WeightQuantity.Builder clearGrams()Required. Value representing the weight in grams.
optional double grams = 1 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
This builder for chaining. |
clearUserProvidedUnit()
public WeightQuantity.Builder clearUserProvidedUnit()Optional. Value representing the user provided unit.
.google.devicesandservices.health.v4.WeightUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
This builder for chaining. |
getDefaultInstanceForType()
public WeightQuantity getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
WeightQuantity |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getGrams()
public double getGrams()Required. Value representing the weight in grams.
optional double grams = 1 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
double |
The grams. |
getUserProvidedUnit()
public WeightUnit getUserProvidedUnit()Optional. Value representing the user provided unit.
.google.devicesandservices.health.v4.WeightUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
WeightUnit |
The userProvidedUnit. |
getUserProvidedUnitValue()
public int getUserProvidedUnitValue()Optional. Value representing the user provided unit.
.google.devicesandservices.health.v4.WeightUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The enum numeric value on the wire for userProvidedUnit. |
hasGrams()
public boolean hasGrams()Required. Value representing the weight in grams.
optional double grams = 1 [(.google.api.field_behavior) = REQUIRED];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the grams field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(WeightQuantity other)
public WeightQuantity.Builder mergeFrom(WeightQuantity other)| Parameter | |
|---|---|
| Name | Description |
other |
WeightQuantity |
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public WeightQuantity.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public WeightQuantity.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
|
setGrams(double value)
public WeightQuantity.Builder setGrams(double value)Required. Value representing the weight in grams.
optional double grams = 1 [(.google.api.field_behavior) = REQUIRED];
| Parameter | |
|---|---|
| Name | Description |
value |
doubleThe grams to set. |
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
This builder for chaining. |
setUserProvidedUnit(WeightUnit value)
public WeightQuantity.Builder setUserProvidedUnit(WeightUnit value)Optional. Value representing the user provided unit.
.google.devicesandservices.health.v4.WeightUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
WeightUnitThe userProvidedUnit to set. |
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
This builder for chaining. |
setUserProvidedUnitValue(int value)
public WeightQuantity.Builder setUserProvidedUnitValue(int value)Optional. Value representing the user provided unit.
.google.devicesandservices.health.v4.WeightUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe enum numeric value on the wire for userProvidedUnit to set. |
| Returns | |
|---|---|
| Type | Description |
WeightQuantity.Builder |
This builder for chaining. |