Class WeightQuantity.Builder (0.2.0)

public static final class WeightQuantity.Builder extends GeneratedMessage.Builder<WeightQuantity.Builder> implements WeightQuantityOrBuilder

Represents the weight quantity.

Protobuf type google.devicesandservices.health.v4.WeightQuantity

Static 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
Overrides

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
Overrides

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
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

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
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public WeightQuantity.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
WeightQuantity.Builder
Overrides

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 double

The 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 WeightUnit

The 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 int

The enum numeric value on the wire for userProvidedUnit to set.

Returns
Type Description
WeightQuantity.Builder

This builder for chaining.