Class ShipmentRoute.TravelStep.Builder (1.20.0)

publicstaticfinalclass ShipmentRoute.TravelStep.BuilderextendsGeneratedMessageV3.Builder<ShipmentRoute.TravelStep.Builder>implementsShipmentRoute.TravelStepOrBuilder

Deprecated: Use ShipmentRoute.Transition instead. Travel between each visit along the route: from the vehicle's start_location to the first visit's arrival_location, then from the first visit's departure_location to the second visit's arrival_location, and so on until the vehicle's end_location. This accounts only for the actual travel between visits, not counting the waiting time, the time spent performing a visit, nor the distance covered during a visit.

Invariant: travel_steps_size() == visits_size() + 1.

If the vehicle does not have a start_ and/or end_location, the corresponding travel metrics are 0 and/or empty.

Protobuf type google.cloud.optimization.v1.ShipmentRoute.TravelStep

Inherited Members

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

publicShipmentRoute.TravelStep.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

build()

publicShipmentRoute.TravelStepbuild()
Returns
Type Description
ShipmentRoute.TravelStep

buildPartial()

publicShipmentRoute.TravelStepbuildPartial()
Returns
Type Description
ShipmentRoute.TravelStep

clear()

publicShipmentRoute.TravelStep.Builderclear()
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

clearDistanceMeters()

publicShipmentRoute.TravelStep.BuilderclearDistanceMeters()

Distance traveled during the step.

double distance_meters = 2;

Returns
Type Description
ShipmentRoute.TravelStep.Builder

This builder for chaining.

clearDuration()

publicShipmentRoute.TravelStep.BuilderclearDuration()

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Returns
Type Description
ShipmentRoute.TravelStep.Builder

clearField(Descriptors.FieldDescriptor field)

publicShipmentRoute.TravelStep.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicShipmentRoute.TravelStep.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

clearRoutePolyline()

publicShipmentRoute.TravelStep.BuilderclearRoutePolyline()

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Returns
Type Description
ShipmentRoute.TravelStep.Builder

clearTrafficInfoUnavailable()

publicShipmentRoute.TravelStep.BuilderclearTrafficInfoUnavailable()

When traffic is requested via OptimizeToursRequest.consider_road_traffic, and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).

bool traffic_info_unavailable = 3;

Returns
Type Description
ShipmentRoute.TravelStep.Builder

This builder for chaining.

clone()

publicShipmentRoute.TravelStep.Builderclone()
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

getDefaultInstanceForType()

publicShipmentRoute.TravelStepgetDefaultInstanceForType()
Returns
Type Description
ShipmentRoute.TravelStep

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDistanceMeters()

publicdoublegetDistanceMeters()

Distance traveled during the step.

double distance_meters = 2;

Returns
Type Description
double

The distanceMeters.

getDuration()

publicDurationgetDuration()

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Returns
Type Description
Duration

The duration.

getDurationBuilder()

publicDuration.BuildergetDurationBuilder()

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Returns
Type Description
Builder

getDurationOrBuilder()

publicDurationOrBuildergetDurationOrBuilder()

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Returns
Type Description
DurationOrBuilder

getRoutePolyline()

publicShipmentRoute.EncodedPolylinegetRoutePolyline()

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Returns
Type Description
ShipmentRoute.EncodedPolyline

The routePolyline.

getRoutePolylineBuilder()

publicShipmentRoute.EncodedPolyline.BuildergetRoutePolylineBuilder()

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Returns
Type Description
ShipmentRoute.EncodedPolyline.Builder

getRoutePolylineOrBuilder()

publicShipmentRoute.EncodedPolylineOrBuildergetRoutePolylineOrBuilder()

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Returns
Type Description
ShipmentRoute.EncodedPolylineOrBuilder

getTrafficInfoUnavailable()

publicbooleangetTrafficInfoUnavailable()

When traffic is requested via OptimizeToursRequest.consider_road_traffic, and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).

bool traffic_info_unavailable = 3;

Returns
Type Description
boolean

The trafficInfoUnavailable.

hasDuration()

publicbooleanhasDuration()

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Returns
Type Description
boolean

Whether the duration field is set.

hasRoutePolyline()

publicbooleanhasRoutePolyline()

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Returns
Type Description
boolean

Whether the routePolyline field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeDuration(Duration value)

publicShipmentRoute.TravelStep.BuildermergeDuration(Durationvalue)

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentRoute.TravelStep.Builder

mergeFrom(ShipmentRoute.TravelStep other)

publicShipmentRoute.TravelStep.BuildermergeFrom(ShipmentRoute.TravelStepother)
Parameter
Name Description
other ShipmentRoute.TravelStep
Returns
Type Description
ShipmentRoute.TravelStep.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicShipmentRoute.TravelStep.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicShipmentRoute.TravelStep.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

mergeRoutePolyline(ShipmentRoute.EncodedPolyline value)

publicShipmentRoute.TravelStep.BuildermergeRoutePolyline(ShipmentRoute.EncodedPolylinevalue)

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Parameter
Name Description
value ShipmentRoute.EncodedPolyline
Returns
Type Description
ShipmentRoute.TravelStep.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalShipmentRoute.TravelStep.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

setDistanceMeters(double value)

publicShipmentRoute.TravelStep.BuildersetDistanceMeters(doublevalue)

Distance traveled during the step.

double distance_meters = 2;

Parameter
Name Description
value double

The distanceMeters to set.

Returns
Type Description
ShipmentRoute.TravelStep.Builder

This builder for chaining.

setDuration(Duration value)

publicShipmentRoute.TravelStep.BuildersetDuration(Durationvalue)

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Parameter
Name Description
value Duration
Returns
Type Description
ShipmentRoute.TravelStep.Builder

setDuration(Duration.Builder builderForValue)

publicShipmentRoute.TravelStep.BuildersetDuration(Duration.BuilderbuilderForValue)

Duration of the travel step.

.google.protobuf.Duration duration = 1;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
ShipmentRoute.TravelStep.Builder

setField(Descriptors.FieldDescriptor field, Object value)

publicShipmentRoute.TravelStep.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

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

publicShipmentRoute.TravelStep.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ShipmentRoute.TravelStep.Builder
Overrides

setRoutePolyline(ShipmentRoute.EncodedPolyline value)

publicShipmentRoute.TravelStep.BuildersetRoutePolyline(ShipmentRoute.EncodedPolylinevalue)

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Parameter
Name Description
value ShipmentRoute.EncodedPolyline
Returns
Type Description
ShipmentRoute.TravelStep.Builder

setRoutePolyline(ShipmentRoute.EncodedPolyline.Builder builderForValue)

publicShipmentRoute.TravelStep.BuildersetRoutePolyline(ShipmentRoute.EncodedPolyline.BuilderbuilderForValue)

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

.google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 4;

Parameter
Name Description
builderForValue ShipmentRoute.EncodedPolyline.Builder
Returns
Type Description
ShipmentRoute.TravelStep.Builder

setTrafficInfoUnavailable(boolean value)

publicShipmentRoute.TravelStep.BuildersetTrafficInfoUnavailable(booleanvalue)

When traffic is requested via OptimizeToursRequest.consider_road_traffic, and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).

bool traffic_info_unavailable = 3;

Parameter
Name Description
value boolean

The trafficInfoUnavailable to set.

Returns
Type Description
ShipmentRoute.TravelStep.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalShipmentRoute.TravelStep.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ShipmentRoute.TravelStep.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.