Class InjectedSolutionConstraint.ConstraintRelaxation.Builder

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

public static final class InjectedSolutionConstraint.ConstraintRelaxation.Builder extends com.google.protobuf.GeneratedMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Builder> implements InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
 For a group of vehicles, specifies at what threshold(s) constraints on
 visits will be relaxed and to which level. Shipments listed in
 the `skipped_shipment` field are constrained to be skipped; i.e., they
 cannot be performed.
 
Protobuf type google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation
  • 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<InjectedSolutionConstraint.ConstraintRelaxation.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<InjectedSolutionConstraint.ConstraintRelaxation.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<InjectedSolutionConstraint.ConstraintRelaxation.Builder>
    • getDefaultInstanceForType

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

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

      public InjectedSolutionConstraint.ConstraintRelaxation.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<InjectedSolutionConstraint.ConstraintRelaxation.Builder>
      Throws:
      IOException
    • getRelaxationsList

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
      Specified by:
      getRelaxationsList in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
    • getRelaxationsCount

      public int getRelaxationsCount()
       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
      Specified by:
      getRelaxationsCount in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
    • getRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
      Specified by:
      getRelaxations in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
    • setRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • setRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • addRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • addRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • addRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • addRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • addAllRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • clearRelaxations

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • removeRelaxations

      public InjectedSolutionConstraint.ConstraintRelaxation.Builder removeRelaxations(int index)
       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • getRelaxationsBuilder

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • getRelaxationsOrBuilder

      public InjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder getRelaxationsOrBuilder(int index)
       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
      Specified by:
      getRelaxationsOrBuilder in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
    • getRelaxationsOrBuilderList

      public List<? extends InjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder> getRelaxationsOrBuilderList()
       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
      Specified by:
      getRelaxationsOrBuilderList in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
    • addRelaxationsBuilder

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • addRelaxationsBuilder

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • getRelaxationsBuilderList

       All the visit constraint relaxations that will apply to visits on
       routes with vehicles in `vehicle_indices`.
       
      repeated .google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1;
    • getVehicleIndicesList

      public List<Integer> getVehicleIndicesList()
       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Specified by:
      getVehicleIndicesList in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
      Returns:
      A list containing the vehicleIndices.
    • getVehicleIndicesCount

      public int getVehicleIndicesCount()
       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Specified by:
      getVehicleIndicesCount in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
      Returns:
      The count of vehicleIndices.
    • getVehicleIndices

      public int getVehicleIndices(int index)
       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Specified by:
      getVehicleIndices in interface InjectedSolutionConstraint.ConstraintRelaxationOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The vehicleIndices at the given index.
    • setVehicleIndices

      public InjectedSolutionConstraint.ConstraintRelaxation.Builder setVehicleIndices(int index, int value)
       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Parameters:
      index - The index to set the value at.
      value - The vehicleIndices to set.
      Returns:
      This builder for chaining.
    • addVehicleIndices

      public InjectedSolutionConstraint.ConstraintRelaxation.Builder addVehicleIndices(int value)
       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Parameters:
      value - The vehicleIndices to add.
      Returns:
      This builder for chaining.
    • addAllVehicleIndices

      public InjectedSolutionConstraint.ConstraintRelaxation.Builder addAllVehicleIndices(Iterable<? extends Integer> values)
       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Parameters:
      values - The vehicleIndices to add.
      Returns:
      This builder for chaining.
    • clearVehicleIndices

       Specifies the vehicle indices to which the visit constraint
       `relaxations` apply. If empty, this is considered the default and the
       `relaxations` apply to all vehicles that are not specified in other
       `constraint_relaxations`. There can be at most one default, i.e., at
       most one constraint relaxation field is allowed empty
       `vehicle_indices`. A vehicle index can only be listed once, even within
       several `constraint_relaxations`.
      
       A vehicle index is mapped the same as
       [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index],
       if `interpret_injected_solutions_using_labels` is true (see `fields`
       comment).
       
      repeated int32 vehicle_indices = 2;
      Returns:
      This builder for chaining.