Class SkippedShipment.Reason.Builder (1.49.0)

public static final class SkippedShipment.Reason.Builder extends GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder> implements SkippedShipment.ReasonOrBuilder

If we can explain why the shipment was skipped, reasons will be listed here. If the reason is not the same for all vehicles, reason will have more than 1 element. A skipped shipment cannot have duplicate reasons, i.e. where all fields are the same except for example_vehicle_index. Example: <code><code> reasons { code: DEMAND_EXCEEDS_VEHICLE_CAPACITY example_vehicle_index: 1 example_exceeded_capacity_type: "Apples" } reasons { code: DEMAND_EXCEEDS_VEHICLE_CAPACITY example_vehicle_index: 3 example_exceeded_capacity_type: "Pears" } reasons { code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT example_vehicle_index: 1 } </code></code> The skipped shipment is incompatible with all vehicles. The reasons may be different for all vehicles but at least one vehicle's "Apples" capacity would be exceeded (including vehicle 1), at least one vehicle's "Pears" capacity would be exceeded (including vehicle 3) and at least one vehicle's distance limit would be exceeded (including vehicle 1).

Protobuf type google.cloud.optimization.v1.SkippedShipment.Reason

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SkippedShipment.Reason.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

build()

public SkippedShipment.Reason build()
Returns
Type Description
SkippedShipment.Reason

buildPartial()

public SkippedShipment.Reason buildPartial()
Returns
Type Description
SkippedShipment.Reason

clear()

public SkippedShipment.Reason.Builder clear()
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

clearCode()

public SkippedShipment.Reason.Builder clearCode()

Refer to the comments of Code.

.google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

clearExampleExceededCapacityType()

public SkippedShipment.Reason.Builder clearExampleExceededCapacityType()

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.

string example_exceeded_capacity_type = 3;

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

clearExampleVehicleIndex()

public SkippedShipment.Reason.Builder clearExampleVehicleIndex()

If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.

optional int32 example_vehicle_index = 2;

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SkippedShipment.Reason.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public SkippedShipment.Reason.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

clone()

public SkippedShipment.Reason.Builder clone()
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

getCode()

public SkippedShipment.Reason.Code getCode()

Refer to the comments of Code.

.google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;

Returns
Type Description
SkippedShipment.Reason.Code

The code.

getCodeValue()

public int getCodeValue()

Refer to the comments of Code.

.google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;

Returns
Type Description
int

The enum numeric value on the wire for code.

getDefaultInstanceForType()

public SkippedShipment.Reason getDefaultInstanceForType()
Returns
Type Description
SkippedShipment.Reason

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getExampleExceededCapacityType()

public String getExampleExceededCapacityType()

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.

string example_exceeded_capacity_type = 3;

Returns
Type Description
String

The exampleExceededCapacityType.

getExampleExceededCapacityTypeBytes()

public ByteString getExampleExceededCapacityTypeBytes()

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.

string example_exceeded_capacity_type = 3;

Returns
Type Description
ByteString

The bytes for exampleExceededCapacityType.

getExampleVehicleIndex()

public int getExampleVehicleIndex()

If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.

optional int32 example_vehicle_index = 2;

Returns
Type Description
int

The exampleVehicleIndex.

hasExampleVehicleIndex()

public boolean hasExampleVehicleIndex()

If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.

optional int32 example_vehicle_index = 2;

Returns
Type Description
boolean

Whether the exampleVehicleIndex field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SkippedShipment.Reason other)

public SkippedShipment.Reason.Builder mergeFrom(SkippedShipment.Reason other)
Parameter
Name Description
other SkippedShipment.Reason
Returns
Type Description
SkippedShipment.Reason.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SkippedShipment.Reason.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SkippedShipment.Reason.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SkippedShipment.Reason.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

setCode(SkippedShipment.Reason.Code value)

public SkippedShipment.Reason.Builder setCode(SkippedShipment.Reason.Code value)

Refer to the comments of Code.

.google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;

Parameter
Name Description
value SkippedShipment.Reason.Code

The code to set.

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

setCodeValue(int value)

public SkippedShipment.Reason.Builder setCodeValue(int value)

Refer to the comments of Code.

.google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;

Parameter
Name Description
value int

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

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

setExampleExceededCapacityType(String value)

public SkippedShipment.Reason.Builder setExampleExceededCapacityType(String value)

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.

string example_exceeded_capacity_type = 3;

Parameter
Name Description
value String

The exampleExceededCapacityType to set.

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

setExampleExceededCapacityTypeBytes(ByteString value)

public SkippedShipment.Reason.Builder setExampleExceededCapacityTypeBytes(ByteString value)

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.

string example_exceeded_capacity_type = 3;

Parameter
Name Description
value ByteString

The bytes for exampleExceededCapacityType to set.

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

setExampleVehicleIndex(int value)

public SkippedShipment.Reason.Builder setExampleVehicleIndex(int value)

If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.

optional int32 example_vehicle_index = 2;

Parameter
Name Description
value int

The exampleVehicleIndex to set.

Returns
Type Description
SkippedShipment.Reason.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public SkippedShipment.Reason.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

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

public SkippedShipment.Reason.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final SkippedShipment.Reason.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SkippedShipment.Reason.Builder
Overrides