Class VolumeQuantity.Builder (0.2.0)

public static final class VolumeQuantity.Builder extends GeneratedMessage.Builder<VolumeQuantity.Builder> implements VolumeQuantityOrBuilder

Represents the volume quantity.

Protobuf type google.devicesandservices.health.v4.VolumeQuantity

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public VolumeQuantity build()
Returns
Type Description
VolumeQuantity

buildPartial()

public VolumeQuantity buildPartial()
Returns
Type Description
VolumeQuantity

clear()

public VolumeQuantity.Builder clear()
Returns
Type Description
VolumeQuantity.Builder
Overrides

clearMilliliters()

public VolumeQuantity.Builder clearMilliliters()

Required. Value representing the volume in milliliters.

optional double milliliters = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
VolumeQuantity.Builder

This builder for chaining.

clearUserProvidedUnit()

public VolumeQuantity.Builder clearUserProvidedUnit()

Optional. Value representing the user provided unit, used only for user-facing input and display purposes. In the API format, all volume quantities are converted to milliliters.

.google.devicesandservices.health.v4.VolumeUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
VolumeQuantity.Builder

This builder for chaining.

getDefaultInstanceForType()

public VolumeQuantity getDefaultInstanceForType()
Returns
Type Description
VolumeQuantity

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMilliliters()

public double getMilliliters()

Required. Value representing the volume in milliliters.

optional double milliliters = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
double

The milliliters.

getUserProvidedUnit()

public VolumeUnit getUserProvidedUnit()

Optional. Value representing the user provided unit, used only for user-facing input and display purposes. In the API format, all volume quantities are converted to milliliters.

.google.devicesandservices.health.v4.VolumeUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
VolumeUnit

The userProvidedUnit.

getUserProvidedUnitValue()

public int getUserProvidedUnitValue()

Optional. Value representing the user provided unit, used only for user-facing input and display purposes. In the API format, all volume quantities are converted to milliliters.

.google.devicesandservices.health.v4.VolumeUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for userProvidedUnit.

hasMilliliters()

public boolean hasMilliliters()

Required. Value representing the volume in milliliters.

optional double milliliters = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the milliliters field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(VolumeQuantity other)

public VolumeQuantity.Builder mergeFrom(VolumeQuantity other)
Parameter
Name Description
other VolumeQuantity
Returns
Type Description
VolumeQuantity.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public VolumeQuantity.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
VolumeQuantity.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

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

setMilliliters(double value)

public VolumeQuantity.Builder setMilliliters(double value)

Required. Value representing the volume in milliliters.

optional double milliliters = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value double

The milliliters to set.

Returns
Type Description
VolumeQuantity.Builder

This builder for chaining.

setUserProvidedUnit(VolumeUnit value)

public VolumeQuantity.Builder setUserProvidedUnit(VolumeUnit value)

Optional. Value representing the user provided unit, used only for user-facing input and display purposes. In the API format, all volume quantities are converted to milliliters.

.google.devicesandservices.health.v4.VolumeUnit user_provided_unit = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value VolumeUnit

The userProvidedUnit to set.

Returns
Type Description
VolumeQuantity.Builder

This builder for chaining.

setUserProvidedUnitValue(int value)

public VolumeQuantity.Builder setUserProvidedUnitValue(int value)

Optional. Value representing the user provided unit, used only for user-facing input and display purposes. In the API format, all volume quantities are converted to milliliters.

.google.devicesandservices.health.v4.VolumeUnit 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
VolumeQuantity.Builder

This builder for chaining.