Class SkippedShipment.Reason.Builder (1.29.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public SkippedShipment.Reason build()
Returns
TypeDescription
SkippedShipment.Reason

buildPartial()

public SkippedShipment.Reason buildPartial()
Returns
TypeDescription
SkippedShipment.Reason

clear()

public SkippedShipment.Reason.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
SkippedShipment.Reason.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public SkippedShipment.Reason.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
int

The enum numeric value on the wire for code.

getDefaultInstanceForType()

public SkippedShipment.Reason getDefaultInstanceForType()
Returns
TypeDescription
SkippedShipment.Reason

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the exampleVehicleIndex field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SkippedShipment.Reason other)

public SkippedShipment.Reason.Builder mergeFrom(SkippedShipment.Reason other)
Parameter
NameDescription
otherSkippedShipment.Reason
Returns
TypeDescription
SkippedShipment.Reason.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SkippedShipment.Reason.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueSkippedShipment.Reason.Code

The code to set.

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

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

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

The exampleExceededCapacityType to set.

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

The bytes for exampleExceededCapacityType to set.

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

The exampleVehicleIndex to set.

Returns
TypeDescription
SkippedShipment.Reason.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public SkippedShipment.Reason.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
SkippedShipment.Reason.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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