Package com.google.cloud.optimization.v1
Class DistanceLimit.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<DistanceLimit.Builder>
com.google.cloud.optimization.v1.DistanceLimit.Builder
- All Implemented Interfaces:
DistanceLimitOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- DistanceLimit
public static final class DistanceLimit.Builder
extends com.google.protobuf.GeneratedMessage.Builder<DistanceLimit.Builder>
implements DistanceLimitOrBuilder
A limit defining a maximum distance which can be traveled. It can be either hard or soft. If a soft limit is defined, both `soft_max_meters` and `cost_per_kilometer_above_soft_max` must be defined and be nonnegative.Protobuf type
google.cloud.optimization.v1.DistanceLimit-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Cost per kilometer incurred if distance is above `soft_max_meters` limit.Cost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.A hard limit constraining the distance to be at most max_meters.A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.doubleCost per kilometer incurred if distance is above `soft_max_meters` limit.doubleCost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorlongA hard limit constraining the distance to be at most max_meters.longA soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.booleanCost per kilometer incurred if distance is above `soft_max_meters` limit.booleanCost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.booleanA hard limit constraining the distance to be at most max_meters.booleanA soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(DistanceLimit other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setCostPerKilometerAboveSoftMax(double value) Cost per kilometer incurred if distance is above `soft_max_meters` limit.setCostPerKilometerBelowSoftMax(double value) Cost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.setMaxMeters(long value) A hard limit constraining the distance to be at most max_meters.setSoftMaxMeters(long value) A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<DistanceLimit.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<DistanceLimit.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<DistanceLimit.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<DistanceLimit.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<DistanceLimit.Builder>
-
mergeFrom
public DistanceLimit.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<DistanceLimit.Builder>- Throws:
IOException
-
hasMaxMeters
public boolean hasMaxMeters()A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.
optional int64 max_meters = 1;- Specified by:
hasMaxMetersin interfaceDistanceLimitOrBuilder- Returns:
- Whether the maxMeters field is set.
-
getMaxMeters
public long getMaxMeters()A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.
optional int64 max_meters = 1;- Specified by:
getMaxMetersin interfaceDistanceLimitOrBuilder- Returns:
- The maxMeters.
-
setMaxMeters
A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.
optional int64 max_meters = 1;- Parameters:
value- The maxMeters to set.- Returns:
- This builder for chaining.
-
clearMaxMeters
A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.
optional int64 max_meters = 1;- Returns:
- This builder for chaining.
-
hasSoftMaxMeters
public boolean hasSoftMaxMeters()A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit. If defined soft_max_meters must be less than max_meters and must be nonnegative.
optional int64 soft_max_meters = 2;- Specified by:
hasSoftMaxMetersin interfaceDistanceLimitOrBuilder- Returns:
- Whether the softMaxMeters field is set.
-
getSoftMaxMeters
public long getSoftMaxMeters()A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit. If defined soft_max_meters must be less than max_meters and must be nonnegative.
optional int64 soft_max_meters = 2;- Specified by:
getSoftMaxMetersin interfaceDistanceLimitOrBuilder- Returns:
- The softMaxMeters.
-
setSoftMaxMeters
A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit. If defined soft_max_meters must be less than max_meters and must be nonnegative.
optional int64 soft_max_meters = 2;- Parameters:
value- The softMaxMeters to set.- Returns:
- This builder for chaining.
-
clearSoftMaxMeters
A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit. If defined soft_max_meters must be less than max_meters and must be nonnegative.
optional int64 soft_max_meters = 2;- Returns:
- This builder for chaining.
-
hasCostPerKilometerBelowSoftMax
public boolean hasCostPerKilometerBelowSoftMax()Cost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.
optional double cost_per_kilometer_below_soft_max = 4;- Specified by:
hasCostPerKilometerBelowSoftMaxin interfaceDistanceLimitOrBuilder- Returns:
- Whether the costPerKilometerBelowSoftMax field is set.
-
getCostPerKilometerBelowSoftMax
public double getCostPerKilometerBelowSoftMax()Cost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.
optional double cost_per_kilometer_below_soft_max = 4;- Specified by:
getCostPerKilometerBelowSoftMaxin interfaceDistanceLimitOrBuilder- Returns:
- The costPerKilometerBelowSoftMax.
-
setCostPerKilometerBelowSoftMax
Cost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.
optional double cost_per_kilometer_below_soft_max = 4;- Parameters:
value- The costPerKilometerBelowSoftMax to set.- Returns:
- This builder for chaining.
-
clearCostPerKilometerBelowSoftMax
Cost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.
optional double cost_per_kilometer_below_soft_max = 4;- Returns:
- This builder for chaining.
-
hasCostPerKilometerAboveSoftMax
public boolean hasCostPerKilometerAboveSoftMax()Cost per kilometer incurred if distance is above `soft_max_meters` limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: ``` (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. ``` The cost must be nonnegative.
optional double cost_per_kilometer_above_soft_max = 3;- Specified by:
hasCostPerKilometerAboveSoftMaxin interfaceDistanceLimitOrBuilder- Returns:
- Whether the costPerKilometerAboveSoftMax field is set.
-
getCostPerKilometerAboveSoftMax
public double getCostPerKilometerAboveSoftMax()Cost per kilometer incurred if distance is above `soft_max_meters` limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: ``` (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. ``` The cost must be nonnegative.
optional double cost_per_kilometer_above_soft_max = 3;- Specified by:
getCostPerKilometerAboveSoftMaxin interfaceDistanceLimitOrBuilder- Returns:
- The costPerKilometerAboveSoftMax.
-
setCostPerKilometerAboveSoftMax
Cost per kilometer incurred if distance is above `soft_max_meters` limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: ``` (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. ``` The cost must be nonnegative.
optional double cost_per_kilometer_above_soft_max = 3;- Parameters:
value- The costPerKilometerAboveSoftMax to set.- Returns:
- This builder for chaining.
-
clearCostPerKilometerAboveSoftMax
Cost per kilometer incurred if distance is above `soft_max_meters` limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: ``` (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. ``` The cost must be nonnegative.
optional double cost_per_kilometer_above_soft_max = 3;- Returns:
- This builder for chaining.
-