Class Vehicle.DurationLimit.Builder (1.7.0)

publicstaticfinalclass Vehicle.DurationLimit.BuilderextendsGeneratedMessageV3.Builder<Vehicle.DurationLimit.Builder>implementsVehicle.DurationLimitOrBuilder

A limit defining a maximum duration of the route of a vehicle. It can be either hard or soft. When a soft limit field is defined, both the soft max threshold and its associated cost must be defined together.

Protobuf type google.cloud.optimization.v1.Vehicle.DurationLimit

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicVehicle.DurationLimit.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

build()

publicVehicle.DurationLimitbuild()
Returns
Type Description

buildPartial()

publicVehicle.DurationLimitbuildPartial()
Returns
Type Description

clear()

publicVehicle.DurationLimit.Builderclear()
Returns
Type Description
Overrides

clearCostPerHourAfterSoftMax()

publicVehicle.DurationLimit.BuilderclearCostPerHourAfterSoftMax()

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_hour_after_soft_max * (duration - soft_max_duration) </code></code> The cost must be nonnegative.

optional double cost_per_hour_after_soft_max = 3;

Returns
Type Description
Vehicle.DurationLimit.Builder

This builder for chaining.

clearCostPerSquareHourAfterQuadraticSoftMax()

publicVehicle.DurationLimit.BuilderclearCostPerSquareHourAfterQuadraticSoftMax()

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_square_hour_after_quadratic_soft_max * (duration - quadratic_soft_max_duration)^2 </code></code> The cost must be nonnegative.

optional double cost_per_square_hour_after_quadratic_soft_max = 5;

Returns
Type Description
Vehicle.DurationLimit.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicVehicle.DurationLimit.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
Returns
Type Description
Overrides

clearMaxDuration()

publicVehicle.DurationLimit.BuilderclearMaxDuration()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description

clearOneof(Descriptors.OneofDescriptor oneof)

publicVehicle.DurationLimit.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
Returns
Type Description
Overrides

clearQuadraticSoftMaxDuration()

publicVehicle.DurationLimit.BuilderclearQuadraticSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description

clearSoftMaxDuration()

publicVehicle.DurationLimit.BuilderclearSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description

clone()

publicVehicle.DurationLimit.Builderclone()
Returns
Type Description
Overrides

getCostPerHourAfterSoftMax()

publicdoublegetCostPerHourAfterSoftMax()

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_hour_after_soft_max * (duration - soft_max_duration) </code></code> The cost must be nonnegative.

optional double cost_per_hour_after_soft_max = 3;

Returns
Type Description
double

The costPerHourAfterSoftMax.

getCostPerSquareHourAfterQuadraticSoftMax()

publicdoublegetCostPerSquareHourAfterQuadraticSoftMax()

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_square_hour_after_quadratic_soft_max * (duration - quadratic_soft_max_duration)^2 </code></code> The cost must be nonnegative.

optional double cost_per_square_hour_after_quadratic_soft_max = 5;

Returns
Type Description
double

The costPerSquareHourAfterQuadraticSoftMax.

getDefaultInstanceForType()

publicVehicle.DurationLimitgetDefaultInstanceForType()
Returns
Type Description

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Overrides

getMaxDuration()

publicDurationgetMaxDuration()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description
Duration

The maxDuration.

getMaxDurationBuilder()

publicDuration.BuildergetMaxDurationBuilder()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description

getMaxDurationOrBuilder()

publicDurationOrBuildergetMaxDurationOrBuilder()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description

getQuadraticSoftMaxDuration()

publicDurationgetQuadraticSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description
Duration

The quadraticSoftMaxDuration.

getQuadraticSoftMaxDurationBuilder()

publicDuration.BuildergetQuadraticSoftMaxDurationBuilder()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description

getQuadraticSoftMaxDurationOrBuilder()

publicDurationOrBuildergetQuadraticSoftMaxDurationOrBuilder()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description

getSoftMaxDuration()

publicDurationgetSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description
Duration

The softMaxDuration.

getSoftMaxDurationBuilder()

publicDuration.BuildergetSoftMaxDurationBuilder()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description

getSoftMaxDurationOrBuilder()

publicDurationOrBuildergetSoftMaxDurationOrBuilder()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description

hasCostPerHourAfterSoftMax()

publicbooleanhasCostPerHourAfterSoftMax()

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_hour_after_soft_max * (duration - soft_max_duration) </code></code> The cost must be nonnegative.

optional double cost_per_hour_after_soft_max = 3;

Returns
Type Description
boolean

Whether the costPerHourAfterSoftMax field is set.

hasCostPerSquareHourAfterQuadraticSoftMax()

publicbooleanhasCostPerSquareHourAfterQuadraticSoftMax()

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_square_hour_after_quadratic_soft_max * (duration - quadratic_soft_max_duration)^2 </code></code> The cost must be nonnegative.

optional double cost_per_square_hour_after_quadratic_soft_max = 5;

Returns
Type Description
boolean

Whether the costPerSquareHourAfterQuadraticSoftMax field is set.

hasMaxDuration()

publicbooleanhasMaxDuration()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description
boolean

Whether the maxDuration field is set.

hasQuadraticSoftMaxDuration()

publicbooleanhasQuadraticSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description
boolean

Whether the quadraticSoftMaxDuration field is set.

hasSoftMaxDuration()

publicbooleanhasSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description
boolean

Whether the softMaxDuration field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

mergeFrom(Vehicle.DurationLimit other)

publicVehicle.DurationLimit.BuildermergeFrom(Vehicle.DurationLimitother)
Parameter
Name Description
Returns
Type Description

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicVehicle.DurationLimit.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Overrides Exceptions
Type Description

mergeFrom(Message other)

publicVehicle.DurationLimit.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Overrides

mergeMaxDuration(Duration value)

publicVehicle.DurationLimit.BuildermergeMaxDuration(Durationvalue)

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Parameter
Name Description
value Duration
Returns
Type Description

mergeQuadraticSoftMaxDuration(Duration value)

publicVehicle.DurationLimit.BuildermergeQuadraticSoftMaxDuration(Durationvalue)

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Parameter
Name Description
value Duration
Returns
Type Description

mergeSoftMaxDuration(Duration value)

publicVehicle.DurationLimit.BuildermergeSoftMaxDuration(Durationvalue)

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Parameter
Name Description
value Duration
Returns
Type Description

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalVehicle.DurationLimit.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

setCostPerHourAfterSoftMax(double value)

publicVehicle.DurationLimit.BuildersetCostPerHourAfterSoftMax(doublevalue)

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_hour_after_soft_max * (duration - soft_max_duration) </code></code> The cost must be nonnegative.

optional double cost_per_hour_after_soft_max = 3;

Parameter
Name Description
value double

The costPerHourAfterSoftMax to set.

Returns
Type Description
Vehicle.DurationLimit.Builder

This builder for chaining.

setCostPerSquareHourAfterQuadraticSoftMax(double value)

publicVehicle.DurationLimit.BuildersetCostPerSquareHourAfterQuadraticSoftMax(doublevalue)

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_square_hour_after_quadratic_soft_max * (duration - quadratic_soft_max_duration)^2 </code></code> The cost must be nonnegative.

optional double cost_per_square_hour_after_quadratic_soft_max = 5;

Parameter
Name Description
value double

The costPerSquareHourAfterQuadraticSoftMax to set.

Returns
Type Description
Vehicle.DurationLimit.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicVehicle.DurationLimit.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

setMaxDuration(Duration value)

publicVehicle.DurationLimit.BuildersetMaxDuration(Durationvalue)

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Parameter
Name Description
value Duration
Returns
Type Description

setMaxDuration(Duration.Builder builderForValue)

publicVehicle.DurationLimit.BuildersetMaxDuration(Duration.BuilderbuilderForValue)

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Parameter
Name Description
builderForValue Builder
Returns
Type Description

setQuadraticSoftMaxDuration(Duration value)

publicVehicle.DurationLimit.BuildersetQuadraticSoftMaxDuration(Durationvalue)

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Parameter
Name Description
value Duration
Returns
Type Description

setQuadraticSoftMaxDuration(Duration.Builder builderForValue)

publicVehicle.DurationLimit.BuildersetQuadraticSoftMaxDuration(Duration.BuilderbuilderForValue)

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day: max_duration - quadratic_soft_max_duration <= 86400 seconds

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Parameter
Name Description
builderForValue Builder
Returns
Type Description

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicVehicle.DurationLimit.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
index int
value Object
Returns
Type Description
Overrides

setSoftMaxDuration(Duration value)

publicVehicle.DurationLimit.BuildersetSoftMaxDuration(Durationvalue)

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Parameter
Name Description
value Duration
Returns
Type Description

setSoftMaxDuration(Duration.Builder builderForValue)

publicVehicle.DurationLimit.BuildersetSoftMaxDuration(Duration.BuilderbuilderForValue)

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Parameter
Name Description
builderForValue Builder
Returns
Type Description

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalVehicle.DurationLimit.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.