Class ShipmentModel.BreakRule.FrequencyConstraint.Builder (1.34.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

build()

public ShipmentModel.BreakRule.FrequencyConstraint build()
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint

buildPartial()

public ShipmentModel.BreakRule.FrequencyConstraint buildPartial()
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint

clear()

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clear()
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

clone()

public ShipmentModel.BreakRule.FrequencyConstraint.Builder clone()
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

getDefaultInstanceForType()

public ShipmentModel.BreakRule.FrequencyConstraint getDefaultInstanceForType()
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the minBreakDuration field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(ShipmentModel.BreakRule.FrequencyConstraint other)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(ShipmentModel.BreakRule.FrequencyConstraint other)
Parameter
NameDescription
otherShipmentModel.BreakRule.FrequencyConstraint
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueDuration
Returns
TypeDescription
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
NameDescription
valueDuration
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public ShipmentModel.BreakRule.FrequencyConstraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueDuration
Returns
TypeDescription
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
NameDescription
builderForValueBuilder
Returns
TypeDescription
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
NameDescription
valueDuration
Returns
TypeDescription
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
NameDescription
builderForValueBuilder
Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final ShipmentModel.BreakRule.FrequencyConstraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ShipmentModel.BreakRule.FrequencyConstraint.Builder
Overrides