com.google.maps.routeoptimization.v1.Shipment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-maps-routeoptimization-v1 Show documentation
Show all versions of proto-google-maps-routeoptimization-v1 Show documentation
Proto library for google-maps-routeoptimization
The newest version!
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/maps/routeoptimization/v1/route_optimization_service.proto
// Protobuf Java Version: 3.25.5
package com.google.maps.routeoptimization.v1;
/**
*
*
*
* The shipment of a single item, from one of its pickups to one of its
* deliveries. For the shipment to be considered as performed, a unique vehicle
* must visit one of its pickup locations (and decrease its spare capacities
* accordingly), then visit one of its delivery locations later on (and
* therefore re-increase its spare capacities accordingly).
*
*
* Protobuf type {@code google.maps.routeoptimization.v1.Shipment}
*/
public final class Shipment extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Shipment)
ShipmentOrBuilder {
private static final long serialVersionUID = 0L;
// Use Shipment.newBuilder() to construct.
private Shipment(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Shipment() {
displayName_ = "";
pickups_ = java.util.Collections.emptyList();
deliveries_ = java.util.Collections.emptyList();
allowedVehicleIndices_ = emptyIntList();
costsPerVehicle_ = emptyDoubleList();
costsPerVehicleIndices_ = emptyIntList();
shipmentType_ = "";
label_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Shipment();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 14:
return internalGetLoadDemands();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.maps.routeoptimization.v1.Shipment.class,
com.google.maps.routeoptimization.v1.Shipment.Builder.class);
}
public interface VisitRequestOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Shipment.VisitRequest)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* 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;
*
* @return Whether the arrivalLocation field is set.
*/
boolean hasArrivalLocation();
/**
*
*
*
* 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;
*
* @return The arrivalLocation.
*/
com.google.type.LatLng getArrivalLocation();
/**
*
*
*
* 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;
*/
com.google.type.LatLngOrBuilder getArrivalLocationOrBuilder();
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*
* @return Whether the arrivalWaypoint field is set.
*/
boolean hasArrivalWaypoint();
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*
* @return The arrivalWaypoint.
*/
com.google.maps.routeoptimization.v1.Waypoint getArrivalWaypoint();
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
com.google.maps.routeoptimization.v1.WaypointOrBuilder getArrivalWaypointOrBuilder();
/**
*
*
*
* 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;
*
* @return Whether the departureLocation field is set.
*/
boolean hasDepartureLocation();
/**
*
*
*
* 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;
*
* @return The departureLocation.
*/
com.google.type.LatLng getDepartureLocation();
/**
*
*
*
* 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;
*/
com.google.type.LatLngOrBuilder getDepartureLocationOrBuilder();
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*
* @return Whether the departureWaypoint field is set.
*/
boolean hasDepartureWaypoint();
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*
* @return The departureWaypoint.
*/
com.google.maps.routeoptimization.v1.Waypoint getDepartureWaypoint();
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
com.google.maps.routeoptimization.v1.WaypointOrBuilder getDepartureWaypointOrBuilder();
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return A list containing the tags.
*/
java.util.List getTagsList();
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return The count of tags.
*/
int getTagsCount();
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index of the element to return.
* @return The tags at the given index.
*/
java.lang.String getTags(int index);
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index of the value to return.
* @return The bytes of the tags at the given index.
*/
com.google.protobuf.ByteString getTagsBytes(int index);
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
java.util.List 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
com.google.maps.routeoptimization.v1.TimeWindow getTimeWindows(int index);
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
int getTimeWindowsCount();
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
java.util.List extends com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>
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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getTimeWindowsOrBuilder(int index);
/**
*
*
*
* 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;
*
* @return Whether the duration field is set.
*/
boolean hasDuration();
/**
*
*
*
* 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;
*
* @return The duration.
*/
com.google.protobuf.Duration getDuration();
/**
*
*
*
* 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;
*/
com.google.protobuf.DurationOrBuilder getDurationOrBuilder();
/**
*
*
*
* 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;
*
* @return The cost.
*/
double getCost();
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
int getLoadDemandsCount();
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
boolean containsLoadDemands(java.lang.String key);
/** Use {@link #getLoadDemandsMap()} instead. */
@java.lang.Deprecated
java.util.Map
getLoadDemands();
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
java.util.Map
getLoadDemandsMap();
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
/* nullable */
com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrDefault(
java.lang.String key,
/* nullable */
com.google.maps.routeoptimization.v1.Shipment.Load defaultValue);
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(java.lang.String key);
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return A list containing the visitTypes.
*/
java.util.List getVisitTypesList();
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return The count of visitTypes.
*/
int getVisitTypesCount();
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index of the element to return.
* @return The visitTypes at the given index.
*/
java.lang.String getVisitTypes(int index);
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index of the value to return.
* @return The bytes of the visitTypes at the given index.
*/
com.google.protobuf.ByteString getVisitTypesBytes(int index);
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return The label.
*/
java.lang.String getLabel();
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return The bytes for label.
*/
com.google.protobuf.ByteString getLabelBytes();
}
/**
*
*
*
* 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 {@code google.maps.routeoptimization.v1.Shipment.VisitRequest}
*/
public static final class VisitRequest extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Shipment.VisitRequest)
VisitRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use VisitRequest.newBuilder() to construct.
private VisitRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private VisitRequest() {
tags_ = com.google.protobuf.LazyStringArrayList.emptyList();
timeWindows_ = java.util.Collections.emptyList();
visitTypes_ = com.google.protobuf.LazyStringArrayList.emptyList();
label_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new VisitRequest();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 12:
return internalGetLoadDemands();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.class,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder.class);
}
private int bitField0_;
public static final int ARRIVAL_LOCATION_FIELD_NUMBER = 1;
private com.google.type.LatLng arrivalLocation_;
/**
*
*
*
* 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;
*
* @return Whether the arrivalLocation field is set.
*/
@java.lang.Override
public boolean hasArrivalLocation() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* 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;
*
* @return The arrivalLocation.
*/
@java.lang.Override
public com.google.type.LatLng getArrivalLocation() {
return arrivalLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: arrivalLocation_;
}
/**
*
*
*
* 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;
*/
@java.lang.Override
public com.google.type.LatLngOrBuilder getArrivalLocationOrBuilder() {
return arrivalLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: arrivalLocation_;
}
public static final int ARRIVAL_WAYPOINT_FIELD_NUMBER = 2;
private com.google.maps.routeoptimization.v1.Waypoint arrivalWaypoint_;
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*
* @return Whether the arrivalWaypoint field is set.
*/
@java.lang.Override
public boolean hasArrivalWaypoint() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*
* @return The arrivalWaypoint.
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Waypoint getArrivalWaypoint() {
return arrivalWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: arrivalWaypoint_;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.WaypointOrBuilder getArrivalWaypointOrBuilder() {
return arrivalWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: arrivalWaypoint_;
}
public static final int DEPARTURE_LOCATION_FIELD_NUMBER = 3;
private com.google.type.LatLng departureLocation_;
/**
*
*
*
* 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;
*
* @return Whether the departureLocation field is set.
*/
@java.lang.Override
public boolean hasDepartureLocation() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* 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;
*
* @return The departureLocation.
*/
@java.lang.Override
public com.google.type.LatLng getDepartureLocation() {
return departureLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: departureLocation_;
}
/**
*
*
*
* 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;
*/
@java.lang.Override
public com.google.type.LatLngOrBuilder getDepartureLocationOrBuilder() {
return departureLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: departureLocation_;
}
public static final int DEPARTURE_WAYPOINT_FIELD_NUMBER = 4;
private com.google.maps.routeoptimization.v1.Waypoint departureWaypoint_;
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*
* @return Whether the departureWaypoint field is set.
*/
@java.lang.Override
public boolean hasDepartureWaypoint() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*
* @return The departureWaypoint.
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Waypoint getDepartureWaypoint() {
return departureWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: departureWaypoint_;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.WaypointOrBuilder getDepartureWaypointOrBuilder() {
return departureWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: departureWaypoint_;
}
public static final int TAGS_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList tags_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return A list containing the tags.
*/
public com.google.protobuf.ProtocolStringList getTagsList() {
return tags_;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return The count of tags.
*/
public int getTagsCount() {
return tags_.size();
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index of the element to return.
* @return The tags at the given index.
*/
public java.lang.String getTags(int index) {
return tags_.get(index);
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index of the value to return.
* @return The bytes of the tags at the given index.
*/
public com.google.protobuf.ByteString getTagsBytes(int index) {
return tags_.getByteString(index);
}
public static final int TIME_WINDOWS_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private java.util.List timeWindows_;
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
@java.lang.Override
public java.util.List getTimeWindowsList() {
return timeWindows_;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
@java.lang.Override
public java.util.List extends com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>
getTimeWindowsOrBuilderList() {
return timeWindows_;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
@java.lang.Override
public int getTimeWindowsCount() {
return timeWindows_.size();
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.TimeWindow getTimeWindows(int index) {
return timeWindows_.get(index);
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getTimeWindowsOrBuilder(
int index) {
return timeWindows_.get(index);
}
public static final int DURATION_FIELD_NUMBER = 7;
private com.google.protobuf.Duration duration_;
/**
*
*
*
* 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;
*
* @return Whether the duration field is set.
*/
@java.lang.Override
public boolean hasDuration() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
*
*
* 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;
*
* @return The duration.
*/
@java.lang.Override
public com.google.protobuf.Duration getDuration() {
return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
}
/**
*
*
*
* 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;
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() {
return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
}
public static final int COST_FIELD_NUMBER = 8;
private double cost_ = 0D;
/**
*
*
*
* 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;
*
* @return The cost.
*/
@java.lang.Override
public double getCost() {
return cost_;
}
public static final int LOAD_DEMANDS_FIELD_NUMBER = 12;
private static final class LoadDemandsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
defaultEntry =
com.google.protobuf.MapEntry
.
newDefaultInstance(
com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
loadDemands_;
private com.google.protobuf.MapField<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
internalGetLoadDemands() {
if (loadDemands_ == null) {
return com.google.protobuf.MapField.emptyMapField(
LoadDemandsDefaultEntryHolder.defaultEntry);
}
return loadDemands_;
}
public int getLoadDemandsCount() {
return internalGetLoadDemands().getMap().size();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public boolean containsLoadDemands(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLoadDemands().getMap().containsKey(key);
}
/** Use {@link #getLoadDemandsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map
getLoadDemands() {
return getLoadDemandsMap();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public java.util.Map
getLoadDemandsMap() {
return internalGetLoadDemands().getMap();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load
getLoadDemandsOrDefault(
java.lang.String key,
/* nullable */
com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map =
internalGetLoadDemands().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(
java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map =
internalGetLoadDemands().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int VISIT_TYPES_FIELD_NUMBER = 10;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList visitTypes_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return A list containing the visitTypes.
*/
public com.google.protobuf.ProtocolStringList getVisitTypesList() {
return visitTypes_;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return The count of visitTypes.
*/
public int getVisitTypesCount() {
return visitTypes_.size();
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index of the element to return.
* @return The visitTypes at the given index.
*/
public java.lang.String getVisitTypes(int index) {
return visitTypes_.get(index);
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index of the value to return.
* @return The bytes of the visitTypes at the given index.
*/
public com.google.protobuf.ByteString getVisitTypesBytes(int index) {
return visitTypes_.getByteString(index);
}
public static final int LABEL_FIELD_NUMBER = 11;
@SuppressWarnings("serial")
private volatile java.lang.Object label_ = "";
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return The label.
*/
@java.lang.Override
public java.lang.String getLabel() {
java.lang.Object ref = label_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
label_ = s;
return s;
}
}
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return The bytes for label.
*/
@java.lang.Override
public com.google.protobuf.ByteString getLabelBytes() {
java.lang.Object ref = label_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
label_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getArrivalLocation());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(2, getArrivalWaypoint());
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeMessage(3, getDepartureLocation());
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeMessage(4, getDepartureWaypoint());
}
for (int i = 0; i < tags_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, tags_.getRaw(i));
}
for (int i = 0; i < timeWindows_.size(); i++) {
output.writeMessage(6, timeWindows_.get(i));
}
if (((bitField0_ & 0x00000010) != 0)) {
output.writeMessage(7, getDuration());
}
if (java.lang.Double.doubleToRawLongBits(cost_) != 0) {
output.writeDouble(8, cost_);
}
for (int i = 0; i < visitTypes_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 10, visitTypes_.getRaw(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 11, label_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetLoadDemands(), LoadDemandsDefaultEntryHolder.defaultEntry, 12);
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getArrivalLocation());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getArrivalWaypoint());
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDepartureLocation());
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDepartureWaypoint());
}
{
int dataSize = 0;
for (int i = 0; i < tags_.size(); i++) {
dataSize += computeStringSizeNoTag(tags_.getRaw(i));
}
size += dataSize;
size += 1 * getTagsList().size();
}
for (int i = 0; i < timeWindows_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, timeWindows_.get(i));
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDuration());
}
if (java.lang.Double.doubleToRawLongBits(cost_) != 0) {
size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, cost_);
}
{
int dataSize = 0;
for (int i = 0; i < visitTypes_.size(); i++) {
dataSize += computeStringSizeNoTag(visitTypes_.getRaw(i));
}
size += dataSize;
size += 1 * getVisitTypesList().size();
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, label_);
}
for (java.util.Map.Entry
entry : internalGetLoadDemands().getMap().entrySet()) {
com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
loadDemands__ =
LoadDemandsDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, loadDemands__);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.maps.routeoptimization.v1.Shipment.VisitRequest)) {
return super.equals(obj);
}
com.google.maps.routeoptimization.v1.Shipment.VisitRequest other =
(com.google.maps.routeoptimization.v1.Shipment.VisitRequest) obj;
if (hasArrivalLocation() != other.hasArrivalLocation()) return false;
if (hasArrivalLocation()) {
if (!getArrivalLocation().equals(other.getArrivalLocation())) return false;
}
if (hasArrivalWaypoint() != other.hasArrivalWaypoint()) return false;
if (hasArrivalWaypoint()) {
if (!getArrivalWaypoint().equals(other.getArrivalWaypoint())) return false;
}
if (hasDepartureLocation() != other.hasDepartureLocation()) return false;
if (hasDepartureLocation()) {
if (!getDepartureLocation().equals(other.getDepartureLocation())) return false;
}
if (hasDepartureWaypoint() != other.hasDepartureWaypoint()) return false;
if (hasDepartureWaypoint()) {
if (!getDepartureWaypoint().equals(other.getDepartureWaypoint())) return false;
}
if (!getTagsList().equals(other.getTagsList())) return false;
if (!getTimeWindowsList().equals(other.getTimeWindowsList())) return false;
if (hasDuration() != other.hasDuration()) return false;
if (hasDuration()) {
if (!getDuration().equals(other.getDuration())) return false;
}
if (java.lang.Double.doubleToLongBits(getCost())
!= java.lang.Double.doubleToLongBits(other.getCost())) return false;
if (!internalGetLoadDemands().equals(other.internalGetLoadDemands())) return false;
if (!getVisitTypesList().equals(other.getVisitTypesList())) return false;
if (!getLabel().equals(other.getLabel())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasArrivalLocation()) {
hash = (37 * hash) + ARRIVAL_LOCATION_FIELD_NUMBER;
hash = (53 * hash) + getArrivalLocation().hashCode();
}
if (hasArrivalWaypoint()) {
hash = (37 * hash) + ARRIVAL_WAYPOINT_FIELD_NUMBER;
hash = (53 * hash) + getArrivalWaypoint().hashCode();
}
if (hasDepartureLocation()) {
hash = (37 * hash) + DEPARTURE_LOCATION_FIELD_NUMBER;
hash = (53 * hash) + getDepartureLocation().hashCode();
}
if (hasDepartureWaypoint()) {
hash = (37 * hash) + DEPARTURE_WAYPOINT_FIELD_NUMBER;
hash = (53 * hash) + getDepartureWaypoint().hashCode();
}
if (getTagsCount() > 0) {
hash = (37 * hash) + TAGS_FIELD_NUMBER;
hash = (53 * hash) + getTagsList().hashCode();
}
if (getTimeWindowsCount() > 0) {
hash = (37 * hash) + TIME_WINDOWS_FIELD_NUMBER;
hash = (53 * hash) + getTimeWindowsList().hashCode();
}
if (hasDuration()) {
hash = (37 * hash) + DURATION_FIELD_NUMBER;
hash = (53 * hash) + getDuration().hashCode();
}
hash = (37 * hash) + COST_FIELD_NUMBER;
hash =
(53 * hash)
+ com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getCost()));
if (!internalGetLoadDemands().getMap().isEmpty()) {
hash = (37 * hash) + LOAD_DEMANDS_FIELD_NUMBER;
hash = (53 * hash) + internalGetLoadDemands().hashCode();
}
if (getVisitTypesCount() > 0) {
hash = (37 * hash) + VISIT_TYPES_FIELD_NUMBER;
hash = (53 * hash) + getVisitTypesList().hashCode();
}
hash = (37 * hash) + LABEL_FIELD_NUMBER;
hash = (53 * hash) + getLabel().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* 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 {@code google.maps.routeoptimization.v1.Shipment.VisitRequest}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Shipment.VisitRequest)
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 12:
return internalGetLoadDemands();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 12:
return internalGetMutableLoadDemands();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.class,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder.class);
}
// Construct using com.google.maps.routeoptimization.v1.Shipment.VisitRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getArrivalLocationFieldBuilder();
getArrivalWaypointFieldBuilder();
getDepartureLocationFieldBuilder();
getDepartureWaypointFieldBuilder();
getTimeWindowsFieldBuilder();
getDurationFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
arrivalLocation_ = null;
if (arrivalLocationBuilder_ != null) {
arrivalLocationBuilder_.dispose();
arrivalLocationBuilder_ = null;
}
arrivalWaypoint_ = null;
if (arrivalWaypointBuilder_ != null) {
arrivalWaypointBuilder_.dispose();
arrivalWaypointBuilder_ = null;
}
departureLocation_ = null;
if (departureLocationBuilder_ != null) {
departureLocationBuilder_.dispose();
departureLocationBuilder_ = null;
}
departureWaypoint_ = null;
if (departureWaypointBuilder_ != null) {
departureWaypointBuilder_.dispose();
departureWaypointBuilder_ = null;
}
tags_ = com.google.protobuf.LazyStringArrayList.emptyList();
if (timeWindowsBuilder_ == null) {
timeWindows_ = java.util.Collections.emptyList();
} else {
timeWindows_ = null;
timeWindowsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
duration_ = null;
if (durationBuilder_ != null) {
durationBuilder_.dispose();
durationBuilder_ = null;
}
cost_ = 0D;
internalGetMutableLoadDemands().clear();
visitTypes_ = com.google.protobuf.LazyStringArrayList.emptyList();
label_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest
getDefaultInstanceForType() {
return com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest build() {
com.google.maps.routeoptimization.v1.Shipment.VisitRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest buildPartial() {
com.google.maps.routeoptimization.v1.Shipment.VisitRequest result =
new com.google.maps.routeoptimization.v1.Shipment.VisitRequest(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest result) {
if (timeWindowsBuilder_ == null) {
if (((bitField0_ & 0x00000020) != 0)) {
timeWindows_ = java.util.Collections.unmodifiableList(timeWindows_);
bitField0_ = (bitField0_ & ~0x00000020);
}
result.timeWindows_ = timeWindows_;
} else {
result.timeWindows_ = timeWindowsBuilder_.build();
}
}
private void buildPartial0(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.arrivalLocation_ =
arrivalLocationBuilder_ == null ? arrivalLocation_ : arrivalLocationBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.arrivalWaypoint_ =
arrivalWaypointBuilder_ == null ? arrivalWaypoint_ : arrivalWaypointBuilder_.build();
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.departureLocation_ =
departureLocationBuilder_ == null
? departureLocation_
: departureLocationBuilder_.build();
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.departureWaypoint_ =
departureWaypointBuilder_ == null
? departureWaypoint_
: departureWaypointBuilder_.build();
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
tags_.makeImmutable();
result.tags_ = tags_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build();
to_bitField0_ |= 0x00000010;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.cost_ = cost_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.loadDemands_ =
internalGetLoadDemands().build(LoadDemandsDefaultEntryHolder.defaultEntry);
}
if (((from_bitField0_ & 0x00000200) != 0)) {
visitTypes_.makeImmutable();
result.visitTypes_ = visitTypes_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.label_ = label_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.maps.routeoptimization.v1.Shipment.VisitRequest) {
return mergeFrom((com.google.maps.routeoptimization.v1.Shipment.VisitRequest) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.maps.routeoptimization.v1.Shipment.VisitRequest other) {
if (other
== com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance())
return this;
if (other.hasArrivalLocation()) {
mergeArrivalLocation(other.getArrivalLocation());
}
if (other.hasArrivalWaypoint()) {
mergeArrivalWaypoint(other.getArrivalWaypoint());
}
if (other.hasDepartureLocation()) {
mergeDepartureLocation(other.getDepartureLocation());
}
if (other.hasDepartureWaypoint()) {
mergeDepartureWaypoint(other.getDepartureWaypoint());
}
if (!other.tags_.isEmpty()) {
if (tags_.isEmpty()) {
tags_ = other.tags_;
bitField0_ |= 0x00000010;
} else {
ensureTagsIsMutable();
tags_.addAll(other.tags_);
}
onChanged();
}
if (timeWindowsBuilder_ == null) {
if (!other.timeWindows_.isEmpty()) {
if (timeWindows_.isEmpty()) {
timeWindows_ = other.timeWindows_;
bitField0_ = (bitField0_ & ~0x00000020);
} else {
ensureTimeWindowsIsMutable();
timeWindows_.addAll(other.timeWindows_);
}
onChanged();
}
} else {
if (!other.timeWindows_.isEmpty()) {
if (timeWindowsBuilder_.isEmpty()) {
timeWindowsBuilder_.dispose();
timeWindowsBuilder_ = null;
timeWindows_ = other.timeWindows_;
bitField0_ = (bitField0_ & ~0x00000020);
timeWindowsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getTimeWindowsFieldBuilder()
: null;
} else {
timeWindowsBuilder_.addAllMessages(other.timeWindows_);
}
}
}
if (other.hasDuration()) {
mergeDuration(other.getDuration());
}
if (other.getCost() != 0D) {
setCost(other.getCost());
}
internalGetMutableLoadDemands().mergeFrom(other.internalGetLoadDemands());
bitField0_ |= 0x00000100;
if (!other.visitTypes_.isEmpty()) {
if (visitTypes_.isEmpty()) {
visitTypes_ = other.visitTypes_;
bitField0_ |= 0x00000200;
} else {
ensureVisitTypesIsMutable();
visitTypes_.addAll(other.visitTypes_);
}
onChanged();
}
if (!other.getLabel().isEmpty()) {
label_ = other.label_;
bitField0_ |= 0x00000400;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
input.readMessage(
getArrivalLocationFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
input.readMessage(
getArrivalWaypointFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
input.readMessage(
getDepartureLocationFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 26
case 34:
{
input.readMessage(
getDepartureWaypointFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
case 42:
{
java.lang.String s = input.readStringRequireUtf8();
ensureTagsIsMutable();
tags_.add(s);
break;
} // case 42
case 50:
{
com.google.maps.routeoptimization.v1.TimeWindow m =
input.readMessage(
com.google.maps.routeoptimization.v1.TimeWindow.parser(),
extensionRegistry);
if (timeWindowsBuilder_ == null) {
ensureTimeWindowsIsMutable();
timeWindows_.add(m);
} else {
timeWindowsBuilder_.addMessage(m);
}
break;
} // case 50
case 58:
{
input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000040;
break;
} // case 58
case 65:
{
cost_ = input.readDouble();
bitField0_ |= 0x00000080;
break;
} // case 65
case 82:
{
java.lang.String s = input.readStringRequireUtf8();
ensureVisitTypesIsMutable();
visitTypes_.add(s);
break;
} // case 82
case 90:
{
label_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000400;
break;
} // case 90
case 98:
{
com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
loadDemands__ =
input.readMessage(
LoadDemandsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableLoadDemands()
.ensureBuilderMap()
.put(loadDemands__.getKey(), loadDemands__.getValue());
bitField0_ |= 0x00000100;
break;
} // case 98
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.type.LatLng arrivalLocation_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng,
com.google.type.LatLng.Builder,
com.google.type.LatLngOrBuilder>
arrivalLocationBuilder_;
/**
*
*
*
* 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;
*
* @return Whether the arrivalLocation field is set.
*/
public boolean hasArrivalLocation() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* 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;
*
* @return The arrivalLocation.
*/
public com.google.type.LatLng getArrivalLocation() {
if (arrivalLocationBuilder_ == null) {
return arrivalLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: arrivalLocation_;
} else {
return arrivalLocationBuilder_.getMessage();
}
}
/**
*
*
*
* 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;
*/
public Builder setArrivalLocation(com.google.type.LatLng value) {
if (arrivalLocationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
arrivalLocation_ = value;
} else {
arrivalLocationBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public Builder setArrivalLocation(com.google.type.LatLng.Builder builderForValue) {
if (arrivalLocationBuilder_ == null) {
arrivalLocation_ = builderForValue.build();
} else {
arrivalLocationBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public Builder mergeArrivalLocation(com.google.type.LatLng value) {
if (arrivalLocationBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)
&& arrivalLocation_ != null
&& arrivalLocation_ != com.google.type.LatLng.getDefaultInstance()) {
getArrivalLocationBuilder().mergeFrom(value);
} else {
arrivalLocation_ = value;
}
} else {
arrivalLocationBuilder_.mergeFrom(value);
}
if (arrivalLocation_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
*
*
*
* 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;
*/
public Builder clearArrivalLocation() {
bitField0_ = (bitField0_ & ~0x00000001);
arrivalLocation_ = null;
if (arrivalLocationBuilder_ != null) {
arrivalLocationBuilder_.dispose();
arrivalLocationBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public com.google.type.LatLng.Builder getArrivalLocationBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getArrivalLocationFieldBuilder().getBuilder();
}
/**
*
*
*
* 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;
*/
public com.google.type.LatLngOrBuilder getArrivalLocationOrBuilder() {
if (arrivalLocationBuilder_ != null) {
return arrivalLocationBuilder_.getMessageOrBuilder();
} else {
return arrivalLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: arrivalLocation_;
}
}
/**
*
*
*
* 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;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng,
com.google.type.LatLng.Builder,
com.google.type.LatLngOrBuilder>
getArrivalLocationFieldBuilder() {
if (arrivalLocationBuilder_ == null) {
arrivalLocationBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng,
com.google.type.LatLng.Builder,
com.google.type.LatLngOrBuilder>(
getArrivalLocation(), getParentForChildren(), isClean());
arrivalLocation_ = null;
}
return arrivalLocationBuilder_;
}
private com.google.maps.routeoptimization.v1.Waypoint arrivalWaypoint_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.maps.routeoptimization.v1.Waypoint,
com.google.maps.routeoptimization.v1.Waypoint.Builder,
com.google.maps.routeoptimization.v1.WaypointOrBuilder>
arrivalWaypointBuilder_;
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*
* @return Whether the arrivalWaypoint field is set.
*/
public boolean hasArrivalWaypoint() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*
* @return The arrivalWaypoint.
*/
public com.google.maps.routeoptimization.v1.Waypoint getArrivalWaypoint() {
if (arrivalWaypointBuilder_ == null) {
return arrivalWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: arrivalWaypoint_;
} else {
return arrivalWaypointBuilder_.getMessage();
}
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
public Builder setArrivalWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) {
if (arrivalWaypointBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
arrivalWaypoint_ = value;
} else {
arrivalWaypointBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
public Builder setArrivalWaypoint(
com.google.maps.routeoptimization.v1.Waypoint.Builder builderForValue) {
if (arrivalWaypointBuilder_ == null) {
arrivalWaypoint_ = builderForValue.build();
} else {
arrivalWaypointBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
public Builder mergeArrivalWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) {
if (arrivalWaypointBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)
&& arrivalWaypoint_ != null
&& arrivalWaypoint_
!= com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) {
getArrivalWaypointBuilder().mergeFrom(value);
} else {
arrivalWaypoint_ = value;
}
} else {
arrivalWaypointBuilder_.mergeFrom(value);
}
if (arrivalWaypoint_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
public Builder clearArrivalWaypoint() {
bitField0_ = (bitField0_ & ~0x00000002);
arrivalWaypoint_ = null;
if (arrivalWaypointBuilder_ != null) {
arrivalWaypointBuilder_.dispose();
arrivalWaypointBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
public com.google.maps.routeoptimization.v1.Waypoint.Builder getArrivalWaypointBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getArrivalWaypointFieldBuilder().getBuilder();
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
public com.google.maps.routeoptimization.v1.WaypointOrBuilder getArrivalWaypointOrBuilder() {
if (arrivalWaypointBuilder_ != null) {
return arrivalWaypointBuilder_.getMessageOrBuilder();
} else {
return arrivalWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: arrivalWaypoint_;
}
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.maps.routeoptimization.v1.Waypoint,
com.google.maps.routeoptimization.v1.Waypoint.Builder,
com.google.maps.routeoptimization.v1.WaypointOrBuilder>
getArrivalWaypointFieldBuilder() {
if (arrivalWaypointBuilder_ == null) {
arrivalWaypointBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.maps.routeoptimization.v1.Waypoint,
com.google.maps.routeoptimization.v1.Waypoint.Builder,
com.google.maps.routeoptimization.v1.WaypointOrBuilder>(
getArrivalWaypoint(), getParentForChildren(), isClean());
arrivalWaypoint_ = null;
}
return arrivalWaypointBuilder_;
}
private com.google.type.LatLng departureLocation_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng,
com.google.type.LatLng.Builder,
com.google.type.LatLngOrBuilder>
departureLocationBuilder_;
/**
*
*
*
* 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;
*
* @return Whether the departureLocation field is set.
*/
public boolean hasDepartureLocation() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* 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;
*
* @return The departureLocation.
*/
public com.google.type.LatLng getDepartureLocation() {
if (departureLocationBuilder_ == null) {
return departureLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: departureLocation_;
} else {
return departureLocationBuilder_.getMessage();
}
}
/**
*
*
*
* 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;
*/
public Builder setDepartureLocation(com.google.type.LatLng value) {
if (departureLocationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
departureLocation_ = value;
} else {
departureLocationBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public Builder setDepartureLocation(com.google.type.LatLng.Builder builderForValue) {
if (departureLocationBuilder_ == null) {
departureLocation_ = builderForValue.build();
} else {
departureLocationBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public Builder mergeDepartureLocation(com.google.type.LatLng value) {
if (departureLocationBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)
&& departureLocation_ != null
&& departureLocation_ != com.google.type.LatLng.getDefaultInstance()) {
getDepartureLocationBuilder().mergeFrom(value);
} else {
departureLocation_ = value;
}
} else {
departureLocationBuilder_.mergeFrom(value);
}
if (departureLocation_ != null) {
bitField0_ |= 0x00000004;
onChanged();
}
return this;
}
/**
*
*
*
* 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;
*/
public Builder clearDepartureLocation() {
bitField0_ = (bitField0_ & ~0x00000004);
departureLocation_ = null;
if (departureLocationBuilder_ != null) {
departureLocationBuilder_.dispose();
departureLocationBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public com.google.type.LatLng.Builder getDepartureLocationBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getDepartureLocationFieldBuilder().getBuilder();
}
/**
*
*
*
* 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;
*/
public com.google.type.LatLngOrBuilder getDepartureLocationOrBuilder() {
if (departureLocationBuilder_ != null) {
return departureLocationBuilder_.getMessageOrBuilder();
} else {
return departureLocation_ == null
? com.google.type.LatLng.getDefaultInstance()
: departureLocation_;
}
}
/**
*
*
*
* 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;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng,
com.google.type.LatLng.Builder,
com.google.type.LatLngOrBuilder>
getDepartureLocationFieldBuilder() {
if (departureLocationBuilder_ == null) {
departureLocationBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng,
com.google.type.LatLng.Builder,
com.google.type.LatLngOrBuilder>(
getDepartureLocation(), getParentForChildren(), isClean());
departureLocation_ = null;
}
return departureLocationBuilder_;
}
private com.google.maps.routeoptimization.v1.Waypoint departureWaypoint_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.maps.routeoptimization.v1.Waypoint,
com.google.maps.routeoptimization.v1.Waypoint.Builder,
com.google.maps.routeoptimization.v1.WaypointOrBuilder>
departureWaypointBuilder_;
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*
* @return Whether the departureWaypoint field is set.
*/
public boolean hasDepartureWaypoint() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*
* @return The departureWaypoint.
*/
public com.google.maps.routeoptimization.v1.Waypoint getDepartureWaypoint() {
if (departureWaypointBuilder_ == null) {
return departureWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: departureWaypoint_;
} else {
return departureWaypointBuilder_.getMessage();
}
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
public Builder setDepartureWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) {
if (departureWaypointBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
departureWaypoint_ = value;
} else {
departureWaypointBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
public Builder setDepartureWaypoint(
com.google.maps.routeoptimization.v1.Waypoint.Builder builderForValue) {
if (departureWaypointBuilder_ == null) {
departureWaypoint_ = builderForValue.build();
} else {
departureWaypointBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
public Builder mergeDepartureWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) {
if (departureWaypointBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0)
&& departureWaypoint_ != null
&& departureWaypoint_
!= com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) {
getDepartureWaypointBuilder().mergeFrom(value);
} else {
departureWaypoint_ = value;
}
} else {
departureWaypointBuilder_.mergeFrom(value);
}
if (departureWaypoint_ != null) {
bitField0_ |= 0x00000008;
onChanged();
}
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
public Builder clearDepartureWaypoint() {
bitField0_ = (bitField0_ & ~0x00000008);
departureWaypoint_ = null;
if (departureWaypointBuilder_ != null) {
departureWaypointBuilder_.dispose();
departureWaypointBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
public com.google.maps.routeoptimization.v1.Waypoint.Builder getDepartureWaypointBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getDepartureWaypointFieldBuilder().getBuilder();
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
public com.google.maps.routeoptimization.v1.WaypointOrBuilder
getDepartureWaypointOrBuilder() {
if (departureWaypointBuilder_ != null) {
return departureWaypointBuilder_.getMessageOrBuilder();
} else {
return departureWaypoint_ == null
? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()
: departureWaypoint_;
}
}
/**
*
*
*
* 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.maps.routeoptimization.v1.Waypoint departure_waypoint = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.maps.routeoptimization.v1.Waypoint,
com.google.maps.routeoptimization.v1.Waypoint.Builder,
com.google.maps.routeoptimization.v1.WaypointOrBuilder>
getDepartureWaypointFieldBuilder() {
if (departureWaypointBuilder_ == null) {
departureWaypointBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.maps.routeoptimization.v1.Waypoint,
com.google.maps.routeoptimization.v1.Waypoint.Builder,
com.google.maps.routeoptimization.v1.WaypointOrBuilder>(
getDepartureWaypoint(), getParentForChildren(), isClean());
departureWaypoint_ = null;
}
return departureWaypointBuilder_;
}
private com.google.protobuf.LazyStringArrayList tags_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureTagsIsMutable() {
if (!tags_.isModifiable()) {
tags_ = new com.google.protobuf.LazyStringArrayList(tags_);
}
bitField0_ |= 0x00000010;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return A list containing the tags.
*/
public com.google.protobuf.ProtocolStringList getTagsList() {
tags_.makeImmutable();
return tags_;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return The count of tags.
*/
public int getTagsCount() {
return tags_.size();
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index of the element to return.
* @return The tags at the given index.
*/
public java.lang.String getTags(int index) {
return tags_.get(index);
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index of the value to return.
* @return The bytes of the tags at the given index.
*/
public com.google.protobuf.ByteString getTagsBytes(int index) {
return tags_.getByteString(index);
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param index The index to set the value at.
* @param value The tags to set.
* @return This builder for chaining.
*/
public Builder setTags(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTagsIsMutable();
tags_.set(index, value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param value The tags to add.
* @return This builder for chaining.
*/
public Builder addTags(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTagsIsMutable();
tags_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param values The tags to add.
* @return This builder for chaining.
*/
public Builder addAllTags(java.lang.Iterable values) {
ensureTagsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @return This builder for chaining.
*/
public Builder clearTags() {
tags_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
;
onChanged();
return this;
}
/**
*
*
*
* Specifies tags attached to the visit request.
* Empty or duplicate strings are not allowed.
*
*
* repeated string tags = 5;
*
* @param value The bytes of the tags to add.
* @return This builder for chaining.
*/
public Builder addTagsBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureTagsIsMutable();
tags_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
private java.util.List timeWindows_ =
java.util.Collections.emptyList();
private void ensureTimeWindowsIsMutable() {
if (!((bitField0_ & 0x00000020) != 0)) {
timeWindows_ =
new java.util.ArrayList(
timeWindows_);
bitField0_ |= 0x00000020;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.TimeWindow,
com.google.maps.routeoptimization.v1.TimeWindow.Builder,
com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>
timeWindowsBuilder_;
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public java.util.List getTimeWindowsList() {
if (timeWindowsBuilder_ == null) {
return java.util.Collections.unmodifiableList(timeWindows_);
} else {
return timeWindowsBuilder_.getMessageList();
}
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public int getTimeWindowsCount() {
if (timeWindowsBuilder_ == null) {
return timeWindows_.size();
} else {
return timeWindowsBuilder_.getCount();
}
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public com.google.maps.routeoptimization.v1.TimeWindow getTimeWindows(int index) {
if (timeWindowsBuilder_ == null) {
return timeWindows_.get(index);
} else {
return timeWindowsBuilder_.getMessage(index);
}
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder setTimeWindows(
int index, com.google.maps.routeoptimization.v1.TimeWindow value) {
if (timeWindowsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTimeWindowsIsMutable();
timeWindows_.set(index, value);
onChanged();
} else {
timeWindowsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder setTimeWindows(
int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) {
if (timeWindowsBuilder_ == null) {
ensureTimeWindowsIsMutable();
timeWindows_.set(index, builderForValue.build());
onChanged();
} else {
timeWindowsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder addTimeWindows(com.google.maps.routeoptimization.v1.TimeWindow value) {
if (timeWindowsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTimeWindowsIsMutable();
timeWindows_.add(value);
onChanged();
} else {
timeWindowsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder addTimeWindows(
int index, com.google.maps.routeoptimization.v1.TimeWindow value) {
if (timeWindowsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTimeWindowsIsMutable();
timeWindows_.add(index, value);
onChanged();
} else {
timeWindowsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder addTimeWindows(
com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) {
if (timeWindowsBuilder_ == null) {
ensureTimeWindowsIsMutable();
timeWindows_.add(builderForValue.build());
onChanged();
} else {
timeWindowsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder addTimeWindows(
int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) {
if (timeWindowsBuilder_ == null) {
ensureTimeWindowsIsMutable();
timeWindows_.add(index, builderForValue.build());
onChanged();
} else {
timeWindowsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder addAllTimeWindows(
java.lang.Iterable extends com.google.maps.routeoptimization.v1.TimeWindow> values) {
if (timeWindowsBuilder_ == null) {
ensureTimeWindowsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, timeWindows_);
onChanged();
} else {
timeWindowsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder clearTimeWindows() {
if (timeWindowsBuilder_ == null) {
timeWindows_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
} else {
timeWindowsBuilder_.clear();
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public Builder removeTimeWindows(int index) {
if (timeWindowsBuilder_ == null) {
ensureTimeWindowsIsMutable();
timeWindows_.remove(index);
onChanged();
} else {
timeWindowsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public com.google.maps.routeoptimization.v1.TimeWindow.Builder getTimeWindowsBuilder(
int index) {
return getTimeWindowsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getTimeWindowsOrBuilder(
int index) {
if (timeWindowsBuilder_ == null) {
return timeWindows_.get(index);
} else {
return timeWindowsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public java.util.List extends com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>
getTimeWindowsOrBuilderList() {
if (timeWindowsBuilder_ != null) {
return timeWindowsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(timeWindows_);
}
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public com.google.maps.routeoptimization.v1.TimeWindow.Builder addTimeWindowsBuilder() {
return getTimeWindowsFieldBuilder()
.addBuilder(com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance());
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public com.google.maps.routeoptimization.v1.TimeWindow.Builder addTimeWindowsBuilder(
int index) {
return getTimeWindowsFieldBuilder()
.addBuilder(
index, com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance());
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.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.maps.routeoptimization.v1.TimeWindow time_windows = 6;
*/
public java.util.List
getTimeWindowsBuilderList() {
return getTimeWindowsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.TimeWindow,
com.google.maps.routeoptimization.v1.TimeWindow.Builder,
com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>
getTimeWindowsFieldBuilder() {
if (timeWindowsBuilder_ == null) {
timeWindowsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.TimeWindow,
com.google.maps.routeoptimization.v1.TimeWindow.Builder,
com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>(
timeWindows_,
((bitField0_ & 0x00000020) != 0),
getParentForChildren(),
isClean());
timeWindows_ = null;
}
return timeWindowsBuilder_;
}
private com.google.protobuf.Duration duration_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
durationBuilder_;
/**
*
*
*
* 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;
*
* @return Whether the duration field is set.
*/
public boolean hasDuration() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
*
*
* 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;
*
* @return The duration.
*/
public com.google.protobuf.Duration getDuration() {
if (durationBuilder_ == null) {
return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
} else {
return durationBuilder_.getMessage();
}
}
/**
*
*
*
* 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;
*/
public Builder setDuration(com.google.protobuf.Duration value) {
if (durationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
duration_ = value;
} else {
durationBuilder_.setMessage(value);
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) {
if (durationBuilder_ == null) {
duration_ = builderForValue.build();
} else {
durationBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public Builder mergeDuration(com.google.protobuf.Duration value) {
if (durationBuilder_ == null) {
if (((bitField0_ & 0x00000040) != 0)
&& duration_ != null
&& duration_ != com.google.protobuf.Duration.getDefaultInstance()) {
getDurationBuilder().mergeFrom(value);
} else {
duration_ = value;
}
} else {
durationBuilder_.mergeFrom(value);
}
if (duration_ != null) {
bitField0_ |= 0x00000040;
onChanged();
}
return this;
}
/**
*
*
*
* 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;
*/
public Builder clearDuration() {
bitField0_ = (bitField0_ & ~0x00000040);
duration_ = null;
if (durationBuilder_ != null) {
durationBuilder_.dispose();
durationBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* 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;
*/
public com.google.protobuf.Duration.Builder getDurationBuilder() {
bitField0_ |= 0x00000040;
onChanged();
return getDurationFieldBuilder().getBuilder();
}
/**
*
*
*
* 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;
*/
public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() {
if (durationBuilder_ != null) {
return durationBuilder_.getMessageOrBuilder();
} else {
return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
}
}
/**
*
*
*
* 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;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
getDurationFieldBuilder() {
if (durationBuilder_ == null) {
durationBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>(
getDuration(), getParentForChildren(), isClean());
duration_ = null;
}
return durationBuilder_;
}
private double cost_;
/**
*
*
*
* 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;
*
* @return The cost.
*/
@java.lang.Override
public double getCost() {
return cost_;
}
/**
*
*
*
* 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;
*
* @param value The cost to set.
* @return This builder for chaining.
*/
public Builder setCost(double value) {
cost_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* 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;
*
* @return This builder for chaining.
*/
public Builder clearCost() {
bitField0_ = (bitField0_ & ~0x00000080);
cost_ = 0D;
onChanged();
return this;
}
private static final class LoadDemandsConverter
implements com.google.protobuf.MapFieldBuilder.Converter<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load> {
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load build(
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder val) {
if (val instanceof com.google.maps.routeoptimization.v1.Shipment.Load) {
return (com.google.maps.routeoptimization.v1.Shipment.Load) val;
}
return ((com.google.maps.routeoptimization.v1.Shipment.Load.Builder) val).build();
}
@java.lang.Override
public com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
defaultEntry() {
return LoadDemandsDefaultEntryHolder.defaultEntry;
}
};
private static final LoadDemandsConverter loadDemandsConverter = new LoadDemandsConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder>
loadDemands_;
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder>
internalGetLoadDemands() {
if (loadDemands_ == null) {
return new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter);
}
return loadDemands_;
}
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder>
internalGetMutableLoadDemands() {
if (loadDemands_ == null) {
loadDemands_ = new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter);
}
bitField0_ |= 0x00000100;
onChanged();
return loadDemands_;
}
public int getLoadDemandsCount() {
return internalGetLoadDemands().ensureBuilderMap().size();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public boolean containsLoadDemands(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLoadDemands().ensureBuilderMap().containsKey(key);
}
/** Use {@link #getLoadDemandsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map
getLoadDemands() {
return getLoadDemandsMap();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public java.util.Map
getLoadDemandsMap() {
return internalGetLoadDemands().getImmutableMap();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load
getLoadDemandsOrDefault(
java.lang.String key,
/* nullable */
com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map
map = internalGetMutableLoadDemands().ensureBuilderMap();
return map.containsKey(key) ? loadDemandsConverter.build(map.get(key)) : defaultValue;
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(
java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map
map = internalGetMutableLoadDemands().ensureBuilderMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return loadDemandsConverter.build(map.get(key));
}
public Builder clearLoadDemands() {
bitField0_ = (bitField0_ & ~0x00000100);
internalGetMutableLoadDemands().clear();
return this;
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
public Builder removeLoadDemands(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableLoadDemands().ensureBuilderMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map
getMutableLoadDemands() {
bitField0_ |= 0x00000100;
return internalGetMutableLoadDemands().ensureMessageMap();
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
public Builder putLoadDemands(
java.lang.String key, com.google.maps.routeoptimization.v1.Shipment.Load value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableLoadDemands().ensureBuilderMap().put(key, value);
bitField0_ |= 0x00000100;
return this;
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
public Builder putAllLoadDemands(
java.util.Map
values) {
for (java.util.Map.Entry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
throw new NullPointerException();
}
}
internalGetMutableLoadDemands().ensureBuilderMap().putAll(values);
bitField0_ |= 0x00000100;
return this;
}
/**
*
*
*
* Load demands of this visit request. This is just like
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
* field, except that it only applies to this
* [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
* instead of the whole
* [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
* here are added to the demands listed in
* [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12;
*
*/
public com.google.maps.routeoptimization.v1.Shipment.Load.Builder
putLoadDemandsBuilderIfAbsent(java.lang.String key) {
java.util.Map
builderMap = internalGetMutableLoadDemands().ensureBuilderMap();
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder entry = builderMap.get(key);
if (entry == null) {
entry = com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder();
builderMap.put(key, entry);
}
if (entry instanceof com.google.maps.routeoptimization.v1.Shipment.Load) {
entry = ((com.google.maps.routeoptimization.v1.Shipment.Load) entry).toBuilder();
builderMap.put(key, entry);
}
return (com.google.maps.routeoptimization.v1.Shipment.Load.Builder) entry;
}
private com.google.protobuf.LazyStringArrayList visitTypes_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureVisitTypesIsMutable() {
if (!visitTypes_.isModifiable()) {
visitTypes_ = new com.google.protobuf.LazyStringArrayList(visitTypes_);
}
bitField0_ |= 0x00000200;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return A list containing the visitTypes.
*/
public com.google.protobuf.ProtocolStringList getVisitTypesList() {
visitTypes_.makeImmutable();
return visitTypes_;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return The count of visitTypes.
*/
public int getVisitTypesCount() {
return visitTypes_.size();
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index of the element to return.
* @return The visitTypes at the given index.
*/
public java.lang.String getVisitTypes(int index) {
return visitTypes_.get(index);
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index of the value to return.
* @return The bytes of the visitTypes at the given index.
*/
public com.google.protobuf.ByteString getVisitTypesBytes(int index) {
return visitTypes_.getByteString(index);
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param index The index to set the value at.
* @param value The visitTypes to set.
* @return This builder for chaining.
*/
public Builder setVisitTypes(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureVisitTypesIsMutable();
visitTypes_.set(index, value);
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param value The visitTypes to add.
* @return This builder for chaining.
*/
public Builder addVisitTypes(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureVisitTypesIsMutable();
visitTypes_.add(value);
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param values The visitTypes to add.
* @return This builder for chaining.
*/
public Builder addAllVisitTypes(java.lang.Iterable values) {
ensureVisitTypesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, visitTypes_);
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @return This builder for chaining.
*/
public Builder clearVisitTypes() {
visitTypes_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000200);
;
onChanged();
return this;
}
/**
*
*
*
* 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][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
*
* A type can only appear once.
*
*
* repeated string visit_types = 10;
*
* @param value The bytes of the visitTypes to add.
* @return This builder for chaining.
*/
public Builder addVisitTypesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureVisitTypesIsMutable();
visitTypes_.add(value);
bitField0_ |= 0x00000200;
onChanged();
return this;
}
private java.lang.Object label_ = "";
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return The label.
*/
public java.lang.String getLabel() {
java.lang.Object ref = label_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
label_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return The bytes for label.
*/
public com.google.protobuf.ByteString getLabelBytes() {
java.lang.Object ref = label_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
label_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @param value The label to set.
* @return This builder for chaining.
*/
public Builder setLabel(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
label_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @return This builder for chaining.
*/
public Builder clearLabel() {
label_ = getDefaultInstance().getLabel();
bitField0_ = (bitField0_ & ~0x00000400);
onChanged();
return this;
}
/**
*
*
*
* Specifies a label for this `VisitRequest`. This label is reported in the
* response as `visit_label` in the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 11;
*
* @param value The bytes for label to set.
* @return This builder for chaining.
*/
public Builder setLabelBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
label_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Shipment.VisitRequest)
}
// @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Shipment.VisitRequest)
private static final com.google.maps.routeoptimization.v1.Shipment.VisitRequest
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Shipment.VisitRequest();
}
public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public VisitRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface LoadOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Shipment.Load)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* The amount by which the load of the vehicle performing the corresponding
* visit will vary. Since it is an integer, users are advised to choose an
* appropriate unit to avoid loss of precision. Must be ≥ 0.
*
*
* int64 amount = 2;
*
* @return The amount.
*/
long getAmount();
}
/**
*
*
*
* When performing a visit, a predefined amount may be added to the vehicle
* load if it's a pickup, or subtracted if it's a delivery. This message
* defines such amount. See
* [load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* Protobuf type {@code google.maps.routeoptimization.v1.Shipment.Load}
*/
public static final class Load extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Shipment.Load)
LoadOrBuilder {
private static final long serialVersionUID = 0L;
// Use Load.newBuilder() to construct.
private Load(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Load() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Load();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_Load_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.maps.routeoptimization.v1.Shipment.Load.class,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder.class);
}
public static final int AMOUNT_FIELD_NUMBER = 2;
private long amount_ = 0L;
/**
*
*
*
* The amount by which the load of the vehicle performing the corresponding
* visit will vary. Since it is an integer, users are advised to choose an
* appropriate unit to avoid loss of precision. Must be ≥ 0.
*
*
* int64 amount = 2;
*
* @return The amount.
*/
@java.lang.Override
public long getAmount() {
return amount_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (amount_ != 0L) {
output.writeInt64(2, amount_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (amount_ != 0L) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, amount_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.maps.routeoptimization.v1.Shipment.Load)) {
return super.equals(obj);
}
com.google.maps.routeoptimization.v1.Shipment.Load other =
(com.google.maps.routeoptimization.v1.Shipment.Load) obj;
if (getAmount() != other.getAmount()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmount());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.maps.routeoptimization.v1.Shipment.Load prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* When performing a visit, a predefined amount may be added to the vehicle
* load if it's a pickup, or subtracted if it's a delivery. This message
* defines such amount. See
* [load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
*
*
* Protobuf type {@code google.maps.routeoptimization.v1.Shipment.Load}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Shipment.Load)
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_Load_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.maps.routeoptimization.v1.Shipment.Load.class,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder.class);
}
// Construct using com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
amount_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load getDefaultInstanceForType() {
return com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance();
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load build() {
com.google.maps.routeoptimization.v1.Shipment.Load result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load buildPartial() {
com.google.maps.routeoptimization.v1.Shipment.Load result =
new com.google.maps.routeoptimization.v1.Shipment.Load(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.maps.routeoptimization.v1.Shipment.Load result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.amount_ = amount_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.maps.routeoptimization.v1.Shipment.Load) {
return mergeFrom((com.google.maps.routeoptimization.v1.Shipment.Load) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.maps.routeoptimization.v1.Shipment.Load other) {
if (other == com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance())
return this;
if (other.getAmount() != 0L) {
setAmount(other.getAmount());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 16:
{
amount_ = input.readInt64();
bitField0_ |= 0x00000001;
break;
} // case 16
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private long amount_;
/**
*
*
*
* The amount by which the load of the vehicle performing the corresponding
* visit will vary. Since it is an integer, users are advised to choose an
* appropriate unit to avoid loss of precision. Must be ≥ 0.
*
*
* int64 amount = 2;
*
* @return The amount.
*/
@java.lang.Override
public long getAmount() {
return amount_;
}
/**
*
*
*
* The amount by which the load of the vehicle performing the corresponding
* visit will vary. Since it is an integer, users are advised to choose an
* appropriate unit to avoid loss of precision. Must be ≥ 0.
*
*
* int64 amount = 2;
*
* @param value The amount to set.
* @return This builder for chaining.
*/
public Builder setAmount(long value) {
amount_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The amount by which the load of the vehicle performing the corresponding
* visit will vary. Since it is an integer, users are advised to choose an
* appropriate unit to avoid loss of precision. Must be ≥ 0.
*
*
* int64 amount = 2;
*
* @return This builder for chaining.
*/
public Builder clearAmount() {
bitField0_ = (bitField0_ & ~0x00000001);
amount_ = 0L;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Shipment.Load)
}
// @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Shipment.Load)
private static final com.google.maps.routeoptimization.v1.Shipment.Load DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Shipment.Load();
}
public static com.google.maps.routeoptimization.v1.Shipment.Load getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Load parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int bitField0_;
public static final int DISPLAY_NAME_FIELD_NUMBER = 16;
@SuppressWarnings("serial")
private volatile java.lang.Object displayName_ = "";
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @return The displayName.
*/
@java.lang.Override
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
}
}
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @return The bytes for displayName.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PICKUPS_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List pickups_;
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
@java.lang.Override
public java.util.List
getPickupsList() {
return pickups_;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
@java.lang.Override
public java.util.List<
? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
getPickupsOrBuilderList() {
return pickups_;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
@java.lang.Override
public int getPickupsCount() {
return pickups_.size();
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getPickups(int index) {
return pickups_.get(index);
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getPickupsOrBuilder(
int index) {
return pickups_.get(index);
}
public static final int DELIVERIES_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List deliveries_;
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
@java.lang.Override
public java.util.List
getDeliveriesList() {
return deliveries_;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
@java.lang.Override
public java.util.List<
? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
getDeliveriesOrBuilderList() {
return deliveries_;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
@java.lang.Override
public int getDeliveriesCount() {
return deliveries_.size();
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDeliveries(int index) {
return deliveries_.get(index);
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getDeliveriesOrBuilder(
int index) {
return deliveries_.get(index);
}
public static final int LOAD_DEMANDS_FIELD_NUMBER = 14;
private static final class LoadDemandsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
defaultEntry =
com.google.protobuf.MapEntry
.
newDefaultInstance(
com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
loadDemands_;
private com.google.protobuf.MapField<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
internalGetLoadDemands() {
if (loadDemands_ == null) {
return com.google.protobuf.MapField.emptyMapField(LoadDemandsDefaultEntryHolder.defaultEntry);
}
return loadDemands_;
}
public int getLoadDemandsCount() {
return internalGetLoadDemands().getMap().size();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public boolean containsLoadDemands(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLoadDemands().getMap().containsKey(key);
}
/** Use {@link #getLoadDemandsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map
getLoadDemands() {
return getLoadDemandsMap();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public java.util.Map
getLoadDemandsMap() {
return internalGetLoadDemands().getMap();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrDefault(
java.lang.String key,
/* nullable */
com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map =
internalGetLoadDemands().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(
java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map =
internalGetLoadDemands().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int PENALTY_COST_FIELD_NUMBER = 4;
private double penaltyCost_ = 0D;
/**
*
*
*
* If the shipment is not completed, this penalty is added to the overall
* cost of the routes. A shipment is considered completed if one of its pickup
* and delivery alternatives is visited. The cost may be expressed in the
* same unit used for all other cost-related fields in the model and must be
* positive.
*
* *IMPORTANT*: If this penalty is not specified, it is considered infinite,
* i.e. the shipment must be completed.
*
*
* optional double penalty_cost = 4;
*
* @return Whether the penaltyCost field is set.
*/
@java.lang.Override
public boolean hasPenaltyCost() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* If the shipment is not completed, this penalty is added to the overall
* cost of the routes. A shipment is considered completed if one of its pickup
* and delivery alternatives is visited. The cost may be expressed in the
* same unit used for all other cost-related fields in the model and must be
* positive.
*
* *IMPORTANT*: If this penalty is not specified, it is considered infinite,
* i.e. the shipment must be completed.
*
*
* optional double penalty_cost = 4;
*
* @return The penaltyCost.
*/
@java.lang.Override
public double getPenaltyCost() {
return penaltyCost_;
}
public static final int ALLOWED_VEHICLE_INDICES_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.IntList allowedVehicleIndices_ = emptyIntList();
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @return A list containing the allowedVehicleIndices.
*/
@java.lang.Override
public java.util.List getAllowedVehicleIndicesList() {
return allowedVehicleIndices_;
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @return The count of allowedVehicleIndices.
*/
public int getAllowedVehicleIndicesCount() {
return allowedVehicleIndices_.size();
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @param index The index of the element to return.
* @return The allowedVehicleIndices at the given index.
*/
public int getAllowedVehicleIndices(int index) {
return allowedVehicleIndices_.getInt(index);
}
private int allowedVehicleIndicesMemoizedSerializedSize = -1;
public static final int COSTS_PER_VEHICLE_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.DoubleList costsPerVehicle_ = emptyDoubleList();
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @return A list containing the costsPerVehicle.
*/
@java.lang.Override
public java.util.List getCostsPerVehicleList() {
return costsPerVehicle_;
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @return The count of costsPerVehicle.
*/
public int getCostsPerVehicleCount() {
return costsPerVehicle_.size();
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @param index The index of the element to return.
* @return The costsPerVehicle at the given index.
*/
public double getCostsPerVehicle(int index) {
return costsPerVehicle_.getDouble(index);
}
private int costsPerVehicleMemoizedSerializedSize = -1;
public static final int COSTS_PER_VEHICLE_INDICES_FIELD_NUMBER = 7;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.IntList costsPerVehicleIndices_ = emptyIntList();
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @return A list containing the costsPerVehicleIndices.
*/
@java.lang.Override
public java.util.List getCostsPerVehicleIndicesList() {
return costsPerVehicleIndices_;
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @return The count of costsPerVehicleIndices.
*/
public int getCostsPerVehicleIndicesCount() {
return costsPerVehicleIndices_.size();
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @param index The index of the element to return.
* @return The costsPerVehicleIndices at the given index.
*/
public int getCostsPerVehicleIndices(int index) {
return costsPerVehicleIndices_.getInt(index);
}
private int costsPerVehicleIndicesMemoizedSerializedSize = -1;
public static final int PICKUP_TO_DELIVERY_RELATIVE_DETOUR_LIMIT_FIELD_NUMBER = 8;
private double pickupToDeliveryRelativeDetourLimit_ = 0D;
/**
*
*
*
* Specifies the maximum relative detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_relative_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* optional double pickup_to_delivery_relative_detour_limit = 8;
*
* @return Whether the pickupToDeliveryRelativeDetourLimit field is set.
*/
@java.lang.Override
public boolean hasPickupToDeliveryRelativeDetourLimit() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* Specifies the maximum relative detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_relative_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* optional double pickup_to_delivery_relative_detour_limit = 8;
*
* @return The pickupToDeliveryRelativeDetourLimit.
*/
@java.lang.Override
public double getPickupToDeliveryRelativeDetourLimit() {
return pickupToDeliveryRelativeDetourLimit_;
}
public static final int PICKUP_TO_DELIVERY_ABSOLUTE_DETOUR_LIMIT_FIELD_NUMBER = 9;
private com.google.protobuf.Duration pickupToDeliveryAbsoluteDetourLimit_;
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*
* @return Whether the pickupToDeliveryAbsoluteDetourLimit field is set.
*/
@java.lang.Override
public boolean hasPickupToDeliveryAbsoluteDetourLimit() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*
* @return The pickupToDeliveryAbsoluteDetourLimit.
*/
@java.lang.Override
public com.google.protobuf.Duration getPickupToDeliveryAbsoluteDetourLimit() {
return pickupToDeliveryAbsoluteDetourLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryAbsoluteDetourLimit_;
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder() {
return pickupToDeliveryAbsoluteDetourLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryAbsoluteDetourLimit_;
}
public static final int PICKUP_TO_DELIVERY_TIME_LIMIT_FIELD_NUMBER = 10;
private com.google.protobuf.Duration pickupToDeliveryTimeLimit_;
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*
* @return Whether the pickupToDeliveryTimeLimit field is set.
*/
@java.lang.Override
public boolean hasPickupToDeliveryTimeLimit() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*
* @return The pickupToDeliveryTimeLimit.
*/
@java.lang.Override
public com.google.protobuf.Duration getPickupToDeliveryTimeLimit() {
return pickupToDeliveryTimeLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryTimeLimit_;
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder() {
return pickupToDeliveryTimeLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryTimeLimit_;
}
public static final int SHIPMENT_TYPE_FIELD_NUMBER = 11;
@SuppressWarnings("serial")
private volatile java.lang.Object shipmentType_ = "";
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @return The shipmentType.
*/
@java.lang.Override
public java.lang.String getShipmentType() {
java.lang.Object ref = shipmentType_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
shipmentType_ = s;
return s;
}
}
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @return The bytes for shipmentType.
*/
@java.lang.Override
public com.google.protobuf.ByteString getShipmentTypeBytes() {
java.lang.Object ref = shipmentType_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
shipmentType_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LABEL_FIELD_NUMBER = 12;
@SuppressWarnings("serial")
private volatile java.lang.Object label_ = "";
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @return The label.
*/
@java.lang.Override
public java.lang.String getLabel() {
java.lang.Object ref = label_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
label_ = s;
return s;
}
}
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @return The bytes for label.
*/
@java.lang.Override
public com.google.protobuf.ByteString getLabelBytes() {
java.lang.Object ref = label_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
label_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int IGNORE_FIELD_NUMBER = 13;
private boolean ignore_ = false;
/**
*
*
*
* If true, skip this shipment, but don't apply a `penalty_cost`.
*
* Ignoring a shipment results in a validation error when there are any
* `shipment_type_requirements` in the model.
*
* Ignoring a shipment that is performed in `injected_first_solution_routes`
* or `injected_solution_constraint` is permitted; the solver removes the
* related pickup/delivery visits from the performing route.
* `precedence_rules` that reference ignored shipments will also be ignored.
*
*
* bool ignore = 13;
*
* @return The ignore.
*/
@java.lang.Override
public boolean getIgnore() {
return ignore_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < pickups_.size(); i++) {
output.writeMessage(1, pickups_.get(i));
}
for (int i = 0; i < deliveries_.size(); i++) {
output.writeMessage(2, deliveries_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeDouble(4, penaltyCost_);
}
if (getAllowedVehicleIndicesList().size() > 0) {
output.writeUInt32NoTag(42);
output.writeUInt32NoTag(allowedVehicleIndicesMemoizedSerializedSize);
}
for (int i = 0; i < allowedVehicleIndices_.size(); i++) {
output.writeInt32NoTag(allowedVehicleIndices_.getInt(i));
}
if (getCostsPerVehicleList().size() > 0) {
output.writeUInt32NoTag(50);
output.writeUInt32NoTag(costsPerVehicleMemoizedSerializedSize);
}
for (int i = 0; i < costsPerVehicle_.size(); i++) {
output.writeDoubleNoTag(costsPerVehicle_.getDouble(i));
}
if (getCostsPerVehicleIndicesList().size() > 0) {
output.writeUInt32NoTag(58);
output.writeUInt32NoTag(costsPerVehicleIndicesMemoizedSerializedSize);
}
for (int i = 0; i < costsPerVehicleIndices_.size(); i++) {
output.writeInt32NoTag(costsPerVehicleIndices_.getInt(i));
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeDouble(8, pickupToDeliveryRelativeDetourLimit_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeMessage(9, getPickupToDeliveryAbsoluteDetourLimit());
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeMessage(10, getPickupToDeliveryTimeLimit());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shipmentType_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 11, shipmentType_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 12, label_);
}
if (ignore_ != false) {
output.writeBool(13, ignore_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetLoadDemands(), LoadDemandsDefaultEntryHolder.defaultEntry, 14);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 16, displayName_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < pickups_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, pickups_.get(i));
}
for (int i = 0; i < deliveries_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, deliveries_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, penaltyCost_);
}
{
int dataSize = 0;
for (int i = 0; i < allowedVehicleIndices_.size(); i++) {
dataSize +=
com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(
allowedVehicleIndices_.getInt(i));
}
size += dataSize;
if (!getAllowedVehicleIndicesList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
}
allowedVehicleIndicesMemoizedSerializedSize = dataSize;
}
{
int dataSize = 0;
dataSize = 8 * getCostsPerVehicleList().size();
size += dataSize;
if (!getCostsPerVehicleList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
}
costsPerVehicleMemoizedSerializedSize = dataSize;
}
{
int dataSize = 0;
for (int i = 0; i < costsPerVehicleIndices_.size(); i++) {
dataSize +=
com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(
costsPerVehicleIndices_.getInt(i));
}
size += dataSize;
if (!getCostsPerVehicleIndicesList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
}
costsPerVehicleIndicesMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00000002) != 0)) {
size +=
com.google.protobuf.CodedOutputStream.computeDoubleSize(
8, pickupToDeliveryRelativeDetourLimit_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
9, getPickupToDeliveryAbsoluteDetourLimit());
}
if (((bitField0_ & 0x00000008) != 0)) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
10, getPickupToDeliveryTimeLimit());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shipmentType_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, shipmentType_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, label_);
}
if (ignore_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, ignore_);
}
for (java.util.Map.Entry
entry : internalGetLoadDemands().getMap().entrySet()) {
com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
loadDemands__ =
LoadDemandsDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, loadDemands__);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, displayName_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.maps.routeoptimization.v1.Shipment)) {
return super.equals(obj);
}
com.google.maps.routeoptimization.v1.Shipment other =
(com.google.maps.routeoptimization.v1.Shipment) obj;
if (!getDisplayName().equals(other.getDisplayName())) return false;
if (!getPickupsList().equals(other.getPickupsList())) return false;
if (!getDeliveriesList().equals(other.getDeliveriesList())) return false;
if (!internalGetLoadDemands().equals(other.internalGetLoadDemands())) return false;
if (hasPenaltyCost() != other.hasPenaltyCost()) return false;
if (hasPenaltyCost()) {
if (java.lang.Double.doubleToLongBits(getPenaltyCost())
!= java.lang.Double.doubleToLongBits(other.getPenaltyCost())) return false;
}
if (!getAllowedVehicleIndicesList().equals(other.getAllowedVehicleIndicesList())) return false;
if (!getCostsPerVehicleList().equals(other.getCostsPerVehicleList())) return false;
if (!getCostsPerVehicleIndicesList().equals(other.getCostsPerVehicleIndicesList()))
return false;
if (hasPickupToDeliveryRelativeDetourLimit() != other.hasPickupToDeliveryRelativeDetourLimit())
return false;
if (hasPickupToDeliveryRelativeDetourLimit()) {
if (java.lang.Double.doubleToLongBits(getPickupToDeliveryRelativeDetourLimit())
!= java.lang.Double.doubleToLongBits(other.getPickupToDeliveryRelativeDetourLimit()))
return false;
}
if (hasPickupToDeliveryAbsoluteDetourLimit() != other.hasPickupToDeliveryAbsoluteDetourLimit())
return false;
if (hasPickupToDeliveryAbsoluteDetourLimit()) {
if (!getPickupToDeliveryAbsoluteDetourLimit()
.equals(other.getPickupToDeliveryAbsoluteDetourLimit())) return false;
}
if (hasPickupToDeliveryTimeLimit() != other.hasPickupToDeliveryTimeLimit()) return false;
if (hasPickupToDeliveryTimeLimit()) {
if (!getPickupToDeliveryTimeLimit().equals(other.getPickupToDeliveryTimeLimit()))
return false;
}
if (!getShipmentType().equals(other.getShipmentType())) return false;
if (!getLabel().equals(other.getLabel())) return false;
if (getIgnore() != other.getIgnore()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
hash = (53 * hash) + getDisplayName().hashCode();
if (getPickupsCount() > 0) {
hash = (37 * hash) + PICKUPS_FIELD_NUMBER;
hash = (53 * hash) + getPickupsList().hashCode();
}
if (getDeliveriesCount() > 0) {
hash = (37 * hash) + DELIVERIES_FIELD_NUMBER;
hash = (53 * hash) + getDeliveriesList().hashCode();
}
if (!internalGetLoadDemands().getMap().isEmpty()) {
hash = (37 * hash) + LOAD_DEMANDS_FIELD_NUMBER;
hash = (53 * hash) + internalGetLoadDemands().hashCode();
}
if (hasPenaltyCost()) {
hash = (37 * hash) + PENALTY_COST_FIELD_NUMBER;
hash =
(53 * hash)
+ com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getPenaltyCost()));
}
if (getAllowedVehicleIndicesCount() > 0) {
hash = (37 * hash) + ALLOWED_VEHICLE_INDICES_FIELD_NUMBER;
hash = (53 * hash) + getAllowedVehicleIndicesList().hashCode();
}
if (getCostsPerVehicleCount() > 0) {
hash = (37 * hash) + COSTS_PER_VEHICLE_FIELD_NUMBER;
hash = (53 * hash) + getCostsPerVehicleList().hashCode();
}
if (getCostsPerVehicleIndicesCount() > 0) {
hash = (37 * hash) + COSTS_PER_VEHICLE_INDICES_FIELD_NUMBER;
hash = (53 * hash) + getCostsPerVehicleIndicesList().hashCode();
}
if (hasPickupToDeliveryRelativeDetourLimit()) {
hash = (37 * hash) + PICKUP_TO_DELIVERY_RELATIVE_DETOUR_LIMIT_FIELD_NUMBER;
hash =
(53 * hash)
+ com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getPickupToDeliveryRelativeDetourLimit()));
}
if (hasPickupToDeliveryAbsoluteDetourLimit()) {
hash = (37 * hash) + PICKUP_TO_DELIVERY_ABSOLUTE_DETOUR_LIMIT_FIELD_NUMBER;
hash = (53 * hash) + getPickupToDeliveryAbsoluteDetourLimit().hashCode();
}
if (hasPickupToDeliveryTimeLimit()) {
hash = (37 * hash) + PICKUP_TO_DELIVERY_TIME_LIMIT_FIELD_NUMBER;
hash = (53 * hash) + getPickupToDeliveryTimeLimit().hashCode();
}
hash = (37 * hash) + SHIPMENT_TYPE_FIELD_NUMBER;
hash = (53 * hash) + getShipmentType().hashCode();
hash = (37 * hash) + LABEL_FIELD_NUMBER;
hash = (53 * hash) + getLabel().hashCode();
hash = (37 * hash) + IGNORE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnore());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.maps.routeoptimization.v1.Shipment parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.maps.routeoptimization.v1.Shipment prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* The shipment of a single item, from one of its pickups to one of its
* deliveries. For the shipment to be considered as performed, a unique vehicle
* must visit one of its pickup locations (and decrease its spare capacities
* accordingly), then visit one of its delivery locations later on (and
* therefore re-increase its spare capacities accordingly).
*
*
* Protobuf type {@code google.maps.routeoptimization.v1.Shipment}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Shipment)
com.google.maps.routeoptimization.v1.ShipmentOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 14:
return internalGetLoadDemands();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 14:
return internalGetMutableLoadDemands();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.maps.routeoptimization.v1.Shipment.class,
com.google.maps.routeoptimization.v1.Shipment.Builder.class);
}
// Construct using com.google.maps.routeoptimization.v1.Shipment.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getPickupsFieldBuilder();
getDeliveriesFieldBuilder();
getPickupToDeliveryAbsoluteDetourLimitFieldBuilder();
getPickupToDeliveryTimeLimitFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
displayName_ = "";
if (pickupsBuilder_ == null) {
pickups_ = java.util.Collections.emptyList();
} else {
pickups_ = null;
pickupsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
if (deliveriesBuilder_ == null) {
deliveries_ = java.util.Collections.emptyList();
} else {
deliveries_ = null;
deliveriesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
internalGetMutableLoadDemands().clear();
penaltyCost_ = 0D;
allowedVehicleIndices_ = emptyIntList();
costsPerVehicle_ = emptyDoubleList();
costsPerVehicleIndices_ = emptyIntList();
pickupToDeliveryRelativeDetourLimit_ = 0D;
pickupToDeliveryAbsoluteDetourLimit_ = null;
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ != null) {
pickupToDeliveryAbsoluteDetourLimitBuilder_.dispose();
pickupToDeliveryAbsoluteDetourLimitBuilder_ = null;
}
pickupToDeliveryTimeLimit_ = null;
if (pickupToDeliveryTimeLimitBuilder_ != null) {
pickupToDeliveryTimeLimitBuilder_.dispose();
pickupToDeliveryTimeLimitBuilder_ = null;
}
shipmentType_ = "";
label_ = "";
ignore_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto
.internal_static_google_maps_routeoptimization_v1_Shipment_descriptor;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment getDefaultInstanceForType() {
return com.google.maps.routeoptimization.v1.Shipment.getDefaultInstance();
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment build() {
com.google.maps.routeoptimization.v1.Shipment result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment buildPartial() {
com.google.maps.routeoptimization.v1.Shipment result =
new com.google.maps.routeoptimization.v1.Shipment(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.maps.routeoptimization.v1.Shipment result) {
if (pickupsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
pickups_ = java.util.Collections.unmodifiableList(pickups_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.pickups_ = pickups_;
} else {
result.pickups_ = pickupsBuilder_.build();
}
if (deliveriesBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
deliveries_ = java.util.Collections.unmodifiableList(deliveries_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.deliveries_ = deliveries_;
} else {
result.deliveries_ = deliveriesBuilder_.build();
}
}
private void buildPartial0(com.google.maps.routeoptimization.v1.Shipment result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.displayName_ = displayName_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.loadDemands_ =
internalGetLoadDemands().build(LoadDemandsDefaultEntryHolder.defaultEntry);
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000010) != 0)) {
result.penaltyCost_ = penaltyCost_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
allowedVehicleIndices_.makeImmutable();
result.allowedVehicleIndices_ = allowedVehicleIndices_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
costsPerVehicle_.makeImmutable();
result.costsPerVehicle_ = costsPerVehicle_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
costsPerVehicleIndices_.makeImmutable();
result.costsPerVehicleIndices_ = costsPerVehicleIndices_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.pickupToDeliveryRelativeDetourLimit_ = pickupToDeliveryRelativeDetourLimit_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.pickupToDeliveryAbsoluteDetourLimit_ =
pickupToDeliveryAbsoluteDetourLimitBuilder_ == null
? pickupToDeliveryAbsoluteDetourLimit_
: pickupToDeliveryAbsoluteDetourLimitBuilder_.build();
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.pickupToDeliveryTimeLimit_ =
pickupToDeliveryTimeLimitBuilder_ == null
? pickupToDeliveryTimeLimit_
: pickupToDeliveryTimeLimitBuilder_.build();
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000800) != 0)) {
result.shipmentType_ = shipmentType_;
}
if (((from_bitField0_ & 0x00001000) != 0)) {
result.label_ = label_;
}
if (((from_bitField0_ & 0x00002000) != 0)) {
result.ignore_ = ignore_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.maps.routeoptimization.v1.Shipment) {
return mergeFrom((com.google.maps.routeoptimization.v1.Shipment) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.maps.routeoptimization.v1.Shipment other) {
if (other == com.google.maps.routeoptimization.v1.Shipment.getDefaultInstance()) return this;
if (!other.getDisplayName().isEmpty()) {
displayName_ = other.displayName_;
bitField0_ |= 0x00000001;
onChanged();
}
if (pickupsBuilder_ == null) {
if (!other.pickups_.isEmpty()) {
if (pickups_.isEmpty()) {
pickups_ = other.pickups_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensurePickupsIsMutable();
pickups_.addAll(other.pickups_);
}
onChanged();
}
} else {
if (!other.pickups_.isEmpty()) {
if (pickupsBuilder_.isEmpty()) {
pickupsBuilder_.dispose();
pickupsBuilder_ = null;
pickups_ = other.pickups_;
bitField0_ = (bitField0_ & ~0x00000002);
pickupsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getPickupsFieldBuilder()
: null;
} else {
pickupsBuilder_.addAllMessages(other.pickups_);
}
}
}
if (deliveriesBuilder_ == null) {
if (!other.deliveries_.isEmpty()) {
if (deliveries_.isEmpty()) {
deliveries_ = other.deliveries_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureDeliveriesIsMutable();
deliveries_.addAll(other.deliveries_);
}
onChanged();
}
} else {
if (!other.deliveries_.isEmpty()) {
if (deliveriesBuilder_.isEmpty()) {
deliveriesBuilder_.dispose();
deliveriesBuilder_ = null;
deliveries_ = other.deliveries_;
bitField0_ = (bitField0_ & ~0x00000004);
deliveriesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getDeliveriesFieldBuilder()
: null;
} else {
deliveriesBuilder_.addAllMessages(other.deliveries_);
}
}
}
internalGetMutableLoadDemands().mergeFrom(other.internalGetLoadDemands());
bitField0_ |= 0x00000008;
if (other.hasPenaltyCost()) {
setPenaltyCost(other.getPenaltyCost());
}
if (!other.allowedVehicleIndices_.isEmpty()) {
if (allowedVehicleIndices_.isEmpty()) {
allowedVehicleIndices_ = other.allowedVehicleIndices_;
allowedVehicleIndices_.makeImmutable();
bitField0_ |= 0x00000020;
} else {
ensureAllowedVehicleIndicesIsMutable();
allowedVehicleIndices_.addAll(other.allowedVehicleIndices_);
}
onChanged();
}
if (!other.costsPerVehicle_.isEmpty()) {
if (costsPerVehicle_.isEmpty()) {
costsPerVehicle_ = other.costsPerVehicle_;
costsPerVehicle_.makeImmutable();
bitField0_ |= 0x00000040;
} else {
ensureCostsPerVehicleIsMutable();
costsPerVehicle_.addAll(other.costsPerVehicle_);
}
onChanged();
}
if (!other.costsPerVehicleIndices_.isEmpty()) {
if (costsPerVehicleIndices_.isEmpty()) {
costsPerVehicleIndices_ = other.costsPerVehicleIndices_;
costsPerVehicleIndices_.makeImmutable();
bitField0_ |= 0x00000080;
} else {
ensureCostsPerVehicleIndicesIsMutable();
costsPerVehicleIndices_.addAll(other.costsPerVehicleIndices_);
}
onChanged();
}
if (other.hasPickupToDeliveryRelativeDetourLimit()) {
setPickupToDeliveryRelativeDetourLimit(other.getPickupToDeliveryRelativeDetourLimit());
}
if (other.hasPickupToDeliveryAbsoluteDetourLimit()) {
mergePickupToDeliveryAbsoluteDetourLimit(other.getPickupToDeliveryAbsoluteDetourLimit());
}
if (other.hasPickupToDeliveryTimeLimit()) {
mergePickupToDeliveryTimeLimit(other.getPickupToDeliveryTimeLimit());
}
if (!other.getShipmentType().isEmpty()) {
shipmentType_ = other.shipmentType_;
bitField0_ |= 0x00000800;
onChanged();
}
if (!other.getLabel().isEmpty()) {
label_ = other.label_;
bitField0_ |= 0x00001000;
onChanged();
}
if (other.getIgnore() != false) {
setIgnore(other.getIgnore());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
com.google.maps.routeoptimization.v1.Shipment.VisitRequest m =
input.readMessage(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.parser(),
extensionRegistry);
if (pickupsBuilder_ == null) {
ensurePickupsIsMutable();
pickups_.add(m);
} else {
pickupsBuilder_.addMessage(m);
}
break;
} // case 10
case 18:
{
com.google.maps.routeoptimization.v1.Shipment.VisitRequest m =
input.readMessage(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.parser(),
extensionRegistry);
if (deliveriesBuilder_ == null) {
ensureDeliveriesIsMutable();
deliveries_.add(m);
} else {
deliveriesBuilder_.addMessage(m);
}
break;
} // case 18
case 33:
{
penaltyCost_ = input.readDouble();
bitField0_ |= 0x00000010;
break;
} // case 33
case 40:
{
int v = input.readInt32();
ensureAllowedVehicleIndicesIsMutable();
allowedVehicleIndices_.addInt(v);
break;
} // case 40
case 42:
{
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
ensureAllowedVehicleIndicesIsMutable();
while (input.getBytesUntilLimit() > 0) {
allowedVehicleIndices_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
} // case 42
case 49:
{
double v = input.readDouble();
ensureCostsPerVehicleIsMutable();
costsPerVehicle_.addDouble(v);
break;
} // case 49
case 50:
{
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
int alloc = length > 4096 ? 4096 : length;
ensureCostsPerVehicleIsMutable(alloc / 8);
while (input.getBytesUntilLimit() > 0) {
costsPerVehicle_.addDouble(input.readDouble());
}
input.popLimit(limit);
break;
} // case 50
case 56:
{
int v = input.readInt32();
ensureCostsPerVehicleIndicesIsMutable();
costsPerVehicleIndices_.addInt(v);
break;
} // case 56
case 58:
{
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
ensureCostsPerVehicleIndicesIsMutable();
while (input.getBytesUntilLimit() > 0) {
costsPerVehicleIndices_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
} // case 58
case 65:
{
pickupToDeliveryRelativeDetourLimit_ = input.readDouble();
bitField0_ |= 0x00000100;
break;
} // case 65
case 74:
{
input.readMessage(
getPickupToDeliveryAbsoluteDetourLimitFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000200;
break;
} // case 74
case 82:
{
input.readMessage(
getPickupToDeliveryTimeLimitFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000400;
break;
} // case 82
case 90:
{
shipmentType_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000800;
break;
} // case 90
case 98:
{
label_ = input.readStringRequireUtf8();
bitField0_ |= 0x00001000;
break;
} // case 98
case 104:
{
ignore_ = input.readBool();
bitField0_ |= 0x00002000;
break;
} // case 104
case 114:
{
com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
loadDemands__ =
input.readMessage(
LoadDemandsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableLoadDemands()
.ensureBuilderMap()
.put(loadDemands__.getKey(), loadDemands__.getValue());
bitField0_ |= 0x00000008;
break;
} // case 114
case 130:
{
displayName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 130
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object displayName_ = "";
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @return The displayName.
*/
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @return The bytes for displayName.
*/
public com.google.protobuf.ByteString getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @param value The displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
displayName_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @return This builder for chaining.
*/
public Builder clearDisplayName() {
displayName_ = getDefaultInstance().getDisplayName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* The user-defined display name of the shipment.
* It can be up to 63 characters long and may use UTF-8 characters.
*
*
* string display_name = 16;
*
* @param value The bytes for displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
displayName_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.util.List pickups_ =
java.util.Collections.emptyList();
private void ensurePickupsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
pickups_ =
new java.util.ArrayList(
pickups_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.Shipment.VisitRequest,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder,
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
pickupsBuilder_;
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public java.util.List
getPickupsList() {
if (pickupsBuilder_ == null) {
return java.util.Collections.unmodifiableList(pickups_);
} else {
return pickupsBuilder_.getMessageList();
}
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public int getPickupsCount() {
if (pickupsBuilder_ == null) {
return pickups_.size();
} else {
return pickupsBuilder_.getCount();
}
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getPickups(int index) {
if (pickupsBuilder_ == null) {
return pickups_.get(index);
} else {
return pickupsBuilder_.getMessage(index);
}
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder setPickups(
int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) {
if (pickupsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePickupsIsMutable();
pickups_.set(index, value);
onChanged();
} else {
pickupsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder setPickups(
int index,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) {
if (pickupsBuilder_ == null) {
ensurePickupsIsMutable();
pickups_.set(index, builderForValue.build());
onChanged();
} else {
pickupsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder addPickups(com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) {
if (pickupsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePickupsIsMutable();
pickups_.add(value);
onChanged();
} else {
pickupsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder addPickups(
int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) {
if (pickupsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePickupsIsMutable();
pickups_.add(index, value);
onChanged();
} else {
pickupsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder addPickups(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) {
if (pickupsBuilder_ == null) {
ensurePickupsIsMutable();
pickups_.add(builderForValue.build());
onChanged();
} else {
pickupsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder addPickups(
int index,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) {
if (pickupsBuilder_ == null) {
ensurePickupsIsMutable();
pickups_.add(index, builderForValue.build());
onChanged();
} else {
pickupsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder addAllPickups(
java.lang.Iterable extends com.google.maps.routeoptimization.v1.Shipment.VisitRequest>
values) {
if (pickupsBuilder_ == null) {
ensurePickupsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pickups_);
onChanged();
} else {
pickupsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder clearPickups() {
if (pickupsBuilder_ == null) {
pickups_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
pickupsBuilder_.clear();
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public Builder removePickups(int index) {
if (pickupsBuilder_ == null) {
ensurePickupsIsMutable();
pickups_.remove(index);
onChanged();
} else {
pickupsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder getPickupsBuilder(
int index) {
return getPickupsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getPickupsOrBuilder(
int index) {
if (pickupsBuilder_ == null) {
return pickups_.get(index);
} else {
return pickupsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public java.util.List<
? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
getPickupsOrBuilderList() {
if (pickupsBuilder_ != null) {
return pickupsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(pickups_);
}
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder addPickupsBuilder() {
return getPickupsFieldBuilder()
.addBuilder(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance());
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder addPickupsBuilder(
int index) {
return getPickupsFieldBuilder()
.addBuilder(
index,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance());
}
/**
*
*
*
* Set of pickup alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the deliveries.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1;
*/
public java.util.List
getPickupsBuilderList() {
return getPickupsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.Shipment.VisitRequest,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder,
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
getPickupsFieldBuilder() {
if (pickupsBuilder_ == null) {
pickupsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.Shipment.VisitRequest,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder,
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>(
pickups_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean());
pickups_ = null;
}
return pickupsBuilder_;
}
private java.util.List deliveries_ =
java.util.Collections.emptyList();
private void ensureDeliveriesIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
deliveries_ =
new java.util.ArrayList(
deliveries_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.Shipment.VisitRequest,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder,
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
deliveriesBuilder_;
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public java.util.List
getDeliveriesList() {
if (deliveriesBuilder_ == null) {
return java.util.Collections.unmodifiableList(deliveries_);
} else {
return deliveriesBuilder_.getMessageList();
}
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public int getDeliveriesCount() {
if (deliveriesBuilder_ == null) {
return deliveries_.size();
} else {
return deliveriesBuilder_.getCount();
}
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDeliveries(int index) {
if (deliveriesBuilder_ == null) {
return deliveries_.get(index);
} else {
return deliveriesBuilder_.getMessage(index);
}
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder setDeliveries(
int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) {
if (deliveriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDeliveriesIsMutable();
deliveries_.set(index, value);
onChanged();
} else {
deliveriesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder setDeliveries(
int index,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) {
if (deliveriesBuilder_ == null) {
ensureDeliveriesIsMutable();
deliveries_.set(index, builderForValue.build());
onChanged();
} else {
deliveriesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder addDeliveries(com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) {
if (deliveriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDeliveriesIsMutable();
deliveries_.add(value);
onChanged();
} else {
deliveriesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder addDeliveries(
int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) {
if (deliveriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDeliveriesIsMutable();
deliveries_.add(index, value);
onChanged();
} else {
deliveriesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder addDeliveries(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) {
if (deliveriesBuilder_ == null) {
ensureDeliveriesIsMutable();
deliveries_.add(builderForValue.build());
onChanged();
} else {
deliveriesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder addDeliveries(
int index,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) {
if (deliveriesBuilder_ == null) {
ensureDeliveriesIsMutable();
deliveries_.add(index, builderForValue.build());
onChanged();
} else {
deliveriesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder addAllDeliveries(
java.lang.Iterable extends com.google.maps.routeoptimization.v1.Shipment.VisitRequest>
values) {
if (deliveriesBuilder_ == null) {
ensureDeliveriesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deliveries_);
onChanged();
} else {
deliveriesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder clearDeliveries() {
if (deliveriesBuilder_ == null) {
deliveries_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
deliveriesBuilder_.clear();
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public Builder removeDeliveries(int index) {
if (deliveriesBuilder_ == null) {
ensureDeliveriesIsMutable();
deliveries_.remove(index);
onChanged();
} else {
deliveriesBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder getDeliveriesBuilder(
int index) {
return getDeliveriesFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder
getDeliveriesOrBuilder(int index) {
if (deliveriesBuilder_ == null) {
return deliveries_.get(index);
} else {
return deliveriesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public java.util.List<
? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
getDeliveriesOrBuilderList() {
if (deliveriesBuilder_ != null) {
return deliveriesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(deliveries_);
}
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder
addDeliveriesBuilder() {
return getDeliveriesFieldBuilder()
.addBuilder(
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance());
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder addDeliveriesBuilder(
int index) {
return getDeliveriesFieldBuilder()
.addBuilder(
index,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance());
}
/**
*
*
*
* Set of delivery alternatives associated to the shipment. If not specified,
* the vehicle only needs to visit a location corresponding to the pickups.
*
*
* repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2;
*/
public java.util.List
getDeliveriesBuilderList() {
return getDeliveriesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.Shipment.VisitRequest,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder,
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>
getDeliveriesFieldBuilder() {
if (deliveriesBuilder_ == null) {
deliveriesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.maps.routeoptimization.v1.Shipment.VisitRequest,
com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder,
com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>(
deliveries_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean());
deliveries_ = null;
}
return deliveriesBuilder_;
}
private static final class LoadDemandsConverter
implements com.google.protobuf.MapFieldBuilder.Converter<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load> {
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load build(
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder val) {
if (val instanceof com.google.maps.routeoptimization.v1.Shipment.Load) {
return (com.google.maps.routeoptimization.v1.Shipment.Load) val;
}
return ((com.google.maps.routeoptimization.v1.Shipment.Load.Builder) val).build();
}
@java.lang.Override
public com.google.protobuf.MapEntry<
java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load>
defaultEntry() {
return LoadDemandsDefaultEntryHolder.defaultEntry;
}
};
private static final LoadDemandsConverter loadDemandsConverter = new LoadDemandsConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder>
loadDemands_;
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder>
internalGetLoadDemands() {
if (loadDemands_ == null) {
return new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter);
}
return loadDemands_;
}
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder,
com.google.maps.routeoptimization.v1.Shipment.Load,
com.google.maps.routeoptimization.v1.Shipment.Load.Builder>
internalGetMutableLoadDemands() {
if (loadDemands_ == null) {
loadDemands_ = new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter);
}
bitField0_ |= 0x00000008;
onChanged();
return loadDemands_;
}
public int getLoadDemandsCount() {
return internalGetLoadDemands().ensureBuilderMap().size();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public boolean containsLoadDemands(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLoadDemands().ensureBuilderMap().containsKey(key);
}
/** Use {@link #getLoadDemandsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map
getLoadDemands() {
return getLoadDemandsMap();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public java.util.Map
getLoadDemandsMap() {
return internalGetLoadDemands().getImmutableMap();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load
getLoadDemandsOrDefault(
java.lang.String key,
/* nullable */
com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map
map = internalGetMutableLoadDemands().ensureBuilderMap();
return map.containsKey(key) ? loadDemandsConverter.build(map.get(key)) : defaultValue;
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(
java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map
map = internalGetMutableLoadDemands().ensureBuilderMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return loadDemandsConverter.build(map.get(key));
}
public Builder clearLoadDemands() {
bitField0_ = (bitField0_ & ~0x00000008);
internalGetMutableLoadDemands().clear();
return this;
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
public Builder removeLoadDemands(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableLoadDemands().ensureBuilderMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map
getMutableLoadDemands() {
bitField0_ |= 0x00000008;
return internalGetMutableLoadDemands().ensureMessageMap();
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
public Builder putLoadDemands(
java.lang.String key, com.google.maps.routeoptimization.v1.Shipment.Load value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableLoadDemands().ensureBuilderMap().put(key, value);
bitField0_ |= 0x00000008;
return this;
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
public Builder putAllLoadDemands(
java.util.Map
values) {
for (java.util.Map.Entry
e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
throw new NullPointerException();
}
}
internalGetMutableLoadDemands().ensureBuilderMap().putAll(values);
bitField0_ |= 0x00000008;
return this;
}
/**
*
*
*
* Load demands of the shipment (for example weight, volume, number of
* pallets etc). The keys in the map should be identifiers describing the type
* of the corresponding load, ideally also including the units.
* For example: "weight_kg", "volume_gallons", "pallet_count", etc.
* If a given key does not appear in the map, the corresponding load is
* considered as null.
*
*
* map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14;
*
*/
public com.google.maps.routeoptimization.v1.Shipment.Load.Builder putLoadDemandsBuilderIfAbsent(
java.lang.String key) {
java.util.Map
builderMap = internalGetMutableLoadDemands().ensureBuilderMap();
com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder entry = builderMap.get(key);
if (entry == null) {
entry = com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder();
builderMap.put(key, entry);
}
if (entry instanceof com.google.maps.routeoptimization.v1.Shipment.Load) {
entry = ((com.google.maps.routeoptimization.v1.Shipment.Load) entry).toBuilder();
builderMap.put(key, entry);
}
return (com.google.maps.routeoptimization.v1.Shipment.Load.Builder) entry;
}
private double penaltyCost_;
/**
*
*
*
* If the shipment is not completed, this penalty is added to the overall
* cost of the routes. A shipment is considered completed if one of its pickup
* and delivery alternatives is visited. The cost may be expressed in the
* same unit used for all other cost-related fields in the model and must be
* positive.
*
* *IMPORTANT*: If this penalty is not specified, it is considered infinite,
* i.e. the shipment must be completed.
*
*
* optional double penalty_cost = 4;
*
* @return Whether the penaltyCost field is set.
*/
@java.lang.Override
public boolean hasPenaltyCost() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
*
*
* If the shipment is not completed, this penalty is added to the overall
* cost of the routes. A shipment is considered completed if one of its pickup
* and delivery alternatives is visited. The cost may be expressed in the
* same unit used for all other cost-related fields in the model and must be
* positive.
*
* *IMPORTANT*: If this penalty is not specified, it is considered infinite,
* i.e. the shipment must be completed.
*
*
* optional double penalty_cost = 4;
*
* @return The penaltyCost.
*/
@java.lang.Override
public double getPenaltyCost() {
return penaltyCost_;
}
/**
*
*
*
* If the shipment is not completed, this penalty is added to the overall
* cost of the routes. A shipment is considered completed if one of its pickup
* and delivery alternatives is visited. The cost may be expressed in the
* same unit used for all other cost-related fields in the model and must be
* positive.
*
* *IMPORTANT*: If this penalty is not specified, it is considered infinite,
* i.e. the shipment must be completed.
*
*
* optional double penalty_cost = 4;
*
* @param value The penaltyCost to set.
* @return This builder for chaining.
*/
public Builder setPenaltyCost(double value) {
penaltyCost_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* If the shipment is not completed, this penalty is added to the overall
* cost of the routes. A shipment is considered completed if one of its pickup
* and delivery alternatives is visited. The cost may be expressed in the
* same unit used for all other cost-related fields in the model and must be
* positive.
*
* *IMPORTANT*: If this penalty is not specified, it is considered infinite,
* i.e. the shipment must be completed.
*
*
* optional double penalty_cost = 4;
*
* @return This builder for chaining.
*/
public Builder clearPenaltyCost() {
bitField0_ = (bitField0_ & ~0x00000010);
penaltyCost_ = 0D;
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList allowedVehicleIndices_ = emptyIntList();
private void ensureAllowedVehicleIndicesIsMutable() {
if (!allowedVehicleIndices_.isModifiable()) {
allowedVehicleIndices_ = makeMutableCopy(allowedVehicleIndices_);
}
bitField0_ |= 0x00000020;
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @return A list containing the allowedVehicleIndices.
*/
public java.util.List getAllowedVehicleIndicesList() {
allowedVehicleIndices_.makeImmutable();
return allowedVehicleIndices_;
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @return The count of allowedVehicleIndices.
*/
public int getAllowedVehicleIndicesCount() {
return allowedVehicleIndices_.size();
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @param index The index of the element to return.
* @return The allowedVehicleIndices at the given index.
*/
public int getAllowedVehicleIndices(int index) {
return allowedVehicleIndices_.getInt(index);
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @param index The index to set the value at.
* @param value The allowedVehicleIndices to set.
* @return This builder for chaining.
*/
public Builder setAllowedVehicleIndices(int index, int value) {
ensureAllowedVehicleIndicesIsMutable();
allowedVehicleIndices_.setInt(index, value);
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @param value The allowedVehicleIndices to add.
* @return This builder for chaining.
*/
public Builder addAllowedVehicleIndices(int value) {
ensureAllowedVehicleIndicesIsMutable();
allowedVehicleIndices_.addInt(value);
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @param values The allowedVehicleIndices to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedVehicleIndices(
java.lang.Iterable extends java.lang.Integer> values) {
ensureAllowedVehicleIndicesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedVehicleIndices_);
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The set of vehicles that may perform this shipment. If empty, all vehicles
* may perform it. Vehicles are given by their index in the `ShipmentModel`'s
* `vehicles` list.
*
*
* repeated int32 allowed_vehicle_indices = 5;
*
* @return This builder for chaining.
*/
public Builder clearAllowedVehicleIndices() {
allowedVehicleIndices_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
return this;
}
private com.google.protobuf.Internal.DoubleList costsPerVehicle_ = emptyDoubleList();
private void ensureCostsPerVehicleIsMutable() {
if (!costsPerVehicle_.isModifiable()) {
costsPerVehicle_ = makeMutableCopy(costsPerVehicle_);
}
bitField0_ |= 0x00000040;
}
private void ensureCostsPerVehicleIsMutable(int capacity) {
if (!costsPerVehicle_.isModifiable()) {
costsPerVehicle_ = makeMutableCopy(costsPerVehicle_, capacity);
}
bitField0_ |= 0x00000040;
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @return A list containing the costsPerVehicle.
*/
public java.util.List getCostsPerVehicleList() {
costsPerVehicle_.makeImmutable();
return costsPerVehicle_;
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @return The count of costsPerVehicle.
*/
public int getCostsPerVehicleCount() {
return costsPerVehicle_.size();
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @param index The index of the element to return.
* @return The costsPerVehicle at the given index.
*/
public double getCostsPerVehicle(int index) {
return costsPerVehicle_.getDouble(index);
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @param index The index to set the value at.
* @param value The costsPerVehicle to set.
* @return This builder for chaining.
*/
public Builder setCostsPerVehicle(int index, double value) {
ensureCostsPerVehicleIsMutable();
costsPerVehicle_.setDouble(index, value);
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @param value The costsPerVehicle to add.
* @return This builder for chaining.
*/
public Builder addCostsPerVehicle(double value) {
ensureCostsPerVehicleIsMutable();
costsPerVehicle_.addDouble(value);
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @param values The costsPerVehicle to add.
* @return This builder for chaining.
*/
public Builder addAllCostsPerVehicle(java.lang.Iterable extends java.lang.Double> values) {
ensureCostsPerVehicleIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, costsPerVehicle_);
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* Specifies the cost that is incurred when this shipment is delivered by each
* vehicle. If specified, it must have EITHER:
*
* * the same number of elements as `costs_per_vehicle_indices`.
* `costs_per_vehicle[i]` corresponds to vehicle
* `costs_per_vehicle_indices[i]` of the model.
* * the same number of elements as there are vehicles in the model. The
* i-th element corresponds to vehicle #i of the model.
*
* These costs must be in the same unit as `penalty_cost` and must not be
* negative. Leave this field empty, if there are no such costs.
*
*
* repeated double costs_per_vehicle = 6;
*
* @return This builder for chaining.
*/
public Builder clearCostsPerVehicle() {
costsPerVehicle_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList costsPerVehicleIndices_ = emptyIntList();
private void ensureCostsPerVehicleIndicesIsMutable() {
if (!costsPerVehicleIndices_.isModifiable()) {
costsPerVehicleIndices_ = makeMutableCopy(costsPerVehicleIndices_);
}
bitField0_ |= 0x00000080;
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @return A list containing the costsPerVehicleIndices.
*/
public java.util.List getCostsPerVehicleIndicesList() {
costsPerVehicleIndices_.makeImmutable();
return costsPerVehicleIndices_;
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @return The count of costsPerVehicleIndices.
*/
public int getCostsPerVehicleIndicesCount() {
return costsPerVehicleIndices_.size();
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @param index The index of the element to return.
* @return The costsPerVehicleIndices at the given index.
*/
public int getCostsPerVehicleIndices(int index) {
return costsPerVehicleIndices_.getInt(index);
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @param index The index to set the value at.
* @param value The costsPerVehicleIndices to set.
* @return This builder for chaining.
*/
public Builder setCostsPerVehicleIndices(int index, int value) {
ensureCostsPerVehicleIndicesIsMutable();
costsPerVehicleIndices_.setInt(index, value);
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @param value The costsPerVehicleIndices to add.
* @return This builder for chaining.
*/
public Builder addCostsPerVehicleIndices(int value) {
ensureCostsPerVehicleIndicesIsMutable();
costsPerVehicleIndices_.addInt(value);
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @param values The costsPerVehicleIndices to add.
* @return This builder for chaining.
*/
public Builder addAllCostsPerVehicleIndices(
java.lang.Iterable extends java.lang.Integer> values) {
ensureCostsPerVehicleIndicesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, costsPerVehicleIndices_);
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
* it must have the same number of elements as `costs_per_vehicle`. A vehicle
* index may not be specified more than once. If a vehicle is excluded from
* `costs_per_vehicle_indices`, its cost is zero.
*
*
* repeated int32 costs_per_vehicle_indices = 7;
*
* @return This builder for chaining.
*/
public Builder clearCostsPerVehicleIndices() {
costsPerVehicleIndices_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000080);
onChanged();
return this;
}
private double pickupToDeliveryRelativeDetourLimit_;
/**
*
*
*
* Specifies the maximum relative detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_relative_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* optional double pickup_to_delivery_relative_detour_limit = 8;
*
* @return Whether the pickupToDeliveryRelativeDetourLimit field is set.
*/
@java.lang.Override
public boolean hasPickupToDeliveryRelativeDetourLimit() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
*
*
* Specifies the maximum relative detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_relative_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* optional double pickup_to_delivery_relative_detour_limit = 8;
*
* @return The pickupToDeliveryRelativeDetourLimit.
*/
@java.lang.Override
public double getPickupToDeliveryRelativeDetourLimit() {
return pickupToDeliveryRelativeDetourLimit_;
}
/**
*
*
*
* Specifies the maximum relative detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_relative_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* optional double pickup_to_delivery_relative_detour_limit = 8;
*
* @param value The pickupToDeliveryRelativeDetourLimit to set.
* @return This builder for chaining.
*/
public Builder setPickupToDeliveryRelativeDetourLimit(double value) {
pickupToDeliveryRelativeDetourLimit_ = value;
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum relative detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_relative_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* optional double pickup_to_delivery_relative_detour_limit = 8;
*
* @return This builder for chaining.
*/
public Builder clearPickupToDeliveryRelativeDetourLimit() {
bitField0_ = (bitField0_ & ~0x00000100);
pickupToDeliveryRelativeDetourLimit_ = 0D;
onChanged();
return this;
}
private com.google.protobuf.Duration pickupToDeliveryAbsoluteDetourLimit_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
pickupToDeliveryAbsoluteDetourLimitBuilder_;
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*
* @return Whether the pickupToDeliveryAbsoluteDetourLimit field is set.
*/
public boolean hasPickupToDeliveryAbsoluteDetourLimit() {
return ((bitField0_ & 0x00000200) != 0);
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*
* @return The pickupToDeliveryAbsoluteDetourLimit.
*/
public com.google.protobuf.Duration getPickupToDeliveryAbsoluteDetourLimit() {
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) {
return pickupToDeliveryAbsoluteDetourLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryAbsoluteDetourLimit_;
} else {
return pickupToDeliveryAbsoluteDetourLimitBuilder_.getMessage();
}
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
public Builder setPickupToDeliveryAbsoluteDetourLimit(com.google.protobuf.Duration value) {
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
pickupToDeliveryAbsoluteDetourLimit_ = value;
} else {
pickupToDeliveryAbsoluteDetourLimitBuilder_.setMessage(value);
}
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
public Builder setPickupToDeliveryAbsoluteDetourLimit(
com.google.protobuf.Duration.Builder builderForValue) {
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) {
pickupToDeliveryAbsoluteDetourLimit_ = builderForValue.build();
} else {
pickupToDeliveryAbsoluteDetourLimitBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
public Builder mergePickupToDeliveryAbsoluteDetourLimit(com.google.protobuf.Duration value) {
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) {
if (((bitField0_ & 0x00000200) != 0)
&& pickupToDeliveryAbsoluteDetourLimit_ != null
&& pickupToDeliveryAbsoluteDetourLimit_
!= com.google.protobuf.Duration.getDefaultInstance()) {
getPickupToDeliveryAbsoluteDetourLimitBuilder().mergeFrom(value);
} else {
pickupToDeliveryAbsoluteDetourLimit_ = value;
}
} else {
pickupToDeliveryAbsoluteDetourLimitBuilder_.mergeFrom(value);
}
if (pickupToDeliveryAbsoluteDetourLimit_ != null) {
bitField0_ |= 0x00000200;
onChanged();
}
return this;
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
public Builder clearPickupToDeliveryAbsoluteDetourLimit() {
bitField0_ = (bitField0_ & ~0x00000200);
pickupToDeliveryAbsoluteDetourLimit_ = null;
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ != null) {
pickupToDeliveryAbsoluteDetourLimitBuilder_.dispose();
pickupToDeliveryAbsoluteDetourLimitBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
public com.google.protobuf.Duration.Builder getPickupToDeliveryAbsoluteDetourLimitBuilder() {
bitField0_ |= 0x00000200;
onChanged();
return getPickupToDeliveryAbsoluteDetourLimitFieldBuilder().getBuilder();
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
public com.google.protobuf.DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder() {
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ != null) {
return pickupToDeliveryAbsoluteDetourLimitBuilder_.getMessageOrBuilder();
} else {
return pickupToDeliveryAbsoluteDetourLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryAbsoluteDetourLimit_;
}
}
/**
*
*
*
* Specifies the maximum absolute detour time compared to the shortest path
* from pickup to delivery. If specified, it must be nonnegative, and the
* shipment must contain at least a pickup and a delivery.
*
* For example, let t be the shortest time taken to go from the selected
* pickup alternative directly to the selected delivery alternative. Then
* setting `pickup_to_delivery_absolute_detour_limit` enforces:
*
* ```
* start_time(delivery) - start_time(pickup) <=
* t + pickup_to_delivery_absolute_detour_limit
* ```
*
* If both relative and absolute limits are specified on the same shipment,
* the more constraining limit is used for each possible pickup/delivery pair.
* As of 2017/10, detours are only supported when travel durations do not
* depend on vehicles.
*
*
* .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
getPickupToDeliveryAbsoluteDetourLimitFieldBuilder() {
if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) {
pickupToDeliveryAbsoluteDetourLimitBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>(
getPickupToDeliveryAbsoluteDetourLimit(), getParentForChildren(), isClean());
pickupToDeliveryAbsoluteDetourLimit_ = null;
}
return pickupToDeliveryAbsoluteDetourLimitBuilder_;
}
private com.google.protobuf.Duration pickupToDeliveryTimeLimit_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
pickupToDeliveryTimeLimitBuilder_;
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*
* @return Whether the pickupToDeliveryTimeLimit field is set.
*/
public boolean hasPickupToDeliveryTimeLimit() {
return ((bitField0_ & 0x00000400) != 0);
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*
* @return The pickupToDeliveryTimeLimit.
*/
public com.google.protobuf.Duration getPickupToDeliveryTimeLimit() {
if (pickupToDeliveryTimeLimitBuilder_ == null) {
return pickupToDeliveryTimeLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryTimeLimit_;
} else {
return pickupToDeliveryTimeLimitBuilder_.getMessage();
}
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
public Builder setPickupToDeliveryTimeLimit(com.google.protobuf.Duration value) {
if (pickupToDeliveryTimeLimitBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
pickupToDeliveryTimeLimit_ = value;
} else {
pickupToDeliveryTimeLimitBuilder_.setMessage(value);
}
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
public Builder setPickupToDeliveryTimeLimit(
com.google.protobuf.Duration.Builder builderForValue) {
if (pickupToDeliveryTimeLimitBuilder_ == null) {
pickupToDeliveryTimeLimit_ = builderForValue.build();
} else {
pickupToDeliveryTimeLimitBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
public Builder mergePickupToDeliveryTimeLimit(com.google.protobuf.Duration value) {
if (pickupToDeliveryTimeLimitBuilder_ == null) {
if (((bitField0_ & 0x00000400) != 0)
&& pickupToDeliveryTimeLimit_ != null
&& pickupToDeliveryTimeLimit_ != com.google.protobuf.Duration.getDefaultInstance()) {
getPickupToDeliveryTimeLimitBuilder().mergeFrom(value);
} else {
pickupToDeliveryTimeLimit_ = value;
}
} else {
pickupToDeliveryTimeLimitBuilder_.mergeFrom(value);
}
if (pickupToDeliveryTimeLimit_ != null) {
bitField0_ |= 0x00000400;
onChanged();
}
return this;
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
public Builder clearPickupToDeliveryTimeLimit() {
bitField0_ = (bitField0_ & ~0x00000400);
pickupToDeliveryTimeLimit_ = null;
if (pickupToDeliveryTimeLimitBuilder_ != null) {
pickupToDeliveryTimeLimitBuilder_.dispose();
pickupToDeliveryTimeLimitBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
public com.google.protobuf.Duration.Builder getPickupToDeliveryTimeLimitBuilder() {
bitField0_ |= 0x00000400;
onChanged();
return getPickupToDeliveryTimeLimitFieldBuilder().getBuilder();
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
public com.google.protobuf.DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder() {
if (pickupToDeliveryTimeLimitBuilder_ != null) {
return pickupToDeliveryTimeLimitBuilder_.getMessageOrBuilder();
} else {
return pickupToDeliveryTimeLimit_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: pickupToDeliveryTimeLimit_;
}
}
/**
*
*
*
* Specifies the maximum duration from start of pickup to start of delivery of
* a shipment. If specified, it must be nonnegative, and the shipment must
* contain at least a pickup and a delivery. This does not depend on which
* alternatives are selected for pickup and delivery, nor on vehicle speed.
* This can be specified alongside maximum detour constraints: the solution
* will respect both specifications.
*
*
* .google.protobuf.Duration pickup_to_delivery_time_limit = 10;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>
getPickupToDeliveryTimeLimitFieldBuilder() {
if (pickupToDeliveryTimeLimitBuilder_ == null) {
pickupToDeliveryTimeLimitBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Duration,
com.google.protobuf.Duration.Builder,
com.google.protobuf.DurationOrBuilder>(
getPickupToDeliveryTimeLimit(), getParentForChildren(), isClean());
pickupToDeliveryTimeLimit_ = null;
}
return pickupToDeliveryTimeLimitBuilder_;
}
private java.lang.Object shipmentType_ = "";
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @return The shipmentType.
*/
public java.lang.String getShipmentType() {
java.lang.Object ref = shipmentType_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
shipmentType_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @return The bytes for shipmentType.
*/
public com.google.protobuf.ByteString getShipmentTypeBytes() {
java.lang.Object ref = shipmentType_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
shipmentType_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @param value The shipmentType to set.
* @return This builder for chaining.
*/
public Builder setShipmentType(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
shipmentType_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @return This builder for chaining.
*/
public Builder clearShipmentType() {
shipmentType_ = getDefaultInstance().getShipmentType();
bitField0_ = (bitField0_ & ~0x00000800);
onChanged();
return this;
}
/**
*
*
*
* Non-empty string specifying a "type" for this shipment.
* This feature can be used to define incompatibilities or requirements
* between `shipment_types` (see `shipment_type_incompatibilities` and
* `shipment_type_requirements` in `ShipmentModel`).
*
* Differs from `visit_types` which is specified for a single visit: All
* pickup/deliveries belonging to the same shipment share the same
* `shipment_type`.
*
*
* string shipment_type = 11;
*
* @param value The bytes for shipmentType to set.
* @return This builder for chaining.
*/
public Builder setShipmentTypeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
shipmentType_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
private java.lang.Object label_ = "";
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @return The label.
*/
public java.lang.String getLabel() {
java.lang.Object ref = label_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
label_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @return The bytes for label.
*/
public com.google.protobuf.ByteString getLabelBytes() {
java.lang.Object ref = label_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
label_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @param value The label to set.
* @return This builder for chaining.
*/
public Builder setLabel(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
label_ = value;
bitField0_ |= 0x00001000;
onChanged();
return this;
}
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @return This builder for chaining.
*/
public Builder clearLabel() {
label_ = getDefaultInstance().getLabel();
bitField0_ = (bitField0_ & ~0x00001000);
onChanged();
return this;
}
/**
*
*
*
* Specifies a label for this shipment. This label is reported in the response
* in the `shipment_label` of the corresponding
* [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
*
*
* string label = 12;
*
* @param value The bytes for label to set.
* @return This builder for chaining.
*/
public Builder setLabelBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
label_ = value;
bitField0_ |= 0x00001000;
onChanged();
return this;
}
private boolean ignore_;
/**
*
*
*
* If true, skip this shipment, but don't apply a `penalty_cost`.
*
* Ignoring a shipment results in a validation error when there are any
* `shipment_type_requirements` in the model.
*
* Ignoring a shipment that is performed in `injected_first_solution_routes`
* or `injected_solution_constraint` is permitted; the solver removes the
* related pickup/delivery visits from the performing route.
* `precedence_rules` that reference ignored shipments will also be ignored.
*
*
* bool ignore = 13;
*
* @return The ignore.
*/
@java.lang.Override
public boolean getIgnore() {
return ignore_;
}
/**
*
*
*
* If true, skip this shipment, but don't apply a `penalty_cost`.
*
* Ignoring a shipment results in a validation error when there are any
* `shipment_type_requirements` in the model.
*
* Ignoring a shipment that is performed in `injected_first_solution_routes`
* or `injected_solution_constraint` is permitted; the solver removes the
* related pickup/delivery visits from the performing route.
* `precedence_rules` that reference ignored shipments will also be ignored.
*
*
* bool ignore = 13;
*
* @param value The ignore to set.
* @return This builder for chaining.
*/
public Builder setIgnore(boolean value) {
ignore_ = value;
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
*
*
*
* If true, skip this shipment, but don't apply a `penalty_cost`.
*
* Ignoring a shipment results in a validation error when there are any
* `shipment_type_requirements` in the model.
*
* Ignoring a shipment that is performed in `injected_first_solution_routes`
* or `injected_solution_constraint` is permitted; the solver removes the
* related pickup/delivery visits from the performing route.
* `precedence_rules` that reference ignored shipments will also be ignored.
*
*
* bool ignore = 13;
*
* @return This builder for chaining.
*/
public Builder clearIgnore() {
bitField0_ = (bitField0_ & ~0x00002000);
ignore_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Shipment)
}
// @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Shipment)
private static final com.google.maps.routeoptimization.v1.Shipment DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Shipment();
}
public static com.google.maps.routeoptimization.v1.Shipment getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Shipment parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.maps.routeoptimization.v1.Shipment getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy