Class 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.GeneratedMessageV3.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 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<ShipmentTypeRequirement.Builder>
      • clear

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

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

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

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

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

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

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

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

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

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