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

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

        public Vehicle.LoadLimit.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Vehicle.LoadLimit.Builder>
      • clearField

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

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

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

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

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

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

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