Class 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.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:
     ```
     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 Detail

      • getDescriptor

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

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

        public 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.GeneratedMessageV3.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.GeneratedMessageV3.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
      • clone

        public SkippedShipment.Reason.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>
      • clearField

        public SkippedShipment.Reason.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>
      • clearOneof

        public SkippedShipment.Reason.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>
      • setRepeatedField

        public SkippedShipment.Reason.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                               int index,
                                                               Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>
      • addRepeatedField

        public SkippedShipment.Reason.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                               Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.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.
      • 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.
      • setUnknownFields

        public final SkippedShipment.Reason.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>
      • mergeUnknownFields

        public final SkippedShipment.Reason.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SkippedShipment.Reason.Builder>