public static final class Weight.Builder extends GeneratedMessageV3.Builder<Weight.Builder> implements WeightOrBuilder
The weight represented as the value in string and the unit.
Protobuf type google.shopping.type.Weight
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
public static final Descriptors.Descriptor getDescriptor()
Methods
public Weight.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
Returns |
Type |
Description |
Weight |
|
public Weight buildPartial()
Returns |
Type |
Description |
Weight |
|
public Weight.Builder clear()
Overrides
public Weight.Builder clearAmountMicros()
Required. The weight represented as a number in micros (1 million micros is
an equivalent to one's currency standard unit, for example, 1 kg = 1000000
micros).
This field can also be set as infinity by setting to -1.
This field only support -1 and positive value.
optional int64 amount_micros = 1;
public Weight.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
public Weight.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
public Weight.Builder clearUnit()
Required. The weight unit.
Acceptable values are: kg and lb
.google.shopping.type.Weight.WeightUnit unit = 2;
public Weight.Builder clone()
Overrides
public long getAmountMicros()
Required. The weight represented as a number in micros (1 million micros is
an equivalent to one's currency standard unit, for example, 1 kg = 1000000
micros).
This field can also be set as infinity by setting to -1.
This field only support -1 and positive value.
optional int64 amount_micros = 1;
Returns |
Type |
Description |
long |
The amountMicros.
|
public Weight getDefaultInstanceForType()
Returns |
Type |
Description |
Weight |
|
public Descriptors.Descriptor getDescriptorForType()
Overrides
public Weight.WeightUnit getUnit()
Required. The weight unit.
Acceptable values are: kg and lb
.google.shopping.type.Weight.WeightUnit unit = 2;
public int getUnitValue()
Required. The weight unit.
Acceptable values are: kg and lb
.google.shopping.type.Weight.WeightUnit unit = 2;
Returns |
Type |
Description |
int |
The enum numeric value on the wire for unit.
|
public boolean hasAmountMicros()
Required. The weight represented as a number in micros (1 million micros is
an equivalent to one's currency standard unit, for example, 1 kg = 1000000
micros).
This field can also be set as infinity by setting to -1.
This field only support -1 and positive value.
optional int64 amount_micros = 1;
Returns |
Type |
Description |
boolean |
Whether the amountMicros field is set.
|
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
public final boolean isInitialized()
Overrides
public Weight.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
public Weight.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
public Weight.Builder mergeFrom(Weight other)
Parameter |
Name |
Description |
other |
Weight
|
public final Weight.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
public Weight.Builder setAmountMicros(long value)
Required. The weight represented as a number in micros (1 million micros is
an equivalent to one's currency standard unit, for example, 1 kg = 1000000
micros).
This field can also be set as infinity by setting to -1.
This field only support -1 and positive value.
optional int64 amount_micros = 1;
Parameter |
Name |
Description |
value |
long
The amountMicros to set.
|
public Weight.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
public Weight.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
public Weight.Builder setUnit(Weight.WeightUnit value)
Required. The weight unit.
Acceptable values are: kg and lb
.google.shopping.type.Weight.WeightUnit unit = 2;
public Weight.Builder setUnitValue(int value)
Required. The weight unit.
Acceptable values are: kg and lb
.google.shopping.type.Weight.WeightUnit unit = 2;
Parameter |
Name |
Description |
value |
int
The enum numeric value on the wire for unit to set.
|
public final Weight.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides