public static final class ProductWeight.Builder extends GeneratedMessageV3.Builder<ProductWeight.Builder> implements ProductWeightOrBuilder
The weight of the product.
Protobuf type google.shopping.css.v1.ProductWeight
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > ProductWeight.BuilderImplements
ProductWeightOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ProductWeight.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
build()
public ProductWeight build()
Returns | |
---|---|
Type | Description |
ProductWeight |
buildPartial()
public ProductWeight buildPartial()
Returns | |
---|---|
Type | Description |
ProductWeight |
clear()
public ProductWeight.Builder clear()
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
clearField(Descriptors.FieldDescriptor field)
public ProductWeight.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
public ProductWeight.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
clearUnit()
public ProductWeight.Builder clearUnit()
Required. The weight unit. Acceptable values are:
- "
g
" - "
kg
" - "
oz
" - "
lb
"
string unit = 2 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
This builder for chaining. |
clearValue()
public ProductWeight.Builder clearValue()
Required. The weight represented as a number. The weight can have a maximum precision of four decimal places.
double value = 1 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
This builder for chaining. |
clone()
public ProductWeight.Builder clone()
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
getDefaultInstanceForType()
public ProductWeight getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
ProductWeight |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
getUnit()
public String getUnit()
Required. The weight unit. Acceptable values are:
- "
g
" - "
kg
" - "
oz
" - "
lb
"
string unit = 2 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
String |
The unit. |
getUnitBytes()
public ByteString getUnitBytes()
Required. The weight unit. Acceptable values are:
- "
g
" - "
kg
" - "
oz
" - "
lb
"
string unit = 2 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for unit. |
getValue()
public double getValue()
Required. The weight represented as a number. The weight can have a maximum precision of four decimal places.
double value = 1 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
double |
The value. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public ProductWeight.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public ProductWeight.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
mergeFrom(ProductWeight other)
public ProductWeight.Builder mergeFrom(ProductWeight other)
Parameter | |
---|---|
Name | Description |
other |
ProductWeight |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ProductWeight.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public ProductWeight.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ProductWeight.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
setUnit(String value)
public ProductWeight.Builder setUnit(String value)
Required. The weight unit. Acceptable values are:
- "
g
" - "
kg
" - "
oz
" - "
lb
"
string unit = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
String The unit to set. |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
This builder for chaining. |
setUnitBytes(ByteString value)
public ProductWeight.Builder setUnitBytes(ByteString value)
Required. The weight unit. Acceptable values are:
- "
g
" - "
kg
" - "
oz
" - "
lb
"
string unit = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for unit to set. |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
public final ProductWeight.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
setValue(double value)
public ProductWeight.Builder setValue(double value)
Required. The weight represented as a number. The weight can have a maximum precision of four decimal places.
double value = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
double The value to set. |
Returns | |
---|---|
Type | Description |
ProductWeight.Builder |
This builder for chaining. |