Class ShipmentModel.PrecedenceRule.Builder (1.76.0)

publicstaticfinalclass ShipmentModel.PrecedenceRule.BuilderextendsGeneratedMessageV3.Builder<ShipmentModel.PrecedenceRule.Builder>implementsShipmentModel.PrecedenceRuleOrBuilder

A precedence rule between two events (each event is the pickup or the delivery of a shipment): the "second" event has to start at least offset_duration after "first" has started.

Several precedences can refer to the same (or related) events, e.g., "pickup of B happens after delivery of A" and "pickup of C happens after pickup of B".

Furthermore, precedences only apply when both shipments are performed and are otherwise ignored.

Protobuf type google.cloud.optimization.v1.ShipmentModel.PrecedenceRule

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
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
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicShipmentModel.PrecedenceRule.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

build()

publicShipmentModel.PrecedenceRulebuild()
Returns
Type Description
ShipmentModel.PrecedenceRule

buildPartial()

publicShipmentModel.PrecedenceRulebuildPartial()
Returns
Type Description
ShipmentModel.PrecedenceRule

clear()

publicShipmentModel.PrecedenceRule.Builderclear()
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

publicShipmentModel.PrecedenceRule.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

clearFirstIndex()

publicShipmentModel.PrecedenceRule.BuilderclearFirstIndex()

Shipment index of the "first" event. This field must be specified.

optional int32 first_index = 1;

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

clearFirstIsDelivery()

publicShipmentModel.PrecedenceRule.BuilderclearFirstIsDelivery()

Indicates if the "first" event is a delivery.

bool first_is_delivery = 3;

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

clearOffsetDuration()

publicShipmentModel.PrecedenceRule.BuilderclearOffsetDuration()

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

publicShipmentModel.PrecedenceRule.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

clearSecondIndex()

publicShipmentModel.PrecedenceRule.BuilderclearSecondIndex()

Shipment index of the "second" event. This field must be specified.

optional int32 second_index = 2;

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

clearSecondIsDelivery()

publicShipmentModel.PrecedenceRule.BuilderclearSecondIsDelivery()

Indicates if the "second" event is a delivery.

bool second_is_delivery = 4;

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

clone()

publicShipmentModel.PrecedenceRule.Builderclone()
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

getDefaultInstanceForType()

publicShipmentModel.PrecedenceRulegetDefaultInstanceForType()
Returns
Type Description
ShipmentModel.PrecedenceRule

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getFirstIndex()

publicintgetFirstIndex()

Shipment index of the "first" event. This field must be specified.

optional int32 first_index = 1;

Returns
Type Description
int

The firstIndex.

getFirstIsDelivery()

publicbooleangetFirstIsDelivery()

Indicates if the "first" event is a delivery.

bool first_is_delivery = 3;

Returns
Type Description
boolean

The firstIsDelivery.

getOffsetDuration()

publicDurationgetOffsetDuration()

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Returns
Type Description
Duration

The offsetDuration.

getOffsetDurationBuilder()

publicDuration.BuildergetOffsetDurationBuilder()

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Returns
Type Description
Builder

getOffsetDurationOrBuilder()

publicDurationOrBuildergetOffsetDurationOrBuilder()

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Returns
Type Description
DurationOrBuilder

getSecondIndex()

publicintgetSecondIndex()

Shipment index of the "second" event. This field must be specified.

optional int32 second_index = 2;

Returns
Type Description
int

The secondIndex.

getSecondIsDelivery()

publicbooleangetSecondIsDelivery()

Indicates if the "second" event is a delivery.

bool second_is_delivery = 4;

Returns
Type Description
boolean

The secondIsDelivery.

hasFirstIndex()

publicbooleanhasFirstIndex()

Shipment index of the "first" event. This field must be specified.

optional int32 first_index = 1;

Returns
Type Description
boolean

Whether the firstIndex field is set.

hasOffsetDuration()

publicbooleanhasOffsetDuration()

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Returns
Type Description
boolean

Whether the offsetDuration field is set.

hasSecondIndex()

publicbooleanhasSecondIndex()

Shipment index of the "second" event. This field must be specified.

optional int32 second_index = 2;

Returns
Type Description
boolean

Whether the secondIndex field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ShipmentModel.PrecedenceRule other)

publicShipmentModel.PrecedenceRule.BuildermergeFrom(ShipmentModel.PrecedenceRuleother)
Parameter
Name Description
other ShipmentModel.PrecedenceRule
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicShipmentModel.PrecedenceRule.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicShipmentModel.PrecedenceRule.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

mergeOffsetDuration(Duration value)

publicShipmentModel.PrecedenceRule.BuildermergeOffsetDuration(Durationvalue)

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalShipmentModel.PrecedenceRule.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

publicShipmentModel.PrecedenceRule.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

setFirstIndex(int value)

publicShipmentModel.PrecedenceRule.BuildersetFirstIndex(intvalue)

Shipment index of the "first" event. This field must be specified.

optional int32 first_index = 1;

Parameter
Name Description
value int

The firstIndex to set.

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

setFirstIsDelivery(boolean value)

publicShipmentModel.PrecedenceRule.BuildersetFirstIsDelivery(booleanvalue)

Indicates if the "first" event is a delivery.

bool first_is_delivery = 3;

Parameter
Name Description
value boolean

The firstIsDelivery to set.

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

setOffsetDuration(Duration value)

publicShipmentModel.PrecedenceRule.BuildersetOffsetDuration(Durationvalue)

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

setOffsetDuration(Duration.Builder builderForValue)

publicShipmentModel.PrecedenceRule.BuildersetOffsetDuration(Duration.BuilderbuilderForValue)

The offset between the "first" and "second" event. It can be negative.

.google.protobuf.Duration offset_duration = 5;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

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

publicShipmentModel.PrecedenceRule.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
Overrides

setSecondIndex(int value)

publicShipmentModel.PrecedenceRule.BuildersetSecondIndex(intvalue)

Shipment index of the "second" event. This field must be specified.

optional int32 second_index = 2;

Parameter
Name Description
value int

The secondIndex to set.

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

setSecondIsDelivery(boolean value)

publicShipmentModel.PrecedenceRule.BuildersetSecondIsDelivery(booleanvalue)

Indicates if the "second" event is a delivery.

bool second_is_delivery = 4;

Parameter
Name Description
value boolean

The secondIsDelivery to set.

Returns
Type Description
ShipmentModel.PrecedenceRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalShipmentModel.PrecedenceRule.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ShipmentModel.PrecedenceRule.Builder
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.