Class SkippedShipment.Reason.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<SkippedShipment.Reason.Builder>
com.google.cloud.optimization.v1.SkippedShipment.Reason.Builder
All Implemented Interfaces:
SkippedShipment.ReasonOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
SkippedShipment.Reason

public static final class SkippedShipment.Reason.Builder extends com.google.protobuf.GeneratedMessage.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:
 ```
 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
 }
 ```
 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
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<SkippedShipment.Reason.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<SkippedShipment.Reason.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<SkippedShipment.Reason.Builder>
    • getDefaultInstanceForType

      public SkippedShipment.Reason getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public SkippedShipment.Reason build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public SkippedShipment.Reason buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public SkippedShipment.Reason.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SkippedShipment.Reason.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<SkippedShipment.Reason.Builder>
    • mergeFrom

      public SkippedShipment.Reason.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SkippedShipment.Reason.Builder>
      Throws:
      IOException
    • getCodeValue

      public int getCodeValue()
       Refer to the comments of Code.
       
      .google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;
      Specified by:
      getCodeValue in interface SkippedShipment.ReasonOrBuilder
      Returns:
      The enum numeric value on the wire for code.
    • setCodeValue

      public SkippedShipment.Reason.Builder setCodeValue(int value)
       Refer to the comments of Code.
       
      .google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;
      Parameters:
      value - The enum numeric value on the wire for code to set.
      Returns:
      This builder for chaining.
    • getCode

      public SkippedShipment.Reason.Code getCode()
       Refer to the comments of Code.
       
      .google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;
      Specified by:
      getCode in interface SkippedShipment.ReasonOrBuilder
      Returns:
      The code.
    • setCode

       Refer to the comments of Code.
       
      .google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;
      Parameters:
      value - The code to set.
      Returns:
      This builder for chaining.
    • clearCode

      public SkippedShipment.Reason.Builder clearCode()
       Refer to the comments of Code.
       
      .google.cloud.optimization.v1.SkippedShipment.Reason.Code code = 1;
      Returns:
      This builder for chaining.
    • 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;
      Specified by:
      hasExampleVehicleIndex in interface SkippedShipment.ReasonOrBuilder
      Returns:
      Whether the exampleVehicleIndex field is set.
    • 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;
      Specified by:
      getExampleVehicleIndex in interface SkippedShipment.ReasonOrBuilder
      Returns:
      The exampleVehicleIndex.
    • setExampleVehicleIndex

      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;
      Parameters:
      value - The exampleVehicleIndex to set.
      Returns:
      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:
      This builder for chaining.
    • 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;
      Specified by:
      getExampleExceededCapacityType in interface SkippedShipment.ReasonOrBuilder
      Returns:
      The exampleExceededCapacityType.
    • getExampleExceededCapacityTypeBytes

      public com.google.protobuf.ByteString getExampleExceededCapacityTypeBytes()
       If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
       capacity type that is exceeded.
       
      string example_exceeded_capacity_type = 3;
      Specified by:
      getExampleExceededCapacityTypeBytes in interface SkippedShipment.ReasonOrBuilder
      Returns:
      The bytes for exampleExceededCapacityType.
    • setExampleExceededCapacityType

      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;
      Parameters:
      value - The exampleExceededCapacityType to set.
      Returns:
      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:
      This builder for chaining.
    • setExampleExceededCapacityTypeBytes

      public SkippedShipment.Reason.Builder setExampleExceededCapacityTypeBytes(com.google.protobuf.ByteString value)
       If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
       capacity type that is exceeded.
       
      string example_exceeded_capacity_type = 3;
      Parameters:
      value - The bytes for exampleExceededCapacityType to set.
      Returns:
      This builder for chaining.