Send feedback
Class Weight.Builder (2.43.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.43.0 keyboard_arrow_down
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
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-24 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-24 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-24 UTC."]]