# Interface ShipmentRoute.VisitOrBuilder (1.91.0)

1.91.0 (latest) 1.89.0 1.86.0 1.85.0 1.83.0 1.81.0 1.80.0 1.78.0 1.76.0 1.74.0 1.73.0 1.72.0 1.71.0 1.70.0 1.68.0 1.66.0 1.65.0 1.62.0 1.61.0 1.60.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.10.0 1.9.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.14 0.1.2

    public static interface ShipmentRoute.VisitOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### containsLoadDemands(String key)

    public abstract boolean containsLoadDemands(String key)

Total visit load demand as the sum of the shipment and the visit request
`load_demands`. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getArrivalLoads(int index) (deprecated)

    public abstract CapacityQuantity getArrivalLoads(int index)

Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
`start_load_intervals`, `end_load_intervals` or `demands`.

Exception: we omit loads for quantity types unconstrained by intervals
and that don't have any non-zero demand on the route.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantity` |   |

### getArrivalLoadsCount() (deprecated)

    public abstract int getArrivalLoadsCount()

Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
`start_load_intervals`, `end_load_intervals` or `demands`.

Exception: we omit loads for quantity types unconstrained by intervals
and that don't have any non-zero demand on the route.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getArrivalLoadsList() (deprecated)

    public abstract List<CapacityQuantity> getArrivalLoadsList()

Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
`start_load_intervals`, `end_load_intervals` or `demands`.

Exception: we omit loads for quantity types unconstrained by intervals
and that don't have any non-zero demand on the route.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantity>` |   |

### getArrivalLoadsOrBuilder(int index) (deprecated)

    public abstract CapacityQuantityOrBuilder getArrivalLoadsOrBuilder(int index)

Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
`start_load_intervals`, `end_load_intervals` or `demands`.

Exception: we omit loads for quantity types unconstrained by intervals
and that don't have any non-zero demand on the route.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantityOrBuilder` |   |

### getArrivalLoadsOrBuilderList() (deprecated)

    public abstract List<? extends CapacityQuantityOrBuilder> getArrivalLoadsOrBuilderList()

Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
`start_load_intervals`, `end_load_intervals` or `demands`.

Exception: we omit loads for quantity types unconstrained by intervals
and that don't have any non-zero demand on the route.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.optimization.v1.CapacityQuantityOrBuilder>` |   |

### getDelayBeforeStart() (deprecated)

    public abstract ShipmentRoute.Delay getDelayBeforeStart()

**Deprecated.** *google.cloud.optimization.v1.ShipmentRoute.Visit.delay_before_start is
deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=1965*

Deprecated: Use
ShipmentRoute.Transition.delay_duration
instead. Delay occurring before the visit starts.

`
.google.cloud.optimization.v1.ShipmentRoute.Delay delay_before_start = 10 [deprecated = true];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.ShipmentRoute.Delay` | The delayBeforeStart. |

### getDelayBeforeStartOrBuilder() (deprecated)

    public abstract ShipmentRoute.DelayOrBuilder getDelayBeforeStartOrBuilder()

Deprecated: Use
ShipmentRoute.Transition.delay_duration
instead. Delay occurring before the visit starts.

`
.google.cloud.optimization.v1.ShipmentRoute.Delay delay_before_start = 10 [deprecated = true];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.ShipmentRoute.DelayOrBuilder` |   |

### getDemands(int index) (deprecated)

    public abstract CapacityQuantity getDemands(int index)

Deprecated: Use
Visit.load_demands
instead.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantity` |   |

### getDemandsCount() (deprecated)

    public abstract int getDemandsCount()

Deprecated: Use
Visit.load_demands
instead.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getDemandsList() (deprecated)

    public abstract List<CapacityQuantity> getDemandsList()

Deprecated: Use
Visit.load_demands
instead.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantity>` |   |

### getDemandsOrBuilder(int index) (deprecated)

    public abstract CapacityQuantityOrBuilder getDemandsOrBuilder(int index)

Deprecated: Use
Visit.load_demands
instead.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.CapacityQuantityOrBuilder` |   |

### getDemandsOrBuilderList() (deprecated)

    public abstract List<? extends CapacityQuantityOrBuilder> getDemandsOrBuilderList()

Deprecated: Use
Visit.load_demands
instead.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.optimization.v1.CapacityQuantityOrBuilder>` |   |

### getDetour()

    public abstract Duration getDetour()

Extra detour time due to the shipments visited on the route before the
visit and to the potential waiting time induced by time windows.
If the visit is a delivery, the detour is computed from the corresponding
pickup visit and is equal to:
\``` `
start_time(delivery) - start_time(pickup)` ``

`` `
` ``

`` `

- (duration(pickup) + travel duration from the pickup location
to the delivery location).

` ``

`
Otherwise, it is computed from the vehicle `start_location` and is equal
to:
``` `
start_time - vehicle_start_time - travel duration from
the vehicle's `start_location` to the visit.
` ``\`

`.google.protobuf.Duration detour = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Duration.html` | The detour. |

### getDetourOrBuilder()

    public abstract DurationOrBuilder getDetourOrBuilder()

Extra detour time due to the shipments visited on the route before the
visit and to the potential waiting time induced by time windows.
If the visit is a delivery, the detour is computed from the corresponding
pickup visit and is equal to:
\``` `
start_time(delivery) - start_time(pickup)` ``

`` `
` ``

`` `

- (duration(pickup) + travel duration from the pickup location
to the delivery location).

` ``

`
Otherwise, it is computed from the vehicle `start_location` and is equal
to:
``` `
start_time - vehicle_start_time - travel duration from
the vehicle's `start_location` to the visit.
` ``\`

`.google.protobuf.Duration detour = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.DurationOrBuilder.html` |   |

### getIsPickup()

    public abstract boolean getIsPickup()

If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
corresponds to a delivery.

`bool is_pickup = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The isPickup. |

### getLoadDemands() (deprecated)

    public abstract Map<String,Shipment.Load> getLoadDemands()

Use [#getLoadDemandsMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.ShipmentRoute.VisitOrBuilder#com_google_cloud_optimization_v1_ShipmentRoute_VisitOrBuilder_getLoadDemandsMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load>` |   |

### getLoadDemandsCount()

    public abstract int getLoadDemandsCount()

Total visit load demand as the sum of the shipment and the visit request
`load_demands`. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getLoadDemandsMap()

    public abstract Map<String,Shipment.Load> getLoadDemandsMap()

Total visit load demand as the sum of the shipment and the visit request
`load_demands`. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load>` |   |

### getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

    public abstract Shipment.Load getLoadDemandsOrDefault(String key, Shipment.Load defaultValue)

Total visit load demand as the sum of the shipment and the visit request
`load_demands`. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load` |   |

### getLoadDemandsOrThrow(String key)

    public abstract Shipment.Load getLoadDemandsOrThrow(String key)

Total visit load demand as the sum of the shipment and the visit request
`load_demands`. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.Shipment.Load` |   |

### getShipmentIndex()

    public abstract int getShipmentIndex()

Index of the `shipments` field in the source
ShipmentModel.

`int32 shipment_index = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The shipmentIndex. |

### getShipmentLabel()

    public abstract String getShipmentLabel()

Copy of the corresponding `Shipment.label`, if specified in the
`Shipment`.

`string shipment_label = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The shipmentLabel. |

### getShipmentLabelBytes()

    public abstract ByteString getShipmentLabelBytes()

Copy of the corresponding `Shipment.label`, if specified in the
`Shipment`.

`string shipment_label = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for shipmentLabel. |

### getStartTime()

    public abstract Timestamp getStartTime()

Time at which the visit starts. Note that the vehicle may arrive earlier
than this at the visit location. Times are consistent with the
`ShipmentModel`.

`.google.protobuf.Timestamp start_time = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The startTime. |

### getStartTimeOrBuilder()

    public abstract TimestampOrBuilder getStartTimeOrBuilder()

Time at which the visit starts. Note that the vehicle may arrive earlier
than this at the visit location. Times are consistent with the
`ShipmentModel`.

`.google.protobuf.Timestamp start_time = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getVisitLabel()

    public abstract String getVisitLabel()

Copy of the corresponding
VisitRequest.label,
if specified in the `VisitRequest`.

`string visit_label = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The visitLabel. |

### getVisitLabelBytes()

    public abstract ByteString getVisitLabelBytes()

Copy of the corresponding
VisitRequest.label,
if specified in the `VisitRequest`.

`string visit_label = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for visitLabel. |

### getVisitRequestIndex()

    public abstract int getVisitRequestIndex()

Index of `VisitRequest` in either the pickup or delivery field of the
`Shipment` (see `is_pickup`).

`int32 visit_request_index = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The visitRequestIndex. |

### hasDelayBeforeStart() (deprecated)

    public abstract boolean hasDelayBeforeStart()

**Deprecated.** *google.cloud.optimization.v1.ShipmentRoute.Visit.delay_before_start is
deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=1965*

Deprecated: Use
ShipmentRoute.Transition.delay_duration
instead. Delay occurring before the visit starts.

`
.google.cloud.optimization.v1.ShipmentRoute.Delay delay_before_start = 10 [deprecated = true];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the delayBeforeStart field is set. |

### hasDetour()

    public abstract boolean hasDetour()

Extra detour time due to the shipments visited on the route before the
visit and to the potential waiting time induced by time windows.
If the visit is a delivery, the detour is computed from the corresponding
pickup visit and is equal to:
\``` `
start_time(delivery) - start_time(pickup)` ``

`` `
` ``

`` `

- (duration(pickup) + travel duration from the pickup location
to the delivery location).

` ``

`
Otherwise, it is computed from the vehicle `start_location` and is equal
to:
``` `
start_time - vehicle_start_time - travel duration from
the vehicle's `start_location` to the visit.
` ``\`

`.google.protobuf.Duration detour = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the detour field is set. |

### hasStartTime()

    public abstract boolean hasStartTime()

Time at which the visit starts. Note that the vehicle may arrive earlier
than this at the visit location. Times are consistent with the
`ShipmentModel`.

`.google.protobuf.Timestamp start_time = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the startTime field is set. |