Class Shipment.VisitRequest (1.1.14)

publicstaticfinalclass Shipment.VisitRequestextendsGeneratedMessageV3implementsShipment.VisitRequestOrBuilder

Request for a visit which can be done by a vehicle: it has a geo-location (or two, see below), opening and closing times represented by time windows, and a service duration time (time spent by the vehicle once it has arrived to pickup or drop off goods).

Protobuf type google.cloud.optimization.v1.Shipment.VisitRequest

Inherited Members

Static Fields

ARRIVAL_LOCATION_FIELD_NUMBER

publicstaticfinalintARRIVAL_LOCATION_FIELD_NUMBER
Field Value
Type Description
int

ARRIVAL_WAYPOINT_FIELD_NUMBER

publicstaticfinalintARRIVAL_WAYPOINT_FIELD_NUMBER
Field Value
Type Description
int

COST_FIELD_NUMBER

publicstaticfinalintCOST_FIELD_NUMBER
Field Value
Type Description
int

DEMANDS_FIELD_NUMBER

publicstaticfinalintDEMANDS_FIELD_NUMBER
Field Value
Type Description
int

DEPARTURE_LOCATION_FIELD_NUMBER

publicstaticfinalintDEPARTURE_LOCATION_FIELD_NUMBER
Field Value
Type Description
int

DEPARTURE_WAYPOINT_FIELD_NUMBER

publicstaticfinalintDEPARTURE_WAYPOINT_FIELD_NUMBER
Field Value
Type Description
int

DURATION_FIELD_NUMBER

publicstaticfinalintDURATION_FIELD_NUMBER
Field Value
Type Description
int

LABEL_FIELD_NUMBER

publicstaticfinalintLABEL_FIELD_NUMBER
Field Value
Type Description
int

LOAD_DEMANDS_FIELD_NUMBER

publicstaticfinalintLOAD_DEMANDS_FIELD_NUMBER
Field Value
Type Description
int

TAGS_FIELD_NUMBER

publicstaticfinalintTAGS_FIELD_NUMBER
Field Value
Type Description
int

TIME_WINDOWS_FIELD_NUMBER

publicstaticfinalintTIME_WINDOWS_FIELD_NUMBER
Field Value
Type Description
int

VISIT_TYPES_FIELD_NUMBER

publicstaticfinalintVISIT_TYPES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticShipment.VisitRequestgetDefaultInstance()
Returns
Type Description

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

newBuilder()

publicstaticShipment.VisitRequest.BuildernewBuilder()
Returns
Type Description

newBuilder(Shipment.VisitRequest prototype)

publicstaticShipment.VisitRequest.BuildernewBuilder(Shipment.VisitRequestprototype)
Parameter
Name Description
Returns
Type Description

parseDelimitedFrom(InputStream input)

publicstaticShipment.VisitRequestparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticShipment.VisitRequestparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data)

publicstaticShipment.VisitRequestparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticShipment.VisitRequestparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data)

publicstaticShipment.VisitRequestparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticShipment.VisitRequestparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input)

publicstaticShipment.VisitRequestparseFrom(CodedInputStreaminput)
Parameter
Name Description
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticShipment.VisitRequestparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input)

publicstaticShipment.VisitRequestparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticShipment.VisitRequestparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data)

publicstaticShipment.VisitRequestparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticShipment.VisitRequestparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parser()

publicstaticParser<Shipment.VisitRequest>parser()
Returns
Type Description

Methods

containsLoadDemands(String key)

publicbooleancontainsLoadDemands(Stringkey)

Load demands of this visit request. This is just like Shipment.load_demands field, except that it only applies to this VisitRequest instead of the whole Shipment. The demands listed here are added to the demands listed in Shipment.load_demands.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 12;

Parameter
Name Description
key String
Returns
Type Description

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
Overrides

getArrivalLocation()

publicLatLnggetArrivalLocation()

The geo-location where the vehicle arrives when performing this VisitRequest. If the shipment model has duration distance matrices, arrival_location must not be specified.

.google.type.LatLng arrival_location = 1;

Returns
Type Description
com.google.type.LatLng

The arrivalLocation.

getArrivalLocationOrBuilder()

publicLatLngOrBuildergetArrivalLocationOrBuilder()

The geo-location where the vehicle arrives when performing this VisitRequest. If the shipment model has duration distance matrices, arrival_location must not be specified.

.google.type.LatLng arrival_location = 1;

Returns
Type Description
com.google.type.LatLngOrBuilder

getArrivalWaypoint()

publicWaypointgetArrivalWaypoint()

The waypoint where the vehicle arrives when performing this VisitRequest. If the shipment model has duration distance matrices, arrival_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint arrival_waypoint = 2;

Returns
Type Description
Waypoint

The arrivalWaypoint.

getArrivalWaypointOrBuilder()

publicWaypointOrBuildergetArrivalWaypointOrBuilder()

The waypoint where the vehicle arrives when performing this VisitRequest. If the shipment model has duration distance matrices, arrival_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint arrival_waypoint = 2;

Returns
Type Description

getCost()

publicdoublegetCost()

Cost to service this visit request on a vehicle route. This can be used to pay different costs for each alternative pickup or delivery of a shipment. This cost must be in the same unit as Shipment.penalty_cost and must not be negative.

double cost = 8;

Returns
Type Description
double

The cost.

getDefaultInstanceForType()

publicShipment.VisitRequestgetDefaultInstanceForType()
Returns
Type Description

getDemands(int index)

publicCapacityQuantitygetDemands(intindex)

Deprecated: Use [VisitRequest.load_demands][] instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 9 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description

getDemandsCount()

publicintgetDemandsCount()

Deprecated: Use [VisitRequest.load_demands][] instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 9 [deprecated = true];

Returns
Type Description
int

getDemandsList()

publicList<CapacityQuantity>getDemandsList()

Deprecated: Use [VisitRequest.load_demands][] instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 9 [deprecated = true];

Returns
Type Description

getDemandsOrBuilder(int index)

publicCapacityQuantityOrBuildergetDemandsOrBuilder(intindex)

Deprecated: Use [VisitRequest.load_demands][] instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 9 [deprecated = true];

Parameter
Name Description
index int
Returns
Type Description

getDemandsOrBuilderList()

publicList<?extendsCapacityQuantityOrBuilder>getDemandsOrBuilderList()

Deprecated: Use [VisitRequest.load_demands][] instead.

repeated .google.cloud.optimization.v1.CapacityQuantity demands = 9 [deprecated = true];

Returns
Type Description
List<? extends com.google.cloud.optimization.v1.CapacityQuantityOrBuilder>

getDepartureLocation()

publicLatLnggetDepartureLocation()

The geo-location where the vehicle departs after completing this VisitRequest. Can be omitted if it is the same as arrival_location. If the shipment model has duration distance matrices, departure_location must not be specified.

.google.type.LatLng departure_location = 3;

Returns
Type Description
com.google.type.LatLng

The departureLocation.

getDepartureLocationOrBuilder()

publicLatLngOrBuildergetDepartureLocationOrBuilder()

The geo-location where the vehicle departs after completing this VisitRequest. Can be omitted if it is the same as arrival_location. If the shipment model has duration distance matrices, departure_location must not be specified.

.google.type.LatLng departure_location = 3;

Returns
Type Description
com.google.type.LatLngOrBuilder

getDepartureWaypoint()

publicWaypointgetDepartureWaypoint()

The waypoint where the vehicle departs after completing this VisitRequest. Can be omitted if it is the same as arrival_waypoint. If the shipment model has duration distance matrices, departure_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint departure_waypoint = 4;

Returns
Type Description
Waypoint

The departureWaypoint.

getDepartureWaypointOrBuilder()

publicWaypointOrBuildergetDepartureWaypointOrBuilder()

The waypoint where the vehicle departs after completing this VisitRequest. Can be omitted if it is the same as arrival_waypoint. If the shipment model has duration distance matrices, departure_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint departure_waypoint = 4;

Returns
Type Description

getDuration()

publicDurationgetDuration()

Duration of the visit, i.e. time spent by the vehicle between arrival and departure (to be added to the possible waiting time; see time_windows).

.google.protobuf.Duration duration = 7;

Returns
Type Description
Duration

The duration.

getDurationOrBuilder()

publicDurationOrBuildergetDurationOrBuilder()

Duration of the visit, i.e. time spent by the vehicle between arrival and departure (to be added to the possible waiting time; see time_windows).

.google.protobuf.Duration duration = 7;

Returns
Type Description

getLabel()

publicStringgetLabel()

Specifies a label for this VisitRequest. This label is reported in the response as visit_label in the corresponding ShipmentRoute.Visit.

string label = 11;

Returns
Type Description
String

The label.

getLabelBytes()

publicByteStringgetLabelBytes()

Specifies a label for this VisitRequest. This label is reported in the response as visit_label in the corresponding ShipmentRoute.Visit.

string label = 11;

Returns
Type Description
ByteString

The bytes for label.

getLoadDemands()

publicMap<String,Shipment.Load>getLoadDemands()

Use #getLoadDemandsMap() instead.

Returns
Type Description

getLoadDemandsCount()

publicintgetLoadDemandsCount()

Load demands of this visit request. This is just like Shipment.load_demands field, except that it only applies to this VisitRequest instead of the whole Shipment. The demands listed here are added to the demands listed in Shipment.load_demands.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 12;

Returns
Type Description
int

getLoadDemandsMap()

publicMap<String,Shipment.Load>getLoadDemandsMap()

Load demands of this visit request. This is just like Shipment.load_demands field, except that it only applies to this VisitRequest instead of the whole Shipment. The demands listed here are added to the demands listed in Shipment.load_demands.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 12;

Returns
Type Description

getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

publicShipment.LoadgetLoadDemandsOrDefault(Stringkey,Shipment.LoaddefaultValue)

Load demands of this visit request. This is just like Shipment.load_demands field, except that it only applies to this VisitRequest instead of the whole Shipment. The demands listed here are added to the demands listed in Shipment.load_demands.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 12;

Parameters
Name Description
key String
defaultValue Shipment.Load
Returns
Type Description

getLoadDemandsOrThrow(String key)

publicShipment.LoadgetLoadDemandsOrThrow(Stringkey)

Load demands of this visit request. This is just like Shipment.load_demands field, except that it only applies to this VisitRequest instead of the whole Shipment. The demands listed here are added to the demands listed in Shipment.load_demands.

map<string, .google.cloud.optimization.v1.Shipment.Load> load_demands = 12;

Parameter
Name Description
key String
Returns
Type Description

getParserForType()

publicParser<Shipment.VisitRequest>getParserForType()
Returns
Type Description
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getTags(int index)

publicStringgetTags(intindex)

Specifies tags attached to the visit request. Empty or duplicate strings are not allowed.

repeated string tags = 5;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The tags at the given index.

getTagsBytes(int index)

publicByteStringgetTagsBytes(intindex)

Specifies tags attached to the visit request. Empty or duplicate strings are not allowed.

repeated string tags = 5;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the tags at the given index.

getTagsCount()

publicintgetTagsCount()

Specifies tags attached to the visit request. Empty or duplicate strings are not allowed.

repeated string tags = 5;

Returns
Type Description
int

The count of tags.

getTagsList()

publicProtocolStringListgetTagsList()

Specifies tags attached to the visit request. Empty or duplicate strings are not allowed.

repeated string tags = 5;

Returns
Type Description
ProtocolStringList

A list containing the tags.

getTimeWindows(int index)

publicTimeWindowgetTimeWindows(intindex)

Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, i.e. arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before TimeWindow.start_time. The absence of TimeWindow means that the vehicle can perform this visit at any time. Time windows must be disjoint, i.e. no time window must overlap with or be adjacent to another, and they must be in increasing order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow time_windows = 6;

Parameter
Name Description
index int
Returns
Type Description

getTimeWindowsCount()

publicintgetTimeWindowsCount()

Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, i.e. arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before TimeWindow.start_time. The absence of TimeWindow means that the vehicle can perform this visit at any time. Time windows must be disjoint, i.e. no time window must overlap with or be adjacent to another, and they must be in increasing order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow time_windows = 6;

Returns
Type Description
int

getTimeWindowsList()

publicList<TimeWindow>getTimeWindowsList()

Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, i.e. arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before TimeWindow.start_time. The absence of TimeWindow means that the vehicle can perform this visit at any time. Time windows must be disjoint, i.e. no time window must overlap with or be adjacent to another, and they must be in increasing order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow time_windows = 6;

Returns
Type Description

getTimeWindowsOrBuilder(int index)

publicTimeWindowOrBuildergetTimeWindowsOrBuilder(intindex)

Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, i.e. arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before TimeWindow.start_time. The absence of TimeWindow means that the vehicle can perform this visit at any time. Time windows must be disjoint, i.e. no time window must overlap with or be adjacent to another, and they must be in increasing order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow time_windows = 6;

Parameter
Name Description
index int
Returns
Type Description

getTimeWindowsOrBuilderList()

publicList<?extendsTimeWindowOrBuilder>getTimeWindowsOrBuilderList()

Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, i.e. arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before TimeWindow.start_time. The absence of TimeWindow means that the vehicle can perform this visit at any time. Time windows must be disjoint, i.e. no time window must overlap with or be adjacent to another, and they must be in increasing order. cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

repeated .google.cloud.optimization.v1.TimeWindow time_windows = 6;

Returns
Type Description
List<? extends com.google.cloud.optimization.v1.TimeWindowOrBuilder>

getUnknownFields()

publicfinalUnknownFieldSetgetUnknownFields()
Returns
Type Description
Overrides

getVisitTypes(int index)

publicStringgetVisitTypes(intindex)

Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see Vehicle.extra_visit_duration_for_visit_type). A type can only appear once.

repeated string visit_types = 10;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The visitTypes at the given index.

getVisitTypesBytes(int index)

publicByteStringgetVisitTypesBytes(intindex)

Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see Vehicle.extra_visit_duration_for_visit_type). A type can only appear once.

repeated string visit_types = 10;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the visitTypes at the given index.

getVisitTypesCount()

publicintgetVisitTypesCount()

Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see Vehicle.extra_visit_duration_for_visit_type). A type can only appear once.

repeated string visit_types = 10;

Returns
Type Description
int

The count of visitTypes.

getVisitTypesList()

publicProtocolStringListgetVisitTypesList()

Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see Vehicle.extra_visit_duration_for_visit_type). A type can only appear once.

repeated string visit_types = 10;

Returns
Type Description
ProtocolStringList

A list containing the visitTypes.

hasArrivalLocation()

publicbooleanhasArrivalLocation()

The geo-location where the vehicle arrives when performing this VisitRequest. If the shipment model has duration distance matrices, arrival_location must not be specified.

.google.type.LatLng arrival_location = 1;

Returns
Type Description
boolean

Whether the arrivalLocation field is set.

hasArrivalWaypoint()

publicbooleanhasArrivalWaypoint()

The waypoint where the vehicle arrives when performing this VisitRequest. If the shipment model has duration distance matrices, arrival_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint arrival_waypoint = 2;

Returns
Type Description
boolean

Whether the arrivalWaypoint field is set.

hasDepartureLocation()

publicbooleanhasDepartureLocation()

The geo-location where the vehicle departs after completing this VisitRequest. Can be omitted if it is the same as arrival_location. If the shipment model has duration distance matrices, departure_location must not be specified.

.google.type.LatLng departure_location = 3;

Returns
Type Description
boolean

Whether the departureLocation field is set.

hasDepartureWaypoint()

publicbooleanhasDepartureWaypoint()

The waypoint where the vehicle departs after completing this VisitRequest. Can be omitted if it is the same as arrival_waypoint. If the shipment model has duration distance matrices, departure_waypoint must not be specified.

.google.cloud.optimization.v1.Waypoint departure_waypoint = 4;

Returns
Type Description
boolean

Whether the departureWaypoint field is set.

hasDuration()

publicbooleanhasDuration()

Duration of the visit, i.e. time spent by the vehicle between arrival and departure (to be added to the possible waiting time; see time_windows).

.google.protobuf.Duration duration = 7;

Returns
Type Description
boolean

Whether the duration field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

internalGetMapField(int number)

protectedMapFieldinternalGetMapField(intnumber)
Parameter
Name Description
number int
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

newBuilderForType()

publicShipment.VisitRequest.BuildernewBuilderForType()
Returns
Type Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedShipment.VisitRequest.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
Returns
Type Description
Overrides

toBuilder()

publicShipment.VisitRequest.BuildertoBuilder()
Returns
Type Description

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
Overrides Exceptions
Type Description

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.