Class EnergyQuantity.Builder (0.2.0)

public static final class EnergyQuantity.Builder extends GeneratedMessage.Builder<EnergyQuantity.Builder> implements EnergyQuantityOrBuilder

Represents the energy quantity.

Protobuf type google.devicesandservices.health.v4.EnergyQuantity

Static Methods

getDescriptor()

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

Methods

build()

public EnergyQuantity build()
Returns
Type Description
EnergyQuantity

buildPartial()

public EnergyQuantity buildPartial()
Returns
Type Description
EnergyQuantity

clear()

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

clearKcal()

public EnergyQuantity.Builder clearKcal()

Required. Value representing the energy in kilocalories.

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

Returns
Type Description
EnergyQuantity.Builder

This builder for chaining.

clearUserProvidedUnit()

public EnergyQuantity.Builder clearUserProvidedUnit()

Optional. Value representing the user provided unit.

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

Returns
Type Description
EnergyQuantity.Builder

This builder for chaining.

getDefaultInstanceForType()

public EnergyQuantity getDefaultInstanceForType()
Returns
Type Description
EnergyQuantity

getDescriptorForType()

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

getKcal()

public double getKcal()

Required. Value representing the energy in kilocalories.

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

Returns
Type Description
double

The kcal.

getUserProvidedUnit()

public EnergyUnit getUserProvidedUnit()

Optional. Value representing the user provided unit.

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

Returns
Type Description
EnergyUnit

The userProvidedUnit.

getUserProvidedUnitValue()

public int getUserProvidedUnitValue()

Optional. Value representing the user provided unit.

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

Returns
Type Description
int

The enum numeric value on the wire for userProvidedUnit.

hasKcal()

public boolean hasKcal()

Required. Value representing the energy in kilocalories.

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

Returns
Type Description
boolean

Whether the kcal field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(EnergyQuantity other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setKcal(double value)

public EnergyQuantity.Builder setKcal(double value)

Required. Value representing the energy in kilocalories.

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

Parameter
Name Description
value double

The kcal to set.

Returns
Type Description
EnergyQuantity.Builder

This builder for chaining.

setUserProvidedUnit(EnergyUnit value)

public EnergyQuantity.Builder setUserProvidedUnit(EnergyUnit value)

Optional. Value representing the user provided unit.

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

Parameter
Name Description
value EnergyUnit

The userProvidedUnit to set.

Returns
Type Description
EnergyQuantity.Builder

This builder for chaining.

setUserProvidedUnitValue(int value)

public EnergyQuantity.Builder setUserProvidedUnitValue(int value)

Optional. Value representing the user provided unit.

.google.devicesandservices.health.v4.EnergyUnit 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
EnergyQuantity.Builder

This builder for chaining.