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.GeneratedMessageV3.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.GeneratedMessageV3.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 typegoogle.cloud.optimization.v1.DistanceLimit
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DistanceLimit.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)DistanceLimitbuild()DistanceLimitbuildPartial()DistanceLimit.Builderclear()DistanceLimit.BuilderclearCostPerKilometerAboveSoftMax()Cost per kilometer incurred if distance is above `soft_max_meters` limit.DistanceLimit.BuilderclearCostPerKilometerBelowSoftMax()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.DistanceLimit.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)DistanceLimit.BuilderclearMaxMeters()A hard limit constraining the distance to be at most max_meters.DistanceLimit.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)DistanceLimit.BuilderclearSoftMaxMeters()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.DistanceLimit.Builderclone()doublegetCostPerKilometerAboveSoftMax()Cost per kilometer incurred if distance is above `soft_max_meters` limit.doublegetCostPerKilometerBelowSoftMax()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.DistanceLimitgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()longgetMaxMeters()A hard limit constraining the distance to be at most max_meters.longgetSoftMaxMeters()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.booleanhasCostPerKilometerAboveSoftMax()Cost per kilometer incurred if distance is above `soft_max_meters` limit.booleanhasCostPerKilometerBelowSoftMax()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.booleanhasMaxMeters()A hard limit constraining the distance to be at most max_meters.booleanhasSoftMaxMeters()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.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()DistanceLimit.BuildermergeFrom(DistanceLimit other)DistanceLimit.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)DistanceLimit.BuildermergeFrom(com.google.protobuf.Message other)DistanceLimit.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)DistanceLimit.BuildersetCostPerKilometerAboveSoftMax(double value)Cost per kilometer incurred if distance is above `soft_max_meters` limit.DistanceLimit.BuildersetCostPerKilometerBelowSoftMax(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.DistanceLimit.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)DistanceLimit.BuildersetMaxMeters(long value)A hard limit constraining the distance to be at most max_meters.DistanceLimit.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)DistanceLimit.BuildersetSoftMaxMeters(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.DistanceLimit.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
clear
public DistanceLimit.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
getDefaultInstanceForType
public DistanceLimit getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public DistanceLimit build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public DistanceLimit buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public DistanceLimit.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
setField
public DistanceLimit.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
clearField
public DistanceLimit.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
clearOneof
public DistanceLimit.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
setRepeatedField
public DistanceLimit.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
addRepeatedField
public DistanceLimit.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
mergeFrom
public DistanceLimit.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<DistanceLimit.Builder>
-
mergeFrom
public DistanceLimit.Builder mergeFrom(DistanceLimit other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.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
public DistanceLimit.Builder setMaxMeters(long value)
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
public DistanceLimit.Builder 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
public DistanceLimit.Builder 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. 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
public DistanceLimit.Builder 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
public DistanceLimit.Builder 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`.
optional double cost_per_kilometer_below_soft_max = 4;- Parameters:
value- The costPerKilometerBelowSoftMax to set.- Returns:
- This builder for chaining.
-
clearCostPerKilometerBelowSoftMax
public DistanceLimit.Builder 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
public DistanceLimit.Builder setCostPerKilometerAboveSoftMax(double value)
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
public DistanceLimit.Builder 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.
-
setUnknownFields
public final DistanceLimit.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
mergeUnknownFields
public final DistanceLimit.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<DistanceLimit.Builder>
-
-