Class ShipmentModel.BreakRule.FrequencyConstraint.Builder (1.49.0)

public static final class ShipmentModel.BreakRule.FrequencyConstraint.Builder extends GeneratedMessageV3.Builder<ShipmentModel.BreakRule.FrequencyConstraint.Builder> implements ShipmentModel.BreakRule.FrequencyConstraintOrBuilder

One may further constrain the frequency and duration of the breaks specified above, by enforcing a minimum break frequency, such as "There must be a break of at least 1 hour every 12 hours". Assuming that this can be interpreted as "Within any sliding time window of 12h, there must be at least one break of at least one hour", that example would translate to the following FrequencyConstraint: ` { min_break_duration { seconds: 3600 } # 1 hour. max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11). }

The timing and duration of the breaks in the solution will respect all such constraints, in addition to the time windows and minimum durations already specified in the BreakRequest.

A FrequencyConstraint may in practice apply to non-consecutive breaks. For example, the following schedule honors the "1h every 12h" example: 04:00 vehicle start .. performing travel and visits .. 09:00 1 hour break 10:00 end of the break .. performing travel and visits .. 12:00 20-min lunch break 12:20 end of the break .. performing travel and visits .. 21:00 1 hour break 22:00 end of the break .. performing travel and visits .. 23:59 vehicle end `

Protobuf type google.cloud.optimization.v1.ShipmentModel.BreakRule.FrequencyConstraint

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

build()

public ShipmentModel.BreakRule.FrequencyConstraint build()
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint

buildPartial()

public ShipmentModel.BreakRule.FrequencyConstraint buildPartial()
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint

clear()

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clear()
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

clearMaxInterBreakDuration()

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearMaxInterBreakDuration()

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

clearMinBreakDuration()

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearMinBreakDuration()

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

clone()

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clone()
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

getDefaultInstanceForType()

public ShipmentModel.BreakRule.FrequencyConstraint getDefaultInstanceForType()
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMaxInterBreakDuration()

public Duration getMaxInterBreakDuration()

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Duration

The maxInterBreakDuration.

getMaxInterBreakDurationBuilder()

public Duration.Builder getMaxInterBreakDurationBuilder()

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Builder

getMaxInterBreakDurationOrBuilder()

public DurationOrBuilder getMaxInterBreakDurationOrBuilder()

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
DurationOrBuilder

getMinBreakDuration()

public Duration getMinBreakDuration()

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Duration

The minBreakDuration.

getMinBreakDurationBuilder()

public Duration.Builder getMinBreakDurationBuilder()

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Builder

getMinBreakDurationOrBuilder()

public DurationOrBuilder getMinBreakDurationOrBuilder()

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
DurationOrBuilder

hasMaxInterBreakDuration()

public boolean hasMaxInterBreakDuration()

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the maxInterBreakDuration field is set.

hasMinBreakDuration()

public boolean hasMinBreakDuration()

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the minBreakDuration field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ShipmentModel.BreakRule.FrequencyConstraint other)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(ShipmentModel.BreakRule.FrequencyConstraint other)
Parameter
Name Description
other ShipmentModel.BreakRule.FrequencyConstraint
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

mergeMaxInterBreakDuration(Duration value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeMaxInterBreakDuration(Duration value)

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

mergeMinBreakDuration(Duration value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeMinBreakDuration(Duration value)

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

setMaxInterBreakDuration(Duration value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setMaxInterBreakDuration(Duration value)

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

setMaxInterBreakDuration(Duration.Builder builderForValue)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setMaxInterBreakDuration(Duration.Builder builderForValue)

Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of duration >= min_break_duration. Must be positive.

.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

setMinBreakDuration(Duration value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setMinBreakDuration(Duration value)

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

setMinBreakDuration(Duration.Builder builderForValue)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setMinBreakDuration(Duration.Builder builderForValue)

Required. Minimum break duration for this constraint. Nonnegative. See description of FrequencyConstraint.

.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder

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

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final ShipmentModel.BreakRule.FrequencyConstraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides