Class Vehicle.LoadLimit.Builder

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

public static final class Vehicle.LoadLimit.Builder extends com.google.protobuf.GeneratedMessage.Builder<Vehicle.LoadLimit.Builder> implements Vehicle.LoadLimitOrBuilder
 Defines a load limit applying to a vehicle, e.g. "this truck may only
 carry up to 3500 kg". See
 [load_limits][google.cloud.optimization.v1.Vehicle.load_limits].
 
Protobuf type google.cloud.optimization.v1.Vehicle.LoadLimit
  • 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<Vehicle.LoadLimit.Builder>
    • clear

      public Vehicle.LoadLimit.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<Vehicle.LoadLimit.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<Vehicle.LoadLimit.Builder>
    • getDefaultInstanceForType

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

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

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

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

      public Vehicle.LoadLimit.Builder mergeFrom(Vehicle.LoadLimit other)
    • isInitialized

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

      public Vehicle.LoadLimit.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<Vehicle.LoadLimit.Builder>
      Throws:
      IOException
    • hasMaxLoad

      public boolean hasMaxLoad()
       The maximum acceptable amount of load.
       
      optional int64 max_load = 1;
      Specified by:
      hasMaxLoad in interface Vehicle.LoadLimitOrBuilder
      Returns:
      Whether the maxLoad field is set.
    • getMaxLoad

      public long getMaxLoad()
       The maximum acceptable amount of load.
       
      optional int64 max_load = 1;
      Specified by:
      getMaxLoad in interface Vehicle.LoadLimitOrBuilder
      Returns:
      The maxLoad.
    • setMaxLoad

      public Vehicle.LoadLimit.Builder setMaxLoad(long value)
       The maximum acceptable amount of load.
       
      optional int64 max_load = 1;
      Parameters:
      value - The maxLoad to set.
      Returns:
      This builder for chaining.
    • clearMaxLoad

      public Vehicle.LoadLimit.Builder clearMaxLoad()
       The maximum acceptable amount of load.
       
      optional int64 max_load = 1;
      Returns:
      This builder for chaining.
    • getSoftMaxLoad

      public long getSoftMaxLoad()
       A soft limit of the load. See
       [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
       
      int64 soft_max_load = 2;
      Specified by:
      getSoftMaxLoad in interface Vehicle.LoadLimitOrBuilder
      Returns:
      The softMaxLoad.
    • setSoftMaxLoad

      public Vehicle.LoadLimit.Builder setSoftMaxLoad(long value)
       A soft limit of the load. See
       [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
       
      int64 soft_max_load = 2;
      Parameters:
      value - The softMaxLoad to set.
      Returns:
      This builder for chaining.
    • clearSoftMaxLoad

      public Vehicle.LoadLimit.Builder clearSoftMaxLoad()
       A soft limit of the load. See
       [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
       
      int64 soft_max_load = 2;
      Returns:
      This builder for chaining.
    • getCostPerUnitAboveSoftMax

      public double getCostPerUnitAboveSoftMax()
       If the load ever exceeds
       [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
       along this vehicle's route, the following cost penalty applies (only once
       per vehicle): (load -
       [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
       * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
       add up and must be in the same unit as
       [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
       
      double cost_per_unit_above_soft_max = 3;
      Specified by:
      getCostPerUnitAboveSoftMax in interface Vehicle.LoadLimitOrBuilder
      Returns:
      The costPerUnitAboveSoftMax.
    • setCostPerUnitAboveSoftMax

      public Vehicle.LoadLimit.Builder setCostPerUnitAboveSoftMax(double value)
       If the load ever exceeds
       [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
       along this vehicle's route, the following cost penalty applies (only once
       per vehicle): (load -
       [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
       * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
       add up and must be in the same unit as
       [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
       
      double cost_per_unit_above_soft_max = 3;
      Parameters:
      value - The costPerUnitAboveSoftMax to set.
      Returns:
      This builder for chaining.
    • clearCostPerUnitAboveSoftMax

      public Vehicle.LoadLimit.Builder clearCostPerUnitAboveSoftMax()
       If the load ever exceeds
       [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
       along this vehicle's route, the following cost penalty applies (only once
       per vehicle): (load -
       [soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
       * [cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
       add up and must be in the same unit as
       [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
       
      double cost_per_unit_above_soft_max = 3;
      Returns:
      This builder for chaining.
    • hasStartLoadInterval

      public boolean hasStartLoadInterval()
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
      Specified by:
      hasStartLoadInterval in interface Vehicle.LoadLimitOrBuilder
      Returns:
      Whether the startLoadInterval field is set.
    • getStartLoadInterval

      public Vehicle.LoadLimit.Interval getStartLoadInterval()
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
      Specified by:
      getStartLoadInterval in interface Vehicle.LoadLimitOrBuilder
      Returns:
      The startLoadInterval.
    • setStartLoadInterval

      public Vehicle.LoadLimit.Builder setStartLoadInterval(Vehicle.LoadLimit.Interval value)
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
    • setStartLoadInterval

      public Vehicle.LoadLimit.Builder setStartLoadInterval(Vehicle.LoadLimit.Interval.Builder builderForValue)
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
    • mergeStartLoadInterval

      public Vehicle.LoadLimit.Builder mergeStartLoadInterval(Vehicle.LoadLimit.Interval value)
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
    • clearStartLoadInterval

      public Vehicle.LoadLimit.Builder clearStartLoadInterval()
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
    • getStartLoadIntervalBuilder

      public Vehicle.LoadLimit.Interval.Builder getStartLoadIntervalBuilder()
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
    • getStartLoadIntervalOrBuilder

      public Vehicle.LoadLimit.IntervalOrBuilder getStartLoadIntervalOrBuilder()
       The acceptable load interval of the vehicle at the start of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4;
      Specified by:
      getStartLoadIntervalOrBuilder in interface Vehicle.LoadLimitOrBuilder
    • hasEndLoadInterval

      public boolean hasEndLoadInterval()
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
      Specified by:
      hasEndLoadInterval in interface Vehicle.LoadLimitOrBuilder
      Returns:
      Whether the endLoadInterval field is set.
    • getEndLoadInterval

      public Vehicle.LoadLimit.Interval getEndLoadInterval()
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
      Specified by:
      getEndLoadInterval in interface Vehicle.LoadLimitOrBuilder
      Returns:
      The endLoadInterval.
    • setEndLoadInterval

      public Vehicle.LoadLimit.Builder setEndLoadInterval(Vehicle.LoadLimit.Interval value)
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
    • setEndLoadInterval

      public Vehicle.LoadLimit.Builder setEndLoadInterval(Vehicle.LoadLimit.Interval.Builder builderForValue)
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
    • mergeEndLoadInterval

      public Vehicle.LoadLimit.Builder mergeEndLoadInterval(Vehicle.LoadLimit.Interval value)
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
    • clearEndLoadInterval

      public Vehicle.LoadLimit.Builder clearEndLoadInterval()
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
    • getEndLoadIntervalBuilder

      public Vehicle.LoadLimit.Interval.Builder getEndLoadIntervalBuilder()
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
    • getEndLoadIntervalOrBuilder

      public Vehicle.LoadLimit.IntervalOrBuilder getEndLoadIntervalOrBuilder()
       The acceptable load interval of the vehicle at the end of the route.
       
      .google.cloud.optimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5;
      Specified by:
      getEndLoadIntervalOrBuilder in interface Vehicle.LoadLimitOrBuilder