Class ShipmentTypeRequirement.Builder

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

public static final class ShipmentTypeRequirement.Builder extends com.google.protobuf.GeneratedMessage.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
  • 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<ShipmentTypeRequirement.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<ShipmentTypeRequirement.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<ShipmentTypeRequirement.Builder>
    • getDefaultInstanceForType

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

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

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

      public ShipmentTypeRequirement.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<ShipmentTypeRequirement.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<ShipmentTypeRequirement.Builder>
    • mergeFrom

      public ShipmentTypeRequirement.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<ShipmentTypeRequirement.Builder>
      Throws:
      IOException
    • getRequiredShipmentTypeAlternativesList

      public com.google.protobuf.ProtocolStringList getRequiredShipmentTypeAlternativesList()
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Specified by:
      getRequiredShipmentTypeAlternativesList in interface ShipmentTypeRequirementOrBuilder
      Returns:
      A list containing the requiredShipmentTypeAlternatives.
    • getRequiredShipmentTypeAlternativesCount

      public int getRequiredShipmentTypeAlternativesCount()
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Specified by:
      getRequiredShipmentTypeAlternativesCount in interface ShipmentTypeRequirementOrBuilder
      Returns:
      The count of requiredShipmentTypeAlternatives.
    • getRequiredShipmentTypeAlternatives

      public String getRequiredShipmentTypeAlternatives(int index)
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Specified by:
      getRequiredShipmentTypeAlternatives in interface ShipmentTypeRequirementOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The requiredShipmentTypeAlternatives at the given index.
    • getRequiredShipmentTypeAlternativesBytes

      public com.google.protobuf.ByteString getRequiredShipmentTypeAlternativesBytes(int index)
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Specified by:
      getRequiredShipmentTypeAlternativesBytes in interface ShipmentTypeRequirementOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the requiredShipmentTypeAlternatives at the given index.
    • setRequiredShipmentTypeAlternatives

      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:
      index - The index to set the value at.
      value - The requiredShipmentTypeAlternatives to set.
      Returns:
      This builder for chaining.
    • addRequiredShipmentTypeAlternatives

      public ShipmentTypeRequirement.Builder addRequiredShipmentTypeAlternatives(String value)
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Parameters:
      value - The requiredShipmentTypeAlternatives to add.
      Returns:
      This builder for chaining.
    • addAllRequiredShipmentTypeAlternatives

      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;
      Parameters:
      values - The requiredShipmentTypeAlternatives to add.
      Returns:
      This builder for chaining.
    • clearRequiredShipmentTypeAlternatives

      public ShipmentTypeRequirement.Builder clearRequiredShipmentTypeAlternatives()
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Returns:
      This builder for chaining.
    • addRequiredShipmentTypeAlternativesBytes

      public ShipmentTypeRequirement.Builder addRequiredShipmentTypeAlternativesBytes(com.google.protobuf.ByteString value)
       List of alternative shipment types required by the
       `dependent_shipment_types`.
       
      repeated string required_shipment_type_alternatives = 1;
      Parameters:
      value - The bytes of the requiredShipmentTypeAlternatives to add.
      Returns:
      This builder for chaining.
    • getDependentShipmentTypesList

      public com.google.protobuf.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;
      Specified by:
      getDependentShipmentTypesList in interface ShipmentTypeRequirementOrBuilder
      Returns:
      A list containing the dependentShipmentTypes.
    • 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;
      Specified by:
      getDependentShipmentTypesCount in interface ShipmentTypeRequirementOrBuilder
      Returns:
      The count of dependentShipmentTypes.
    • getDependentShipmentTypes

      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;
      Specified by:
      getDependentShipmentTypes in interface ShipmentTypeRequirementOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The dependentShipmentTypes at the given index.
    • getDependentShipmentTypesBytes

      public com.google.protobuf.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;
      Specified by:
      getDependentShipmentTypesBytes in interface ShipmentTypeRequirementOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the dependentShipmentTypes at the given index.
    • setDependentShipmentTypes

      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:
      index - The index to set the value at.
      value - The dependentShipmentTypes to set.
      Returns:
      This builder for chaining.
    • addDependentShipmentTypes

      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;
      Parameters:
      value - The dependentShipmentTypes to add.
      Returns:
      This builder for chaining.
    • addAllDependentShipmentTypes

      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;
      Parameters:
      values - The dependentShipmentTypes to add.
      Returns:
      This builder for chaining.
    • 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:
      This builder for chaining.
    • addDependentShipmentTypesBytes

      public ShipmentTypeRequirement.Builder addDependentShipmentTypesBytes(com.google.protobuf.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;
      Parameters:
      value - The bytes of the dependentShipmentTypes to add.
      Returns:
      This builder for chaining.
    • getRequirementModeValue

      public int getRequirementModeValue()
       Mode applied to the requirement.
       
      .google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;
      Specified by:
      getRequirementModeValue in interface ShipmentTypeRequirementOrBuilder
      Returns:
      The enum numeric value on the wire for requirementMode.
    • setRequirementModeValue

      public ShipmentTypeRequirement.Builder setRequirementModeValue(int value)
       Mode applied to the requirement.
       
      .google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;
      Parameters:
      value - The enum numeric value on the wire for requirementMode to set.
      Returns:
      This builder for chaining.
    • getRequirementMode

      public ShipmentTypeRequirement.RequirementMode getRequirementMode()
       Mode applied to the requirement.
       
      .google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;
      Specified by:
      getRequirementMode in interface ShipmentTypeRequirementOrBuilder
      Returns:
      The requirementMode.
    • setRequirementMode

       Mode applied to the requirement.
       
      .google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;
      Parameters:
      value - The requirementMode to set.
      Returns:
      This builder for chaining.
    • clearRequirementMode

      public ShipmentTypeRequirement.Builder clearRequirementMode()
       Mode applied to the requirement.
       
      .google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3;
      Returns:
      This builder for chaining.