Class ShipmentTypeRequirement.Builder (1.31.0)

public static final class ShipmentTypeRequirement.Builder extends GeneratedMessageV3.Builder<ShipmentTypeRequirement.Builder> implements ShipmentTypeRequirementOrBuilder

Specifies requirements between shipments based on their shipment_type. The specifics of the requirement are defined by the requirement mode.

Protobuf type google.cloud.optimization.v1.ShipmentTypeRequirement

Static Methods

getDescriptor()

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

Methods

addAllDependentShipmentTypes(Iterable<String> values)

public ShipmentTypeRequirement.Builder addAllDependentShipmentTypes(Iterable<String> values)

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Parameter
NameDescription
valuesIterable<String>

The dependentShipmentTypes to add.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

addAllRequiredShipmentTypeAlternatives(Iterable<String> values)

public ShipmentTypeRequirement.Builder addAllRequiredShipmentTypeAlternatives(Iterable<String> values)

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Parameter
NameDescription
valuesIterable<String>

The requiredShipmentTypeAlternatives to add.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

addDependentShipmentTypes(String value)

public ShipmentTypeRequirement.Builder addDependentShipmentTypes(String value)

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Parameter
NameDescription
valueString

The dependentShipmentTypes to add.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

addDependentShipmentTypesBytes(ByteString value)

public ShipmentTypeRequirement.Builder addDependentShipmentTypesBytes(ByteString value)

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Parameter
NameDescription
valueByteString

The bytes of the dependentShipmentTypes to add.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addRequiredShipmentTypeAlternatives(String value)

public ShipmentTypeRequirement.Builder addRequiredShipmentTypeAlternatives(String value)

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Parameter
NameDescription
valueString

The requiredShipmentTypeAlternatives to add.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

addRequiredShipmentTypeAlternativesBytes(ByteString value)

public ShipmentTypeRequirement.Builder addRequiredShipmentTypeAlternativesBytes(ByteString value)

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Parameter
NameDescription
valueByteString

The bytes of the requiredShipmentTypeAlternatives to add.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

build()

public ShipmentTypeRequirement build()
Returns
TypeDescription
ShipmentTypeRequirement

buildPartial()

public ShipmentTypeRequirement buildPartial()
Returns
TypeDescription
ShipmentTypeRequirement

clear()

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

clearDependentShipmentTypes()

public ShipmentTypeRequirement.Builder clearDependentShipmentTypes()

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearRequiredShipmentTypeAlternatives()

public ShipmentTypeRequirement.Builder clearRequiredShipmentTypeAlternatives()

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

clearRequirementMode()

public ShipmentTypeRequirement.Builder clearRequirementMode()

Mode applied to the requirement.

.google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public ShipmentTypeRequirement getDefaultInstanceForType()
Returns
TypeDescription
ShipmentTypeRequirement

getDependentShipmentTypes(int index)

public String getDependentShipmentTypes(int index)

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The dependentShipmentTypes at the given index.

getDependentShipmentTypesBytes(int index)

public ByteString getDependentShipmentTypesBytes(int index)

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the dependentShipmentTypes at the given index.

getDependentShipmentTypesCount()

public int getDependentShipmentTypesCount()

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Returns
TypeDescription
int

The count of dependentShipmentTypes.

getDependentShipmentTypesList()

public ProtocolStringList getDependentShipmentTypesList()

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Returns
TypeDescription
ProtocolStringList

A list containing the dependentShipmentTypes.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getRequiredShipmentTypeAlternatives(int index)

public String getRequiredShipmentTypeAlternatives(int index)

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The requiredShipmentTypeAlternatives at the given index.

getRequiredShipmentTypeAlternativesBytes(int index)

public ByteString getRequiredShipmentTypeAlternativesBytes(int index)

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the requiredShipmentTypeAlternatives at the given index.

getRequiredShipmentTypeAlternativesCount()

public int getRequiredShipmentTypeAlternativesCount()

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Returns
TypeDescription
int

The count of requiredShipmentTypeAlternatives.

getRequiredShipmentTypeAlternativesList()

public ProtocolStringList getRequiredShipmentTypeAlternativesList()

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Returns
TypeDescription
ProtocolStringList

A list containing the requiredShipmentTypeAlternatives.

getRequirementMode()

public ShipmentTypeRequirement.RequirementMode getRequirementMode()

Mode applied to the requirement.

.google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;

Returns
TypeDescription
ShipmentTypeRequirement.RequirementMode

The requirementMode.

getRequirementModeValue()

public int getRequirementModeValue()

Mode applied to the requirement.

.google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;

Returns
TypeDescription
int

The enum numeric value on the wire for requirementMode.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(ShipmentTypeRequirement other)

public ShipmentTypeRequirement.Builder mergeFrom(ShipmentTypeRequirement other)
Parameter
NameDescription
otherShipmentTypeRequirement
Returns
TypeDescription
ShipmentTypeRequirement.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setDependentShipmentTypes(int index, String value)

public ShipmentTypeRequirement.Builder setDependentShipmentTypes(int index, String value)

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

repeated string dependent_shipment_types = 2;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The dependentShipmentTypes to set.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setRequiredShipmentTypeAlternatives(int index, String value)

public ShipmentTypeRequirement.Builder setRequiredShipmentTypeAlternatives(int index, String value)

List of alternative shipment types required by the dependent_shipment_types.

repeated string required_shipment_type_alternatives = 1;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The requiredShipmentTypeAlternatives to set.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

setRequirementMode(ShipmentTypeRequirement.RequirementMode value)

public ShipmentTypeRequirement.Builder setRequirementMode(ShipmentTypeRequirement.RequirementMode value)

Mode applied to the requirement.

.google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;

Parameter
NameDescription
valueShipmentTypeRequirement.RequirementMode

The requirementMode to set.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

setRequirementModeValue(int value)

public ShipmentTypeRequirement.Builder setRequirementModeValue(int value)

Mode applied to the requirement.

.google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;

Parameter
NameDescription
valueint

The enum numeric value on the wire for requirementMode to set.

Returns
TypeDescription
ShipmentTypeRequirement.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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