Class ProductWeight.Builder (0.8.0)

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

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ProductWeight.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ProductWeight.Builder
Overrides

build()

public ProductWeight build()
Returns
TypeDescription
ProductWeight

buildPartial()

public ProductWeight buildPartial()
Returns
TypeDescription
ProductWeight

clear()

public ProductWeight.Builder clear()
Returns
TypeDescription
ProductWeight.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public ProductWeight.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ProductWeight.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public ProductWeight.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ProductWeight.Builder
Overrides

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
TypeDescription
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
TypeDescription
ProductWeight.Builder

This builder for chaining.

clone()

public ProductWeight.Builder clone()
Returns
TypeDescription
ProductWeight.Builder
Overrides

getDefaultInstanceForType()

public ProductWeight getDefaultInstanceForType()
Returns
TypeDescription
ProductWeight

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getUnit()

public String getUnit()

Required. The weight unit. Acceptable values are:

  • "g"
  • "kg"
  • "oz"
  • "lb"

string unit = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
double

The value.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ProductWeight.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductWeight.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ProductWeight.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ProductWeight.Builder
Overrides

mergeFrom(ProductWeight other)

public ProductWeight.Builder mergeFrom(ProductWeight other)
Parameter
NameDescription
otherProductWeight
Returns
TypeDescription
ProductWeight.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ProductWeight.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ProductWeight.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public ProductWeight.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ProductWeight.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ProductWeight.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
ProductWeight.Builder
Overrides

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
NameDescription
valueString

The unit to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for unit to set.

Returns
TypeDescription
ProductWeight.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ProductWeight.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ProductWeight.Builder
Overrides

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
NameDescription
valuedouble

The value to set.

Returns
TypeDescription
ProductWeight.Builder

This builder for chaining.