All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.maps.routeoptimization.v1.ShipmentModel Maven / Gradle / Ivy

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;

/**
 *
 *
 * 
 * A shipment model contains a set of shipments which must be performed by a
 * set of vehicles, while minimizing the overall cost, which is the sum of:
 *
 * * the cost of routing the vehicles (sum of cost per total time, cost per
 *   travel time, and fixed cost over all vehicles).
 * * the unperformed shipment penalties.
 * * the cost of the global duration of the shipments
 * 
* * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentModel} */ public final class ShipmentModel extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentModel) ShipmentModelOrBuilder { private static final long serialVersionUID = 0L; // Use ShipmentModel.newBuilder() to construct. private ShipmentModel(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private ShipmentModel() { shipments_ = java.util.Collections.emptyList(); vehicles_ = java.util.Collections.emptyList(); durationDistanceMatrices_ = java.util.Collections.emptyList(); durationDistanceMatrixSrcTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); durationDistanceMatrixDstTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); transitionAttributes_ = java.util.Collections.emptyList(); shipmentTypeIncompatibilities_ = java.util.Collections.emptyList(); shipmentTypeRequirements_ = java.util.Collections.emptyList(); precedenceRules_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ShipmentModel(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.class, com.google.maps.routeoptimization.v1.ShipmentModel.Builder.class); } public interface DurationDistanceMatrixOrBuilder extends // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) com.google.protobuf.MessageOrBuilder { /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ java.util.List getRowsList(); /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row getRows( int index); /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ int getRowsCount(); /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .RowOrBuilder> getRowsOrBuilderList(); /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.RowOrBuilder getRowsOrBuilder(int index); /** * * *
     * Tag defining to which vehicles this duration and distance matrix applies.
     * If empty, this applies to all vehicles, and there can only be a single
     * matrix.
     *
     * Each vehicle start must match exactly one matrix, i.e. exactly one of
     * their `start_tags` field must match the `vehicle_start_tag` of a matrix
     * (and of that matrix only).
     *
     * All matrices must have a different `vehicle_start_tag`.
     * 
* * string vehicle_start_tag = 2; * * @return The vehicleStartTag. */ java.lang.String getVehicleStartTag(); /** * * *
     * Tag defining to which vehicles this duration and distance matrix applies.
     * If empty, this applies to all vehicles, and there can only be a single
     * matrix.
     *
     * Each vehicle start must match exactly one matrix, i.e. exactly one of
     * their `start_tags` field must match the `vehicle_start_tag` of a matrix
     * (and of that matrix only).
     *
     * All matrices must have a different `vehicle_start_tag`.
     * 
* * string vehicle_start_tag = 2; * * @return The bytes for vehicleStartTag. */ com.google.protobuf.ByteString getVehicleStartTagBytes(); } /** * * *
   * Specifies a duration and distance matrix from visit and vehicle start
   * locations to visit and vehicle end locations.
   * 
* * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} */ public static final class DurationDistanceMatrix extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) DurationDistanceMatrixOrBuilder { private static final long serialVersionUID = 0L; // Use DurationDistanceMatrix.newBuilder() to construct. private DurationDistanceMatrix(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private DurationDistanceMatrix() { rows_ = java.util.Collections.emptyList(); vehicleStartTag_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new DurationDistanceMatrix(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.class, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder .class); } public interface RowOrBuilder extends // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) com.google.protobuf.MessageOrBuilder { /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ java.util.List getDurationsList(); /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ com.google.protobuf.Duration getDurations(int index); /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ int getDurationsCount(); /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ java.util.List getDurationsOrBuilderList(); /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ com.google.protobuf.DurationOrBuilder getDurationsOrBuilder(int index); /** * * *
       * Distance values for a given row. If no costs or constraints refer to
       * distances in the model, this can be left empty; otherwise it must have
       * as many elements as `durations`.
       * 
* * repeated double meters = 2; * * @return A list containing the meters. */ java.util.List getMetersList(); /** * * *
       * Distance values for a given row. If no costs or constraints refer to
       * distances in the model, this can be left empty; otherwise it must have
       * as many elements as `durations`.
       * 
* * repeated double meters = 2; * * @return The count of meters. */ int getMetersCount(); /** * * *
       * Distance values for a given row. If no costs or constraints refer to
       * distances in the model, this can be left empty; otherwise it must have
       * as many elements as `durations`.
       * 
* * repeated double meters = 2; * * @param index The index of the element to return. * @return The meters at the given index. */ double getMeters(int index); } /** * * *
     * Specifies a row of the duration and distance matrix.
     * 
* * Protobuf type {@code * google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} */ public static final class Row extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) RowOrBuilder { private static final long serialVersionUID = 0L; // Use Row.newBuilder() to construct. private Row(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Row() { durations_ = java.util.Collections.emptyList(); meters_ = emptyDoubleList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new Row(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.class, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .Builder.class); } public static final int DURATIONS_FIELD_NUMBER = 1; @SuppressWarnings("serial") private java.util.List durations_; /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ @java.lang.Override public java.util.List getDurationsList() { return durations_; } /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ @java.lang.Override public java.util.List getDurationsOrBuilderList() { return durations_; } /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ @java.lang.Override public int getDurationsCount() { return durations_.size(); } /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ @java.lang.Override public com.google.protobuf.Duration getDurations(int index) { return durations_.get(index); } /** * * *
       * Duration values for a given row. It must have as many elements as
       * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
       * 
* * repeated .google.protobuf.Duration durations = 1; */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getDurationsOrBuilder(int index) { return durations_.get(index); } public static final int METERS_FIELD_NUMBER = 2; @SuppressWarnings("serial") private com.google.protobuf.Internal.DoubleList meters_ = emptyDoubleList(); /** * * *
       * Distance values for a given row. If no costs or constraints refer to
       * distances in the model, this can be left empty; otherwise it must have
       * as many elements as `durations`.
       * 
* * repeated double meters = 2; * * @return A list containing the meters. */ @java.lang.Override public java.util.List getMetersList() { return meters_; } /** * * *
       * Distance values for a given row. If no costs or constraints refer to
       * distances in the model, this can be left empty; otherwise it must have
       * as many elements as `durations`.
       * 
* * repeated double meters = 2; * * @return The count of meters. */ public int getMetersCount() { return meters_.size(); } /** * * *
       * Distance values for a given row. If no costs or constraints refer to
       * distances in the model, this can be left empty; otherwise it must have
       * as many elements as `durations`.
       * 
* * repeated double meters = 2; * * @param index The index of the element to return. * @return The meters at the given index. */ public double getMeters(int index) { return meters_.getDouble(index); } private int metersMemoizedSerializedSize = -1; 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 < durations_.size(); i++) { output.writeMessage(1, durations_.get(i)); } if (getMetersList().size() > 0) { output.writeUInt32NoTag(18); output.writeUInt32NoTag(metersMemoizedSerializedSize); } for (int i = 0; i < meters_.size(); i++) { output.writeDoubleNoTag(meters_.getDouble(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < durations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, durations_.get(i)); } { int dataSize = 0; dataSize = 8 * getMetersList().size(); size += dataSize; if (!getMetersList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); } metersMemoizedSerializedSize = dataSize; } 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.ShipmentModel.DurationDistanceMatrix.Row)) { return super.equals(obj); } com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row other = (com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) obj; if (!getDurationsList().equals(other.getDurationsList())) return false; if (!getMetersList().equals(other.getMetersList())) 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 (getDurationsCount() > 0) { hash = (37 * hash) + DURATIONS_FIELD_NUMBER; hash = (53 * hash) + getDurationsList().hashCode(); } if (getMetersCount() > 0) { hash = (37 * hash) + METERS_FIELD_NUMBER; hash = (53 * hash) + getMetersList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row 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.ShipmentModel.DurationDistanceMatrix.Row 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; } /** * * *
       * Specifies a row of the duration and distance matrix.
       * 
* * Protobuf type {@code * google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.RowOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .class, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .Builder.class); } // Construct using // com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; if (durationsBuilder_ == null) { durations_ = java.util.Collections.emptyList(); } else { durations_ = null; durationsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); meters_ = emptyDoubleList(); 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_ShipmentModel_DurationDistanceMatrix_Row_descriptor; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row getDefaultInstanceForType() { return com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .getDefaultInstance(); } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row build() { com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row buildPartial() { com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row result = new com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row( this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row result) { if (durationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { durations_ = java.util.Collections.unmodifiableList(durations_); bitField0_ = (bitField0_ & ~0x00000001); } result.durations_ = durations_; } else { result.durations_ = durationsBuilder_.build(); } } private void buildPartial0( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000002) != 0)) { meters_.makeImmutable(); result.meters_ = meters_; } } @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.ShipmentModel.DurationDistanceMatrix.Row) { return mergeFrom( (com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row other) { if (other == com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .getDefaultInstance()) return this; if (durationsBuilder_ == null) { if (!other.durations_.isEmpty()) { if (durations_.isEmpty()) { durations_ = other.durations_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDurationsIsMutable(); durations_.addAll(other.durations_); } onChanged(); } } else { if (!other.durations_.isEmpty()) { if (durationsBuilder_.isEmpty()) { durationsBuilder_.dispose(); durationsBuilder_ = null; durations_ = other.durations_; bitField0_ = (bitField0_ & ~0x00000001); durationsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDurationsFieldBuilder() : null; } else { durationsBuilder_.addAllMessages(other.durations_); } } } if (!other.meters_.isEmpty()) { if (meters_.isEmpty()) { meters_ = other.meters_; meters_.makeImmutable(); bitField0_ |= 0x00000002; } else { ensureMetersIsMutable(); meters_.addAll(other.meters_); } 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: { com.google.protobuf.Duration m = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); if (durationsBuilder_ == null) { ensureDurationsIsMutable(); durations_.add(m); } else { durationsBuilder_.addMessage(m); } break; } // case 10 case 17: { double v = input.readDouble(); ensureMetersIsMutable(); meters_.addDouble(v); break; } // case 17 case 18: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); int alloc = length > 4096 ? 4096 : length; ensureMetersIsMutable(alloc / 8); while (input.getBytesUntilLimit() > 0) { meters_.addDouble(input.readDouble()); } input.popLimit(limit); break; } // case 18 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.util.List durations_ = java.util.Collections.emptyList(); private void ensureDurationsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { durations_ = new java.util.ArrayList(durations_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> durationsBuilder_; /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public java.util.List getDurationsList() { if (durationsBuilder_ == null) { return java.util.Collections.unmodifiableList(durations_); } else { return durationsBuilder_.getMessageList(); } } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public int getDurationsCount() { if (durationsBuilder_ == null) { return durations_.size(); } else { return durationsBuilder_.getCount(); } } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public com.google.protobuf.Duration getDurations(int index) { if (durationsBuilder_ == null) { return durations_.get(index); } else { return durationsBuilder_.getMessage(index); } } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder setDurations(int index, com.google.protobuf.Duration value) { if (durationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDurationsIsMutable(); durations_.set(index, value); onChanged(); } else { durationsBuilder_.setMessage(index, value); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder setDurations( int index, com.google.protobuf.Duration.Builder builderForValue) { if (durationsBuilder_ == null) { ensureDurationsIsMutable(); durations_.set(index, builderForValue.build()); onChanged(); } else { durationsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder addDurations(com.google.protobuf.Duration value) { if (durationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDurationsIsMutable(); durations_.add(value); onChanged(); } else { durationsBuilder_.addMessage(value); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder addDurations(int index, com.google.protobuf.Duration value) { if (durationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDurationsIsMutable(); durations_.add(index, value); onChanged(); } else { durationsBuilder_.addMessage(index, value); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder addDurations(com.google.protobuf.Duration.Builder builderForValue) { if (durationsBuilder_ == null) { ensureDurationsIsMutable(); durations_.add(builderForValue.build()); onChanged(); } else { durationsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder addDurations( int index, com.google.protobuf.Duration.Builder builderForValue) { if (durationsBuilder_ == null) { ensureDurationsIsMutable(); durations_.add(index, builderForValue.build()); onChanged(); } else { durationsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder addAllDurations( java.lang.Iterable values) { if (durationsBuilder_ == null) { ensureDurationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, durations_); onChanged(); } else { durationsBuilder_.addAllMessages(values); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder clearDurations() { if (durationsBuilder_ == null) { durations_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { durationsBuilder_.clear(); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public Builder removeDurations(int index) { if (durationsBuilder_ == null) { ensureDurationsIsMutable(); durations_.remove(index); onChanged(); } else { durationsBuilder_.remove(index); } return this; } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public com.google.protobuf.Duration.Builder getDurationsBuilder(int index) { return getDurationsFieldBuilder().getBuilder(index); } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public com.google.protobuf.DurationOrBuilder getDurationsOrBuilder(int index) { if (durationsBuilder_ == null) { return durations_.get(index); } else { return durationsBuilder_.getMessageOrBuilder(index); } } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public java.util.List getDurationsOrBuilderList() { if (durationsBuilder_ != null) { return durationsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(durations_); } } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public com.google.protobuf.Duration.Builder addDurationsBuilder() { return getDurationsFieldBuilder() .addBuilder(com.google.protobuf.Duration.getDefaultInstance()); } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public com.google.protobuf.Duration.Builder addDurationsBuilder(int index) { return getDurationsFieldBuilder() .addBuilder(index, com.google.protobuf.Duration.getDefaultInstance()); } /** * * *
         * Duration values for a given row. It must have as many elements as
         * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags].
         * 
* * repeated .google.protobuf.Duration durations = 1; */ public java.util.List getDurationsBuilderList() { return getDurationsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> getDurationsFieldBuilder() { if (durationsBuilder_ == null) { durationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( durations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); durations_ = null; } return durationsBuilder_; } private com.google.protobuf.Internal.DoubleList meters_ = emptyDoubleList(); private void ensureMetersIsMutable() { if (!meters_.isModifiable()) { meters_ = makeMutableCopy(meters_); } bitField0_ |= 0x00000002; } private void ensureMetersIsMutable(int capacity) { if (!meters_.isModifiable()) { meters_ = makeMutableCopy(meters_, capacity); } bitField0_ |= 0x00000002; } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @return A list containing the meters. */ public java.util.List getMetersList() { meters_.makeImmutable(); return meters_; } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @return The count of meters. */ public int getMetersCount() { return meters_.size(); } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @param index The index of the element to return. * @return The meters at the given index. */ public double getMeters(int index) { return meters_.getDouble(index); } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @param index The index to set the value at. * @param value The meters to set. * @return This builder for chaining. */ public Builder setMeters(int index, double value) { ensureMetersIsMutable(); meters_.setDouble(index, value); bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @param value The meters to add. * @return This builder for chaining. */ public Builder addMeters(double value) { ensureMetersIsMutable(); meters_.addDouble(value); bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @param values The meters to add. * @return This builder for chaining. */ public Builder addAllMeters(java.lang.Iterable values) { ensureMetersIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, meters_); bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
         * Distance values for a given row. If no costs or constraints refer to
         * distances in the model, this can be left empty; otherwise it must have
         * as many elements as `durations`.
         * 
* * repeated double meters = 2; * * @return This builder for chaining. */ public Builder clearMeters() { meters_ = emptyDoubleList(); bitField0_ = (bitField0_ & ~0x00000002); 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.ShipmentModel.DurationDistanceMatrix.Row) } // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) private static final com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .Row DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row(); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Row 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.ShipmentModel.DurationDistanceMatrix.Row getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public static final int ROWS_FIELD_NUMBER = 1; @SuppressWarnings("serial") private java.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row> rows_; /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ @java.lang.Override public java.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row> getRowsList() { return rows_; } /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ @java.lang.Override public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .RowOrBuilder> getRowsOrBuilderList() { return rows_; } /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ @java.lang.Override public int getRowsCount() { return rows_.size(); } /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row getRows( int index) { return rows_.get(index); } /** * * *
     * Specifies the rows of the duration and distance matrix. It must have as
     * many elements as
     * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.RowOrBuilder getRowsOrBuilder(int index) { return rows_.get(index); } public static final int VEHICLE_START_TAG_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object vehicleStartTag_ = ""; /** * * *
     * Tag defining to which vehicles this duration and distance matrix applies.
     * If empty, this applies to all vehicles, and there can only be a single
     * matrix.
     *
     * Each vehicle start must match exactly one matrix, i.e. exactly one of
     * their `start_tags` field must match the `vehicle_start_tag` of a matrix
     * (and of that matrix only).
     *
     * All matrices must have a different `vehicle_start_tag`.
     * 
* * string vehicle_start_tag = 2; * * @return The vehicleStartTag. */ @java.lang.Override public java.lang.String getVehicleStartTag() { java.lang.Object ref = vehicleStartTag_; 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(); vehicleStartTag_ = s; return s; } } /** * * *
     * Tag defining to which vehicles this duration and distance matrix applies.
     * If empty, this applies to all vehicles, and there can only be a single
     * matrix.
     *
     * Each vehicle start must match exactly one matrix, i.e. exactly one of
     * their `start_tags` field must match the `vehicle_start_tag` of a matrix
     * (and of that matrix only).
     *
     * All matrices must have a different `vehicle_start_tag`.
     * 
* * string vehicle_start_tag = 2; * * @return The bytes for vehicleStartTag. */ @java.lang.Override public com.google.protobuf.ByteString getVehicleStartTagBytes() { java.lang.Object ref = vehicleStartTag_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); vehicleStartTag_ = 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 { for (int i = 0; i < rows_.size(); i++) { output.writeMessage(1, rows_.get(i)); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vehicleStartTag_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, vehicleStartTag_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < rows_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rows_.get(i)); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vehicleStartTag_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, vehicleStartTag_); } 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.ShipmentModel.DurationDistanceMatrix)) { return super.equals(obj); } com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix other = (com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) obj; if (!getRowsList().equals(other.getRowsList())) return false; if (!getVehicleStartTag().equals(other.getVehicleStartTag())) 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 (getRowsCount() > 0) { hash = (37 * hash) + ROWS_FIELD_NUMBER; hash = (53 * hash) + getRowsList().hashCode(); } hash = (37 * hash) + VEHICLE_START_TAG_FIELD_NUMBER; hash = (53 * hash) + getVehicleStartTag().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix 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; } /** * * *
     * Specifies a duration and distance matrix from visit and vehicle start
     * locations to visit and vehicle end locations.
     * 
* * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.class, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder .class); } // Construct using // com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; if (rowsBuilder_ == null) { rows_ = java.util.Collections.emptyList(); } else { rows_ = null; rowsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); vehicleStartTag_ = ""; 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_ShipmentModel_DurationDistanceMatrix_descriptor; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix getDefaultInstanceForType() { return com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .getDefaultInstance(); } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix build() { com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix buildPartial() { com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix result = new com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix result) { if (rowsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { rows_ = java.util.Collections.unmodifiableList(rows_); bitField0_ = (bitField0_ & ~0x00000001); } result.rows_ = rows_; } else { result.rows_ = rowsBuilder_.build(); } } private void buildPartial0( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000002) != 0)) { result.vehicleStartTag_ = vehicleStartTag_; } } @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.ShipmentModel.DurationDistanceMatrix) { return mergeFrom( (com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix other) { if (other == com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .getDefaultInstance()) return this; if (rowsBuilder_ == null) { if (!other.rows_.isEmpty()) { if (rows_.isEmpty()) { rows_ = other.rows_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureRowsIsMutable(); rows_.addAll(other.rows_); } onChanged(); } } else { if (!other.rows_.isEmpty()) { if (rowsBuilder_.isEmpty()) { rowsBuilder_.dispose(); rowsBuilder_ = null; rows_ = other.rows_; bitField0_ = (bitField0_ & ~0x00000001); rowsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRowsFieldBuilder() : null; } else { rowsBuilder_.addAllMessages(other.rows_); } } } if (!other.getVehicleStartTag().isEmpty()) { vehicleStartTag_ = other.vehicleStartTag_; bitField0_ |= 0x00000002; 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: { com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row m = input.readMessage( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .Row.parser(), extensionRegistry); if (rowsBuilder_ == null) { ensureRowsIsMutable(); rows_.add(m); } else { rowsBuilder_.addMessage(m); } break; } // case 10 case 18: { vehicleStartTag_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 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.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row> rows_ = java.util.Collections.emptyList(); private void ensureRowsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { rows_ = new java.util.ArrayList< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row>( rows_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .RowOrBuilder> rowsBuilder_; /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public java.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row> getRowsList() { if (rowsBuilder_ == null) { return java.util.Collections.unmodifiableList(rows_); } else { return rowsBuilder_.getMessageList(); } } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public int getRowsCount() { if (rowsBuilder_ == null) { return rows_.size(); } else { return rowsBuilder_.getCount(); } } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row getRows( int index) { if (rowsBuilder_ == null) { return rows_.get(index); } else { return rowsBuilder_.getMessage(index); } } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder setRows( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row value) { if (rowsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRowsIsMutable(); rows_.set(index, value); onChanged(); } else { rowsBuilder_.setMessage(index, value); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder setRows( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder builderForValue) { if (rowsBuilder_ == null) { ensureRowsIsMutable(); rows_.set(index, builderForValue.build()); onChanged(); } else { rowsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder addRows( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row value) { if (rowsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRowsIsMutable(); rows_.add(value); onChanged(); } else { rowsBuilder_.addMessage(value); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder addRows( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row value) { if (rowsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRowsIsMutable(); rows_.add(index, value); onChanged(); } else { rowsBuilder_.addMessage(index, value); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder addRows( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder builderForValue) { if (rowsBuilder_ == null) { ensureRowsIsMutable(); rows_.add(builderForValue.build()); onChanged(); } else { rowsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder addRows( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder builderForValue) { if (rowsBuilder_ == null) { ensureRowsIsMutable(); rows_.add(index, builderForValue.build()); onChanged(); } else { rowsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder addAllRows( java.lang.Iterable< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row> values) { if (rowsBuilder_ == null) { ensureRowsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rows_); onChanged(); } else { rowsBuilder_.addAllMessages(values); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder clearRows() { if (rowsBuilder_ == null) { rows_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { rowsBuilder_.clear(); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public Builder removeRows(int index) { if (rowsBuilder_ == null) { ensureRowsIsMutable(); rows_.remove(index); onChanged(); } else { rowsBuilder_.remove(index); } return this; } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder getRowsBuilder(int index) { return getRowsFieldBuilder().getBuilder(index); } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.RowOrBuilder getRowsOrBuilder(int index) { if (rowsBuilder_ == null) { return rows_.get(index); } else { return rowsBuilder_.getMessageOrBuilder(index); } } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .RowOrBuilder> getRowsOrBuilderList() { if (rowsBuilder_ != null) { return rowsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(rows_); } } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder addRowsBuilder() { return getRowsFieldBuilder() .addBuilder( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .getDefaultInstance()); } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder addRowsBuilder(int index) { return getRowsFieldBuilder() .addBuilder( index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .getDefaultInstance()); } /** * * *
       * Specifies the rows of the duration and distance matrix. It must have as
       * many elements as
       * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags].
       * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; * */ public java.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder> getRowsBuilderList() { return getRowsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .RowOrBuilder> getRowsFieldBuilder() { if (rowsBuilder_ == null) { rowsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row .Builder, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .RowOrBuilder>( rows_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); rows_ = null; } return rowsBuilder_; } private java.lang.Object vehicleStartTag_ = ""; /** * * *
       * Tag defining to which vehicles this duration and distance matrix applies.
       * If empty, this applies to all vehicles, and there can only be a single
       * matrix.
       *
       * Each vehicle start must match exactly one matrix, i.e. exactly one of
       * their `start_tags` field must match the `vehicle_start_tag` of a matrix
       * (and of that matrix only).
       *
       * All matrices must have a different `vehicle_start_tag`.
       * 
* * string vehicle_start_tag = 2; * * @return The vehicleStartTag. */ public java.lang.String getVehicleStartTag() { java.lang.Object ref = vehicleStartTag_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); vehicleStartTag_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
       * Tag defining to which vehicles this duration and distance matrix applies.
       * If empty, this applies to all vehicles, and there can only be a single
       * matrix.
       *
       * Each vehicle start must match exactly one matrix, i.e. exactly one of
       * their `start_tags` field must match the `vehicle_start_tag` of a matrix
       * (and of that matrix only).
       *
       * All matrices must have a different `vehicle_start_tag`.
       * 
* * string vehicle_start_tag = 2; * * @return The bytes for vehicleStartTag. */ public com.google.protobuf.ByteString getVehicleStartTagBytes() { java.lang.Object ref = vehicleStartTag_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); vehicleStartTag_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
       * Tag defining to which vehicles this duration and distance matrix applies.
       * If empty, this applies to all vehicles, and there can only be a single
       * matrix.
       *
       * Each vehicle start must match exactly one matrix, i.e. exactly one of
       * their `start_tags` field must match the `vehicle_start_tag` of a matrix
       * (and of that matrix only).
       *
       * All matrices must have a different `vehicle_start_tag`.
       * 
* * string vehicle_start_tag = 2; * * @param value The vehicleStartTag to set. * @return This builder for chaining. */ public Builder setVehicleStartTag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } vehicleStartTag_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
       * Tag defining to which vehicles this duration and distance matrix applies.
       * If empty, this applies to all vehicles, and there can only be a single
       * matrix.
       *
       * Each vehicle start must match exactly one matrix, i.e. exactly one of
       * their `start_tags` field must match the `vehicle_start_tag` of a matrix
       * (and of that matrix only).
       *
       * All matrices must have a different `vehicle_start_tag`.
       * 
* * string vehicle_start_tag = 2; * * @return This builder for chaining. */ public Builder clearVehicleStartTag() { vehicleStartTag_ = getDefaultInstance().getVehicleStartTag(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * * *
       * Tag defining to which vehicles this duration and distance matrix applies.
       * If empty, this applies to all vehicles, and there can only be a single
       * matrix.
       *
       * Each vehicle start must match exactly one matrix, i.e. exactly one of
       * their `start_tags` field must match the `vehicle_start_tag` of a matrix
       * (and of that matrix only).
       *
       * All matrices must have a different `vehicle_start_tag`.
       * 
* * string vehicle_start_tag = 2; * * @param value The bytes for vehicleStartTag to set. * @return This builder for chaining. */ public Builder setVehicleStartTagBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); vehicleStartTag_ = value; bitField0_ |= 0x00000002; 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.ShipmentModel.DurationDistanceMatrix) } // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) private static final com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix(); } public static com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public DurationDistanceMatrix 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.ShipmentModel.DurationDistanceMatrix getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface PrecedenceRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) com.google.protobuf.MessageOrBuilder { /** * * *
     * Shipment index of the "first" event. This field must be specified.
     * 
* * optional int32 first_index = 1; * * @return Whether the firstIndex field is set. */ boolean hasFirstIndex(); /** * * *
     * Shipment index of the "first" event. This field must be specified.
     * 
* * optional int32 first_index = 1; * * @return The firstIndex. */ int getFirstIndex(); /** * * *
     * Indicates if the "first" event is a delivery.
     * 
* * bool first_is_delivery = 3; * * @return The firstIsDelivery. */ boolean getFirstIsDelivery(); /** * * *
     * Shipment index of the "second" event. This field must be specified.
     * 
* * optional int32 second_index = 2; * * @return Whether the secondIndex field is set. */ boolean hasSecondIndex(); /** * * *
     * Shipment index of the "second" event. This field must be specified.
     * 
* * optional int32 second_index = 2; * * @return The secondIndex. */ int getSecondIndex(); /** * * *
     * Indicates if the "second" event is a delivery.
     * 
* * bool second_is_delivery = 4; * * @return The secondIsDelivery. */ boolean getSecondIsDelivery(); /** * * *
     * The offset between the "first" and "second" event. It can be negative.
     * 
* * .google.protobuf.Duration offset_duration = 5; * * @return Whether the offsetDuration field is set. */ boolean hasOffsetDuration(); /** * * *
     * The offset between the "first" and "second" event. It can be negative.
     * 
* * .google.protobuf.Duration offset_duration = 5; * * @return The offsetDuration. */ com.google.protobuf.Duration getOffsetDuration(); /** * * *
     * The offset between the "first" and "second" event. It can be negative.
     * 
* * .google.protobuf.Duration offset_duration = 5; */ com.google.protobuf.DurationOrBuilder getOffsetDurationOrBuilder(); } /** * * *
   * A precedence rule between two events (each event is the pickup or the
   * delivery of a shipment): the "second" event has to start at least
   * `offset_duration` after "first" has started.
   *
   * Several precedences can refer to the same (or related) events, e.g.,
   * "pickup of B happens after delivery of A" and "pickup of C happens after
   * pickup of B".
   *
   * Furthermore, precedences only apply when both shipments are performed and
   * are otherwise ignored.
   * 
* * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} */ public static final class PrecedenceRule extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) PrecedenceRuleOrBuilder { private static final long serialVersionUID = 0L; // Use PrecedenceRule.newBuilder() to construct. private PrecedenceRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private PrecedenceRule() {} @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new PrecedenceRule(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.class, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder.class); } private int bitField0_; public static final int FIRST_INDEX_FIELD_NUMBER = 1; private int firstIndex_ = 0; /** * * *
     * Shipment index of the "first" event. This field must be specified.
     * 
* * optional int32 first_index = 1; * * @return Whether the firstIndex field is set. */ @java.lang.Override public boolean hasFirstIndex() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
     * Shipment index of the "first" event. This field must be specified.
     * 
* * optional int32 first_index = 1; * * @return The firstIndex. */ @java.lang.Override public int getFirstIndex() { return firstIndex_; } public static final int FIRST_IS_DELIVERY_FIELD_NUMBER = 3; private boolean firstIsDelivery_ = false; /** * * *
     * Indicates if the "first" event is a delivery.
     * 
* * bool first_is_delivery = 3; * * @return The firstIsDelivery. */ @java.lang.Override public boolean getFirstIsDelivery() { return firstIsDelivery_; } public static final int SECOND_INDEX_FIELD_NUMBER = 2; private int secondIndex_ = 0; /** * * *
     * Shipment index of the "second" event. This field must be specified.
     * 
* * optional int32 second_index = 2; * * @return Whether the secondIndex field is set. */ @java.lang.Override public boolean hasSecondIndex() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
     * Shipment index of the "second" event. This field must be specified.
     * 
* * optional int32 second_index = 2; * * @return The secondIndex. */ @java.lang.Override public int getSecondIndex() { return secondIndex_; } public static final int SECOND_IS_DELIVERY_FIELD_NUMBER = 4; private boolean secondIsDelivery_ = false; /** * * *
     * Indicates if the "second" event is a delivery.
     * 
* * bool second_is_delivery = 4; * * @return The secondIsDelivery. */ @java.lang.Override public boolean getSecondIsDelivery() { return secondIsDelivery_; } public static final int OFFSET_DURATION_FIELD_NUMBER = 5; private com.google.protobuf.Duration offsetDuration_; /** * * *
     * The offset between the "first" and "second" event. It can be negative.
     * 
* * .google.protobuf.Duration offset_duration = 5; * * @return Whether the offsetDuration field is set. */ @java.lang.Override public boolean hasOffsetDuration() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
     * The offset between the "first" and "second" event. It can be negative.
     * 
* * .google.protobuf.Duration offset_duration = 5; * * @return The offsetDuration. */ @java.lang.Override public com.google.protobuf.Duration getOffsetDuration() { return offsetDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offsetDuration_; } /** * * *
     * The offset between the "first" and "second" event. It can be negative.
     * 
* * .google.protobuf.Duration offset_duration = 5; */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getOffsetDurationOrBuilder() { return offsetDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offsetDuration_; } 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.writeInt32(1, firstIndex_); } if (((bitField0_ & 0x00000002) != 0)) { output.writeInt32(2, secondIndex_); } if (firstIsDelivery_ != false) { output.writeBool(3, firstIsDelivery_); } if (secondIsDelivery_ != false) { output.writeBool(4, secondIsDelivery_); } if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getOffsetDuration()); } 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.computeInt32Size(1, firstIndex_); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, secondIndex_); } if (firstIsDelivery_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, firstIsDelivery_); } if (secondIsDelivery_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, secondIsDelivery_); } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOffsetDuration()); } 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.ShipmentModel.PrecedenceRule)) { return super.equals(obj); } com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule other = (com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) obj; if (hasFirstIndex() != other.hasFirstIndex()) return false; if (hasFirstIndex()) { if (getFirstIndex() != other.getFirstIndex()) return false; } if (getFirstIsDelivery() != other.getFirstIsDelivery()) return false; if (hasSecondIndex() != other.hasSecondIndex()) return false; if (hasSecondIndex()) { if (getSecondIndex() != other.getSecondIndex()) return false; } if (getSecondIsDelivery() != other.getSecondIsDelivery()) return false; if (hasOffsetDuration() != other.hasOffsetDuration()) return false; if (hasOffsetDuration()) { if (!getOffsetDuration().equals(other.getOffsetDuration())) 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 (hasFirstIndex()) { hash = (37 * hash) + FIRST_INDEX_FIELD_NUMBER; hash = (53 * hash) + getFirstIndex(); } hash = (37 * hash) + FIRST_IS_DELIVERY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFirstIsDelivery()); if (hasSecondIndex()) { hash = (37 * hash) + SECOND_INDEX_FIELD_NUMBER; hash = (53 * hash) + getSecondIndex(); } hash = (37 * hash) + SECOND_IS_DELIVERY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSecondIsDelivery()); if (hasOffsetDuration()) { hash = (37 * hash) + OFFSET_DURATION_FIELD_NUMBER; hash = (53 * hash) + getOffsetDuration().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule 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.ShipmentModel.PrecedenceRule 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; } /** * * *
     * A precedence rule between two events (each event is the pickup or the
     * delivery of a shipment): the "second" event has to start at least
     * `offset_duration` after "first" has started.
     *
     * Several precedences can refer to the same (or related) events, e.g.,
     * "pickup of B happens after delivery of A" and "pickup of C happens after
     * pickup of B".
     *
     * Furthermore, precedences only apply when both shipments are performed and
     * are otherwise ignored.
     * 
* * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.class, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder.class); } // Construct using // com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getOffsetDurationFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; firstIndex_ = 0; firstIsDelivery_ = false; secondIndex_ = 0; secondIsDelivery_ = false; offsetDuration_ = null; if (offsetDurationBuilder_ != null) { offsetDurationBuilder_.dispose(); offsetDurationBuilder_ = null; } 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_ShipmentModel_PrecedenceRule_descriptor; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule getDefaultInstanceForType() { return com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule .getDefaultInstance(); } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule build() { com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule buildPartial() { com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule result = new com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { result.firstIndex_ = firstIndex_; to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000002) != 0)) { result.firstIsDelivery_ = firstIsDelivery_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.secondIndex_ = secondIndex_; to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000008) != 0)) { result.secondIsDelivery_ = secondIsDelivery_; } if (((from_bitField0_ & 0x00000010) != 0)) { result.offsetDuration_ = offsetDurationBuilder_ == null ? offsetDuration_ : offsetDurationBuilder_.build(); to_bitField0_ |= 0x00000004; } 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.ShipmentModel.PrecedenceRule) { return mergeFrom( (com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule other) { if (other == com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule .getDefaultInstance()) return this; if (other.hasFirstIndex()) { setFirstIndex(other.getFirstIndex()); } if (other.getFirstIsDelivery() != false) { setFirstIsDelivery(other.getFirstIsDelivery()); } if (other.hasSecondIndex()) { setSecondIndex(other.getSecondIndex()); } if (other.getSecondIsDelivery() != false) { setSecondIsDelivery(other.getSecondIsDelivery()); } if (other.hasOffsetDuration()) { mergeOffsetDuration(other.getOffsetDuration()); } 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 8: { firstIndex_ = input.readInt32(); bitField0_ |= 0x00000001; break; } // case 8 case 16: { secondIndex_ = input.readInt32(); bitField0_ |= 0x00000004; break; } // case 16 case 24: { firstIsDelivery_ = input.readBool(); bitField0_ |= 0x00000002; break; } // case 24 case 32: { secondIsDelivery_ = input.readBool(); bitField0_ |= 0x00000008; break; } // case 32 case 42: { input.readMessage( getOffsetDurationFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000010; break; } // case 42 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 int firstIndex_; /** * * *
       * Shipment index of the "first" event. This field must be specified.
       * 
* * optional int32 first_index = 1; * * @return Whether the firstIndex field is set. */ @java.lang.Override public boolean hasFirstIndex() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
       * Shipment index of the "first" event. This field must be specified.
       * 
* * optional int32 first_index = 1; * * @return The firstIndex. */ @java.lang.Override public int getFirstIndex() { return firstIndex_; } /** * * *
       * Shipment index of the "first" event. This field must be specified.
       * 
* * optional int32 first_index = 1; * * @param value The firstIndex to set. * @return This builder for chaining. */ public Builder setFirstIndex(int value) { firstIndex_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
       * Shipment index of the "first" event. This field must be specified.
       * 
* * optional int32 first_index = 1; * * @return This builder for chaining. */ public Builder clearFirstIndex() { bitField0_ = (bitField0_ & ~0x00000001); firstIndex_ = 0; onChanged(); return this; } private boolean firstIsDelivery_; /** * * *
       * Indicates if the "first" event is a delivery.
       * 
* * bool first_is_delivery = 3; * * @return The firstIsDelivery. */ @java.lang.Override public boolean getFirstIsDelivery() { return firstIsDelivery_; } /** * * *
       * Indicates if the "first" event is a delivery.
       * 
* * bool first_is_delivery = 3; * * @param value The firstIsDelivery to set. * @return This builder for chaining. */ public Builder setFirstIsDelivery(boolean value) { firstIsDelivery_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
       * Indicates if the "first" event is a delivery.
       * 
* * bool first_is_delivery = 3; * * @return This builder for chaining. */ public Builder clearFirstIsDelivery() { bitField0_ = (bitField0_ & ~0x00000002); firstIsDelivery_ = false; onChanged(); return this; } private int secondIndex_; /** * * *
       * Shipment index of the "second" event. This field must be specified.
       * 
* * optional int32 second_index = 2; * * @return Whether the secondIndex field is set. */ @java.lang.Override public boolean hasSecondIndex() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
       * Shipment index of the "second" event. This field must be specified.
       * 
* * optional int32 second_index = 2; * * @return The secondIndex. */ @java.lang.Override public int getSecondIndex() { return secondIndex_; } /** * * *
       * Shipment index of the "second" event. This field must be specified.
       * 
* * optional int32 second_index = 2; * * @param value The secondIndex to set. * @return This builder for chaining. */ public Builder setSecondIndex(int value) { secondIndex_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
       * Shipment index of the "second" event. This field must be specified.
       * 
* * optional int32 second_index = 2; * * @return This builder for chaining. */ public Builder clearSecondIndex() { bitField0_ = (bitField0_ & ~0x00000004); secondIndex_ = 0; onChanged(); return this; } private boolean secondIsDelivery_; /** * * *
       * Indicates if the "second" event is a delivery.
       * 
* * bool second_is_delivery = 4; * * @return The secondIsDelivery. */ @java.lang.Override public boolean getSecondIsDelivery() { return secondIsDelivery_; } /** * * *
       * Indicates if the "second" event is a delivery.
       * 
* * bool second_is_delivery = 4; * * @param value The secondIsDelivery to set. * @return This builder for chaining. */ public Builder setSecondIsDelivery(boolean value) { secondIsDelivery_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
       * Indicates if the "second" event is a delivery.
       * 
* * bool second_is_delivery = 4; * * @return This builder for chaining. */ public Builder clearSecondIsDelivery() { bitField0_ = (bitField0_ & ~0x00000008); secondIsDelivery_ = false; onChanged(); return this; } private com.google.protobuf.Duration offsetDuration_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> offsetDurationBuilder_; /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; * * @return Whether the offsetDuration field is set. */ public boolean hasOffsetDuration() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; * * @return The offsetDuration. */ public com.google.protobuf.Duration getOffsetDuration() { if (offsetDurationBuilder_ == null) { return offsetDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offsetDuration_; } else { return offsetDurationBuilder_.getMessage(); } } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ public Builder setOffsetDuration(com.google.protobuf.Duration value) { if (offsetDurationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } offsetDuration_ = value; } else { offsetDurationBuilder_.setMessage(value); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ public Builder setOffsetDuration(com.google.protobuf.Duration.Builder builderForValue) { if (offsetDurationBuilder_ == null) { offsetDuration_ = builderForValue.build(); } else { offsetDurationBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ public Builder mergeOffsetDuration(com.google.protobuf.Duration value) { if (offsetDurationBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0) && offsetDuration_ != null && offsetDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { getOffsetDurationBuilder().mergeFrom(value); } else { offsetDuration_ = value; } } else { offsetDurationBuilder_.mergeFrom(value); } if (offsetDuration_ != null) { bitField0_ |= 0x00000010; onChanged(); } return this; } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ public Builder clearOffsetDuration() { bitField0_ = (bitField0_ & ~0x00000010); offsetDuration_ = null; if (offsetDurationBuilder_ != null) { offsetDurationBuilder_.dispose(); offsetDurationBuilder_ = null; } onChanged(); return this; } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ public com.google.protobuf.Duration.Builder getOffsetDurationBuilder() { bitField0_ |= 0x00000010; onChanged(); return getOffsetDurationFieldBuilder().getBuilder(); } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ public com.google.protobuf.DurationOrBuilder getOffsetDurationOrBuilder() { if (offsetDurationBuilder_ != null) { return offsetDurationBuilder_.getMessageOrBuilder(); } else { return offsetDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : offsetDuration_; } } /** * * *
       * The offset between the "first" and "second" event. It can be negative.
       * 
* * .google.protobuf.Duration offset_duration = 5; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> getOffsetDurationFieldBuilder() { if (offsetDurationBuilder_ == null) { offsetDurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( getOffsetDuration(), getParentForChildren(), isClean()); offsetDuration_ = null; } return offsetDurationBuilder_; } @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.ShipmentModel.PrecedenceRule) } // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) private static final com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule(); } public static com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public PrecedenceRule 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.ShipmentModel.PrecedenceRule getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private int bitField0_; public static final int SHIPMENTS_FIELD_NUMBER = 1; @SuppressWarnings("serial") private java.util.List shipments_; /** * * *
   * Set of shipments which must be performed in the model.
   * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ @java.lang.Override public java.util.List getShipmentsList() { return shipments_; } /** * * *
   * Set of shipments which must be performed in the model.
   * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ @java.lang.Override public java.util.List getShipmentsOrBuilderList() { return shipments_; } /** * * *
   * Set of shipments which must be performed in the model.
   * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ @java.lang.Override public int getShipmentsCount() { return shipments_.size(); } /** * * *
   * Set of shipments which must be performed in the model.
   * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ @java.lang.Override public com.google.maps.routeoptimization.v1.Shipment getShipments(int index) { return shipments_.get(index); } /** * * *
   * Set of shipments which must be performed in the model.
   * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentOrBuilder getShipmentsOrBuilder(int index) { return shipments_.get(index); } public static final int VEHICLES_FIELD_NUMBER = 2; @SuppressWarnings("serial") private java.util.List vehicles_; /** * * *
   * Set of vehicles which can be used to perform visits.
   * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ @java.lang.Override public java.util.List getVehiclesList() { return vehicles_; } /** * * *
   * Set of vehicles which can be used to perform visits.
   * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ @java.lang.Override public java.util.List getVehiclesOrBuilderList() { return vehicles_; } /** * * *
   * Set of vehicles which can be used to perform visits.
   * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ @java.lang.Override public int getVehiclesCount() { return vehicles_.size(); } /** * * *
   * Set of vehicles which can be used to perform visits.
   * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ @java.lang.Override public com.google.maps.routeoptimization.v1.Vehicle getVehicles(int index) { return vehicles_.get(index); } /** * * *
   * Set of vehicles which can be used to perform visits.
   * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ @java.lang.Override public com.google.maps.routeoptimization.v1.VehicleOrBuilder getVehiclesOrBuilder(int index) { return vehicles_.get(index); } public static final int MAX_ACTIVE_VEHICLES_FIELD_NUMBER = 4; private int maxActiveVehicles_ = 0; /** * * *
   * Constrains the maximum number of active vehicles. A vehicle is active if
   * its route performs at least one shipment. This can be used to limit the
   * number of routes in the case where there are fewer drivers than
   * vehicles and that the fleet of vehicles is heterogeneous. The optimization
   * will then select the best subset of vehicles to use.
   * Must be strictly positive.
   * 
* * optional int32 max_active_vehicles = 4; * * @return Whether the maxActiveVehicles field is set. */ @java.lang.Override public boolean hasMaxActiveVehicles() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * Constrains the maximum number of active vehicles. A vehicle is active if
   * its route performs at least one shipment. This can be used to limit the
   * number of routes in the case where there are fewer drivers than
   * vehicles and that the fleet of vehicles is heterogeneous. The optimization
   * will then select the best subset of vehicles to use.
   * Must be strictly positive.
   * 
* * optional int32 max_active_vehicles = 4; * * @return The maxActiveVehicles. */ @java.lang.Override public int getMaxActiveVehicles() { return maxActiveVehicles_; } public static final int GLOBAL_START_TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp globalStartTime_; /** * * *
   * Global start and end time of the model: no times outside of this range
   * can be considered valid.
   *
   * The model's time span must be less than a year, i.e. the `global_end_time`
   * and the `global_start_time` must be within 31536000 seconds of each other.
   *
   * When using `cost_per_*hour` fields, you might want to set this window to a
   * smaller interval to increase performance (eg. if you model a single day,
   * you should set the global time limits to that day).
   * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
   * as default.
   * 
* * .google.protobuf.Timestamp global_start_time = 5; * * @return Whether the globalStartTime field is set. */ @java.lang.Override public boolean hasGlobalStartTime() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
   * Global start and end time of the model: no times outside of this range
   * can be considered valid.
   *
   * The model's time span must be less than a year, i.e. the `global_end_time`
   * and the `global_start_time` must be within 31536000 seconds of each other.
   *
   * When using `cost_per_*hour` fields, you might want to set this window to a
   * smaller interval to increase performance (eg. if you model a single day,
   * you should set the global time limits to that day).
   * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
   * as default.
   * 
* * .google.protobuf.Timestamp global_start_time = 5; * * @return The globalStartTime. */ @java.lang.Override public com.google.protobuf.Timestamp getGlobalStartTime() { return globalStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalStartTime_; } /** * * *
   * Global start and end time of the model: no times outside of this range
   * can be considered valid.
   *
   * The model's time span must be less than a year, i.e. the `global_end_time`
   * and the `global_start_time` must be within 31536000 seconds of each other.
   *
   * When using `cost_per_*hour` fields, you might want to set this window to a
   * smaller interval to increase performance (eg. if you model a single day,
   * you should set the global time limits to that day).
   * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
   * as default.
   * 
* * .google.protobuf.Timestamp global_start_time = 5; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getGlobalStartTimeOrBuilder() { return globalStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalStartTime_; } public static final int GLOBAL_END_TIME_FIELD_NUMBER = 6; private com.google.protobuf.Timestamp globalEndTime_; /** * * *
   * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
   * is used as default.
   * 
* * .google.protobuf.Timestamp global_end_time = 6; * * @return Whether the globalEndTime field is set. */ @java.lang.Override public boolean hasGlobalEndTime() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
   * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
   * is used as default.
   * 
* * .google.protobuf.Timestamp global_end_time = 6; * * @return The globalEndTime. */ @java.lang.Override public com.google.protobuf.Timestamp getGlobalEndTime() { return globalEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalEndTime_; } /** * * *
   * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
   * is used as default.
   * 
* * .google.protobuf.Timestamp global_end_time = 6; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getGlobalEndTimeOrBuilder() { return globalEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalEndTime_; } public static final int GLOBAL_DURATION_COST_PER_HOUR_FIELD_NUMBER = 7; private double globalDurationCostPerHour_ = 0D; /** * * *
   * The "global duration" of the overall plan is the difference between the
   * earliest effective start time and the latest effective end time of
   * all vehicles. Users can assign a cost per hour to that quantity to try
   * and optimize for earliest job completion, for example. This cost must be in
   * the same unit as
   * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
   * 
* * double global_duration_cost_per_hour = 7; * * @return The globalDurationCostPerHour. */ @java.lang.Override public double getGlobalDurationCostPerHour() { return globalDurationCostPerHour_; } public static final int DURATION_DISTANCE_MATRICES_FIELD_NUMBER = 8; @SuppressWarnings("serial") private java.util.List durationDistanceMatrices_; /** * * *
   * Specifies duration and distance matrices used in the model. If this field
   * is empty, Google Maps or geodesic distances will be used instead, depending
   * on the value of the `use_geodesic_distances` field. If it is not empty,
   * `use_geodesic_distances` cannot be true and neither
   * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
   * can be empty.
   *
   * Usage examples:
   *
   * * There are two locations: locA and locB.
   * * 1 vehicle starting its route at locA and ending it at locA.
   * * 1 pickup visit request at locB.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA"  end_tags: "locA" }
   *   shipments { pickups { tags: "locB" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locA"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrices {
   *     rows {  # from: locA
   *       durations { seconds: 0 }   meters: 0    # to: locA
   *       durations { seconds: 100 } meters: 1000 # to: locB
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 102 } meters: 990 # to: locA
   *       durations { seconds: 0 }   meters: 0   # to: locB
   *     }
   *   }
   * }
   * ```
   *
   *
   * * There are three locations: locA, locB and locC.
   * * 1 vehicle starting its route at locA and ending it at locB, using
   *   matrix "fast".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "slow".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "fast".
   * * 1 pickup visit request at locC.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
   *   shipments { pickups { tags: "locC" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_src_tags: "locC"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locC"
   *   duration_distance_matrices {
   *     vehicle_start_tag: "fast"
   *     rows {  # from: locA
   *       durations { seconds: 1000 } meters: 2000 # to: locB
   *       durations { seconds: 600 }  meters: 1000 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }   meters: 0    # to: locB
   *       durations { seconds: 700 } meters: 1200 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 702 } meters: 1190 # to: locB
   *       durations { seconds: 0 }   meters: 0    # to: locC
   *     }
   *   }
   *   duration_distance_matrices {
   *     vehicle_start_tag: "slow"
   *     rows {  # from: locA
   *       durations { seconds: 1800 } meters: 2001 # to: locB
   *       durations { seconds: 900 }  meters: 1002 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }    meters: 0    # to: locB
   *       durations { seconds: 1000 } meters: 1202 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 1001 } meters: 1195 # to: locB
   *       durations { seconds: 0 }    meters: 0    # to: locC
   *     }
   *   }
   * }
   * ```
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ @java.lang.Override public java.util.List getDurationDistanceMatricesList() { return durationDistanceMatrices_; } /** * * *
   * Specifies duration and distance matrices used in the model. If this field
   * is empty, Google Maps or geodesic distances will be used instead, depending
   * on the value of the `use_geodesic_distances` field. If it is not empty,
   * `use_geodesic_distances` cannot be true and neither
   * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
   * can be empty.
   *
   * Usage examples:
   *
   * * There are two locations: locA and locB.
   * * 1 vehicle starting its route at locA and ending it at locA.
   * * 1 pickup visit request at locB.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA"  end_tags: "locA" }
   *   shipments { pickups { tags: "locB" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locA"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrices {
   *     rows {  # from: locA
   *       durations { seconds: 0 }   meters: 0    # to: locA
   *       durations { seconds: 100 } meters: 1000 # to: locB
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 102 } meters: 990 # to: locA
   *       durations { seconds: 0 }   meters: 0   # to: locB
   *     }
   *   }
   * }
   * ```
   *
   *
   * * There are three locations: locA, locB and locC.
   * * 1 vehicle starting its route at locA and ending it at locB, using
   *   matrix "fast".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "slow".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "fast".
   * * 1 pickup visit request at locC.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
   *   shipments { pickups { tags: "locC" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_src_tags: "locC"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locC"
   *   duration_distance_matrices {
   *     vehicle_start_tag: "fast"
   *     rows {  # from: locA
   *       durations { seconds: 1000 } meters: 2000 # to: locB
   *       durations { seconds: 600 }  meters: 1000 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }   meters: 0    # to: locB
   *       durations { seconds: 700 } meters: 1200 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 702 } meters: 1190 # to: locB
   *       durations { seconds: 0 }   meters: 0    # to: locC
   *     }
   *   }
   *   duration_distance_matrices {
   *     vehicle_start_tag: "slow"
   *     rows {  # from: locA
   *       durations { seconds: 1800 } meters: 2001 # to: locB
   *       durations { seconds: 900 }  meters: 1002 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }    meters: 0    # to: locB
   *       durations { seconds: 1000 } meters: 1202 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 1001 } meters: 1195 # to: locB
   *       durations { seconds: 0 }    meters: 0    # to: locC
   *     }
   *   }
   * }
   * ```
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ @java.lang.Override public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder> getDurationDistanceMatricesOrBuilderList() { return durationDistanceMatrices_; } /** * * *
   * Specifies duration and distance matrices used in the model. If this field
   * is empty, Google Maps or geodesic distances will be used instead, depending
   * on the value of the `use_geodesic_distances` field. If it is not empty,
   * `use_geodesic_distances` cannot be true and neither
   * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
   * can be empty.
   *
   * Usage examples:
   *
   * * There are two locations: locA and locB.
   * * 1 vehicle starting its route at locA and ending it at locA.
   * * 1 pickup visit request at locB.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA"  end_tags: "locA" }
   *   shipments { pickups { tags: "locB" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locA"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrices {
   *     rows {  # from: locA
   *       durations { seconds: 0 }   meters: 0    # to: locA
   *       durations { seconds: 100 } meters: 1000 # to: locB
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 102 } meters: 990 # to: locA
   *       durations { seconds: 0 }   meters: 0   # to: locB
   *     }
   *   }
   * }
   * ```
   *
   *
   * * There are three locations: locA, locB and locC.
   * * 1 vehicle starting its route at locA and ending it at locB, using
   *   matrix "fast".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "slow".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "fast".
   * * 1 pickup visit request at locC.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
   *   shipments { pickups { tags: "locC" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_src_tags: "locC"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locC"
   *   duration_distance_matrices {
   *     vehicle_start_tag: "fast"
   *     rows {  # from: locA
   *       durations { seconds: 1000 } meters: 2000 # to: locB
   *       durations { seconds: 600 }  meters: 1000 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }   meters: 0    # to: locB
   *       durations { seconds: 700 } meters: 1200 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 702 } meters: 1190 # to: locB
   *       durations { seconds: 0 }   meters: 0    # to: locC
   *     }
   *   }
   *   duration_distance_matrices {
   *     vehicle_start_tag: "slow"
   *     rows {  # from: locA
   *       durations { seconds: 1800 } meters: 2001 # to: locB
   *       durations { seconds: 900 }  meters: 1002 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }    meters: 0    # to: locB
   *       durations { seconds: 1000 } meters: 1202 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 1001 } meters: 1195 # to: locB
   *       durations { seconds: 0 }    meters: 0    # to: locC
   *     }
   *   }
   * }
   * ```
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ @java.lang.Override public int getDurationDistanceMatricesCount() { return durationDistanceMatrices_.size(); } /** * * *
   * Specifies duration and distance matrices used in the model. If this field
   * is empty, Google Maps or geodesic distances will be used instead, depending
   * on the value of the `use_geodesic_distances` field. If it is not empty,
   * `use_geodesic_distances` cannot be true and neither
   * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
   * can be empty.
   *
   * Usage examples:
   *
   * * There are two locations: locA and locB.
   * * 1 vehicle starting its route at locA and ending it at locA.
   * * 1 pickup visit request at locB.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA"  end_tags: "locA" }
   *   shipments { pickups { tags: "locB" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locA"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrices {
   *     rows {  # from: locA
   *       durations { seconds: 0 }   meters: 0    # to: locA
   *       durations { seconds: 100 } meters: 1000 # to: locB
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 102 } meters: 990 # to: locA
   *       durations { seconds: 0 }   meters: 0   # to: locB
   *     }
   *   }
   * }
   * ```
   *
   *
   * * There are three locations: locA, locB and locC.
   * * 1 vehicle starting its route at locA and ending it at locB, using
   *   matrix "fast".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "slow".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "fast".
   * * 1 pickup visit request at locC.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
   *   shipments { pickups { tags: "locC" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_src_tags: "locC"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locC"
   *   duration_distance_matrices {
   *     vehicle_start_tag: "fast"
   *     rows {  # from: locA
   *       durations { seconds: 1000 } meters: 2000 # to: locB
   *       durations { seconds: 600 }  meters: 1000 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }   meters: 0    # to: locB
   *       durations { seconds: 700 } meters: 1200 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 702 } meters: 1190 # to: locB
   *       durations { seconds: 0 }   meters: 0    # to: locC
   *     }
   *   }
   *   duration_distance_matrices {
   *     vehicle_start_tag: "slow"
   *     rows {  # from: locA
   *       durations { seconds: 1800 } meters: 2001 # to: locB
   *       durations { seconds: 900 }  meters: 1002 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }    meters: 0    # to: locB
   *       durations { seconds: 1000 } meters: 1202 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 1001 } meters: 1195 # to: locB
   *       durations { seconds: 0 }    meters: 0    # to: locC
   *     }
   *   }
   * }
   * ```
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix getDurationDistanceMatrices(int index) { return durationDistanceMatrices_.get(index); } /** * * *
   * Specifies duration and distance matrices used in the model. If this field
   * is empty, Google Maps or geodesic distances will be used instead, depending
   * on the value of the `use_geodesic_distances` field. If it is not empty,
   * `use_geodesic_distances` cannot be true and neither
   * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
   * can be empty.
   *
   * Usage examples:
   *
   * * There are two locations: locA and locB.
   * * 1 vehicle starting its route at locA and ending it at locA.
   * * 1 pickup visit request at locB.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA"  end_tags: "locA" }
   *   shipments { pickups { tags: "locB" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locA"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrices {
   *     rows {  # from: locA
   *       durations { seconds: 0 }   meters: 0    # to: locA
   *       durations { seconds: 100 } meters: 1000 # to: locB
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 102 } meters: 990 # to: locA
   *       durations { seconds: 0 }   meters: 0   # to: locB
   *     }
   *   }
   * }
   * ```
   *
   *
   * * There are three locations: locA, locB and locC.
   * * 1 vehicle starting its route at locA and ending it at locB, using
   *   matrix "fast".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "slow".
   * * 1 vehicle starting its route at locB and ending it at locB, using
   *   matrix "fast".
   * * 1 pickup visit request at locC.
   *
   * ```
   * model {
   *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
   *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
   *   shipments { pickups { tags: "locC" } }
   *   duration_distance_matrix_src_tags: "locA"
   *   duration_distance_matrix_src_tags: "locB"
   *   duration_distance_matrix_src_tags: "locC"
   *   duration_distance_matrix_dst_tags: "locB"
   *   duration_distance_matrix_dst_tags: "locC"
   *   duration_distance_matrices {
   *     vehicle_start_tag: "fast"
   *     rows {  # from: locA
   *       durations { seconds: 1000 } meters: 2000 # to: locB
   *       durations { seconds: 600 }  meters: 1000 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }   meters: 0    # to: locB
   *       durations { seconds: 700 } meters: 1200 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 702 } meters: 1190 # to: locB
   *       durations { seconds: 0 }   meters: 0    # to: locC
   *     }
   *   }
   *   duration_distance_matrices {
   *     vehicle_start_tag: "slow"
   *     rows {  # from: locA
   *       durations { seconds: 1800 } meters: 2001 # to: locB
   *       durations { seconds: 900 }  meters: 1002 # to: locC
   *     }
   *     rows {  # from: locB
   *       durations { seconds: 0 }    meters: 0    # to: locB
   *       durations { seconds: 1000 } meters: 1202 # to: locC
   *     }
   *     rows {  # from: locC
   *       durations { seconds: 1001 } meters: 1195 # to: locB
   *       durations { seconds: 0 }    meters: 0    # to: locC
   *     }
   *   }
   * }
   * ```
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder getDurationDistanceMatricesOrBuilder(int index) { return durationDistanceMatrices_.get(index); } public static final int DURATION_DISTANCE_MATRIX_SRC_TAGS_FIELD_NUMBER = 9; @SuppressWarnings("serial") private com.google.protobuf.LazyStringArrayList durationDistanceMatrixSrcTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); /** * * *
   * Tags defining the sources of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j)` defines durations and distances
   * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
   * in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @return A list containing the durationDistanceMatrixSrcTags. */ public com.google.protobuf.ProtocolStringList getDurationDistanceMatrixSrcTagsList() { return durationDistanceMatrixSrcTags_; } /** * * *
   * Tags defining the sources of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j)` defines durations and distances
   * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
   * in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @return The count of durationDistanceMatrixSrcTags. */ public int getDurationDistanceMatrixSrcTagsCount() { return durationDistanceMatrixSrcTags_.size(); } /** * * *
   * Tags defining the sources of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j)` defines durations and distances
   * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
   * in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param index The index of the element to return. * @return The durationDistanceMatrixSrcTags at the given index. */ public java.lang.String getDurationDistanceMatrixSrcTags(int index) { return durationDistanceMatrixSrcTags_.get(index); } /** * * *
   * Tags defining the sources of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j)` defines durations and distances
   * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
   * in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param index The index of the value to return. * @return The bytes of the durationDistanceMatrixSrcTags at the given index. */ public com.google.protobuf.ByteString getDurationDistanceMatrixSrcTagsBytes(int index) { return durationDistanceMatrixSrcTags_.getByteString(index); } public static final int DURATION_DISTANCE_MATRIX_DST_TAGS_FIELD_NUMBER = 10; @SuppressWarnings("serial") private com.google.protobuf.LazyStringArrayList durationDistanceMatrixDstTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); /** * * *
   * Tags defining the destinations of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
   * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
   * (resp. the distance) of the travel from visits with tag
   * `duration_distance_matrix_src_tags(j)` to visits with tag
   * `duration_distance_matrix_dst_tags(k)` in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @return A list containing the durationDistanceMatrixDstTags. */ public com.google.protobuf.ProtocolStringList getDurationDistanceMatrixDstTagsList() { return durationDistanceMatrixDstTags_; } /** * * *
   * Tags defining the destinations of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
   * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
   * (resp. the distance) of the travel from visits with tag
   * `duration_distance_matrix_src_tags(j)` to visits with tag
   * `duration_distance_matrix_dst_tags(k)` in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @return The count of durationDistanceMatrixDstTags. */ public int getDurationDistanceMatrixDstTagsCount() { return durationDistanceMatrixDstTags_.size(); } /** * * *
   * Tags defining the destinations of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
   * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
   * (resp. the distance) of the travel from visits with tag
   * `duration_distance_matrix_src_tags(j)` to visits with tag
   * `duration_distance_matrix_dst_tags(k)` in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param index The index of the element to return. * @return The durationDistanceMatrixDstTags at the given index. */ public java.lang.String getDurationDistanceMatrixDstTags(int index) { return durationDistanceMatrixDstTags_.get(index); } /** * * *
   * Tags defining the destinations of the duration and distance matrices;
   * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
   * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
   * (resp. the distance) of the travel from visits with tag
   * `duration_distance_matrix_src_tags(j)` to visits with tag
   * `duration_distance_matrix_dst_tags(k)` in matrix i.
   *
   * Tags correspond to
   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
   * or
   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
   * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
   * field. Note that a `Vehicle`'s source, destination and matrix tags may be
   * the same; similarly a `VisitRequest`'s source and destination tags may be
   * the same. All tags must be different and cannot be empty strings. If this
   * field is not empty, then `duration_distance_matrices` must not be empty.
   * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param index The index of the value to return. * @return The bytes of the durationDistanceMatrixDstTags at the given index. */ public com.google.protobuf.ByteString getDurationDistanceMatrixDstTagsBytes(int index) { return durationDistanceMatrixDstTags_.getByteString(index); } public static final int TRANSITION_ATTRIBUTES_FIELD_NUMBER = 11; @SuppressWarnings("serial") private java.util.List transitionAttributes_; /** * * *
   * Transition attributes added to the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ @java.lang.Override public java.util.List getTransitionAttributesList() { return transitionAttributes_; } /** * * *
   * Transition attributes added to the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ @java.lang.Override public java.util.List< ? extends com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder> getTransitionAttributesOrBuilderList() { return transitionAttributes_; } /** * * *
   * Transition attributes added to the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ @java.lang.Override public int getTransitionAttributesCount() { return transitionAttributes_.size(); } /** * * *
   * Transition attributes added to the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.TransitionAttributes getTransitionAttributes( int index) { return transitionAttributes_.get(index); } /** * * *
   * Transition attributes added to the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder getTransitionAttributesOrBuilder(int index) { return transitionAttributes_.get(index); } public static final int SHIPMENT_TYPE_INCOMPATIBILITIES_FIELD_NUMBER = 12; @SuppressWarnings("serial") private java.util.List shipmentTypeIncompatibilities_; /** * * *
   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ @java.lang.Override public java.util.List getShipmentTypeIncompatibilitiesList() { return shipmentTypeIncompatibilities_; } /** * * *
   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ @java.lang.Override public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder> getShipmentTypeIncompatibilitiesOrBuilderList() { return shipmentTypeIncompatibilities_; } /** * * *
   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ @java.lang.Override public int getShipmentTypeIncompatibilitiesCount() { return shipmentTypeIncompatibilities_.size(); } /** * * *
   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility getShipmentTypeIncompatibilities(int index) { return shipmentTypeIncompatibilities_.get(index); } /** * * *
   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder getShipmentTypeIncompatibilitiesOrBuilder(int index) { return shipmentTypeIncompatibilities_.get(index); } public static final int SHIPMENT_TYPE_REQUIREMENTS_FIELD_NUMBER = 13; @SuppressWarnings("serial") private java.util.List shipmentTypeRequirements_; /** * * *
   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ @java.lang.Override public java.util.List getShipmentTypeRequirementsList() { return shipmentTypeRequirements_; } /** * * *
   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ @java.lang.Override public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder> getShipmentTypeRequirementsOrBuilderList() { return shipmentTypeRequirements_; } /** * * *
   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ @java.lang.Override public int getShipmentTypeRequirementsCount() { return shipmentTypeRequirements_.size(); } /** * * *
   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement getShipmentTypeRequirements( int index) { return shipmentTypeRequirements_.get(index); } /** * * *
   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder getShipmentTypeRequirementsOrBuilder(int index) { return shipmentTypeRequirements_.get(index); } public static final int PRECEDENCE_RULES_FIELD_NUMBER = 14; @SuppressWarnings("serial") private java.util.List precedenceRules_; /** * * *
   * Set of precedence rules which must be enforced in the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ @java.lang.Override public java.util.List getPrecedenceRulesList() { return precedenceRules_; } /** * * *
   * Set of precedence rules which must be enforced in the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ @java.lang.Override public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder> getPrecedenceRulesOrBuilderList() { return precedenceRules_; } /** * * *
   * Set of precedence rules which must be enforced in the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ @java.lang.Override public int getPrecedenceRulesCount() { return precedenceRules_.size(); } /** * * *
   * Set of precedence rules which must be enforced in the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule getPrecedenceRules( int index) { return precedenceRules_.get(index); } /** * * *
   * Set of precedence rules which must be enforced in the model.
   * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder getPrecedenceRulesOrBuilder(int index) { return precedenceRules_.get(index); } 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 { for (int i = 0; i < shipments_.size(); i++) { output.writeMessage(1, shipments_.get(i)); } for (int i = 0; i < vehicles_.size(); i++) { output.writeMessage(2, vehicles_.get(i)); } if (((bitField0_ & 0x00000001) != 0)) { output.writeInt32(4, maxActiveVehicles_); } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(5, getGlobalStartTime()); } if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(6, getGlobalEndTime()); } if (java.lang.Double.doubleToRawLongBits(globalDurationCostPerHour_) != 0) { output.writeDouble(7, globalDurationCostPerHour_); } for (int i = 0; i < durationDistanceMatrices_.size(); i++) { output.writeMessage(8, durationDistanceMatrices_.get(i)); } for (int i = 0; i < durationDistanceMatrixSrcTags_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString( output, 9, durationDistanceMatrixSrcTags_.getRaw(i)); } for (int i = 0; i < durationDistanceMatrixDstTags_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString( output, 10, durationDistanceMatrixDstTags_.getRaw(i)); } for (int i = 0; i < transitionAttributes_.size(); i++) { output.writeMessage(11, transitionAttributes_.get(i)); } for (int i = 0; i < shipmentTypeIncompatibilities_.size(); i++) { output.writeMessage(12, shipmentTypeIncompatibilities_.get(i)); } for (int i = 0; i < shipmentTypeRequirements_.size(); i++) { output.writeMessage(13, shipmentTypeRequirements_.get(i)); } for (int i = 0; i < precedenceRules_.size(); i++) { output.writeMessage(14, precedenceRules_.get(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < shipments_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, shipments_.get(i)); } for (int i = 0; i < vehicles_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, vehicles_.get(i)); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, maxActiveVehicles_); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getGlobalStartTime()); } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getGlobalEndTime()); } if (java.lang.Double.doubleToRawLongBits(globalDurationCostPerHour_) != 0) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(7, globalDurationCostPerHour_); } for (int i = 0; i < durationDistanceMatrices_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 8, durationDistanceMatrices_.get(i)); } { int dataSize = 0; for (int i = 0; i < durationDistanceMatrixSrcTags_.size(); i++) { dataSize += computeStringSizeNoTag(durationDistanceMatrixSrcTags_.getRaw(i)); } size += dataSize; size += 1 * getDurationDistanceMatrixSrcTagsList().size(); } { int dataSize = 0; for (int i = 0; i < durationDistanceMatrixDstTags_.size(); i++) { dataSize += computeStringSizeNoTag(durationDistanceMatrixDstTags_.getRaw(i)); } size += dataSize; size += 1 * getDurationDistanceMatrixDstTagsList().size(); } for (int i = 0; i < transitionAttributes_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 11, transitionAttributes_.get(i)); } for (int i = 0; i < shipmentTypeIncompatibilities_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 12, shipmentTypeIncompatibilities_.get(i)); } for (int i = 0; i < shipmentTypeRequirements_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 13, shipmentTypeRequirements_.get(i)); } for (int i = 0; i < precedenceRules_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, precedenceRules_.get(i)); } 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.ShipmentModel)) { return super.equals(obj); } com.google.maps.routeoptimization.v1.ShipmentModel other = (com.google.maps.routeoptimization.v1.ShipmentModel) obj; if (!getShipmentsList().equals(other.getShipmentsList())) return false; if (!getVehiclesList().equals(other.getVehiclesList())) return false; if (hasMaxActiveVehicles() != other.hasMaxActiveVehicles()) return false; if (hasMaxActiveVehicles()) { if (getMaxActiveVehicles() != other.getMaxActiveVehicles()) return false; } if (hasGlobalStartTime() != other.hasGlobalStartTime()) return false; if (hasGlobalStartTime()) { if (!getGlobalStartTime().equals(other.getGlobalStartTime())) return false; } if (hasGlobalEndTime() != other.hasGlobalEndTime()) return false; if (hasGlobalEndTime()) { if (!getGlobalEndTime().equals(other.getGlobalEndTime())) return false; } if (java.lang.Double.doubleToLongBits(getGlobalDurationCostPerHour()) != java.lang.Double.doubleToLongBits(other.getGlobalDurationCostPerHour())) return false; if (!getDurationDistanceMatricesList().equals(other.getDurationDistanceMatricesList())) return false; if (!getDurationDistanceMatrixSrcTagsList() .equals(other.getDurationDistanceMatrixSrcTagsList())) return false; if (!getDurationDistanceMatrixDstTagsList() .equals(other.getDurationDistanceMatrixDstTagsList())) return false; if (!getTransitionAttributesList().equals(other.getTransitionAttributesList())) return false; if (!getShipmentTypeIncompatibilitiesList() .equals(other.getShipmentTypeIncompatibilitiesList())) return false; if (!getShipmentTypeRequirementsList().equals(other.getShipmentTypeRequirementsList())) return false; if (!getPrecedenceRulesList().equals(other.getPrecedenceRulesList())) 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 (getShipmentsCount() > 0) { hash = (37 * hash) + SHIPMENTS_FIELD_NUMBER; hash = (53 * hash) + getShipmentsList().hashCode(); } if (getVehiclesCount() > 0) { hash = (37 * hash) + VEHICLES_FIELD_NUMBER; hash = (53 * hash) + getVehiclesList().hashCode(); } if (hasMaxActiveVehicles()) { hash = (37 * hash) + MAX_ACTIVE_VEHICLES_FIELD_NUMBER; hash = (53 * hash) + getMaxActiveVehicles(); } if (hasGlobalStartTime()) { hash = (37 * hash) + GLOBAL_START_TIME_FIELD_NUMBER; hash = (53 * hash) + getGlobalStartTime().hashCode(); } if (hasGlobalEndTime()) { hash = (37 * hash) + GLOBAL_END_TIME_FIELD_NUMBER; hash = (53 * hash) + getGlobalEndTime().hashCode(); } hash = (37 * hash) + GLOBAL_DURATION_COST_PER_HOUR_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getGlobalDurationCostPerHour())); if (getDurationDistanceMatricesCount() > 0) { hash = (37 * hash) + DURATION_DISTANCE_MATRICES_FIELD_NUMBER; hash = (53 * hash) + getDurationDistanceMatricesList().hashCode(); } if (getDurationDistanceMatrixSrcTagsCount() > 0) { hash = (37 * hash) + DURATION_DISTANCE_MATRIX_SRC_TAGS_FIELD_NUMBER; hash = (53 * hash) + getDurationDistanceMatrixSrcTagsList().hashCode(); } if (getDurationDistanceMatrixDstTagsCount() > 0) { hash = (37 * hash) + DURATION_DISTANCE_MATRIX_DST_TAGS_FIELD_NUMBER; hash = (53 * hash) + getDurationDistanceMatrixDstTagsList().hashCode(); } if (getTransitionAttributesCount() > 0) { hash = (37 * hash) + TRANSITION_ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + getTransitionAttributesList().hashCode(); } if (getShipmentTypeIncompatibilitiesCount() > 0) { hash = (37 * hash) + SHIPMENT_TYPE_INCOMPATIBILITIES_FIELD_NUMBER; hash = (53 * hash) + getShipmentTypeIncompatibilitiesList().hashCode(); } if (getShipmentTypeRequirementsCount() > 0) { hash = (37 * hash) + SHIPMENT_TYPE_REQUIREMENTS_FIELD_NUMBER; hash = (53 * hash) + getShipmentTypeRequirementsList().hashCode(); } if (getPrecedenceRulesCount() > 0) { hash = (37 * hash) + PRECEDENCE_RULES_FIELD_NUMBER; hash = (53 * hash) + getPrecedenceRulesList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.maps.routeoptimization.v1.ShipmentModel parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel 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.ShipmentModel parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel 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.ShipmentModel parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.maps.routeoptimization.v1.ShipmentModel 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.ShipmentModel parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel 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.ShipmentModel parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.maps.routeoptimization.v1.ShipmentModel 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.ShipmentModel 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.ShipmentModel 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.ShipmentModel 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; } /** * * *
   * A shipment model contains a set of shipments which must be performed by a
   * set of vehicles, while minimizing the overall cost, which is the sum of:
   *
   * * the cost of routing the vehicles (sum of cost per total time, cost per
   *   travel time, and fixed cost over all vehicles).
   * * the unperformed shipment penalties.
   * * the cost of the global duration of the shipments
   * 
* * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentModel} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentModel) com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto .internal_static_google_maps_routeoptimization_v1_ShipmentModel_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.maps.routeoptimization.v1.ShipmentModel.class, com.google.maps.routeoptimization.v1.ShipmentModel.Builder.class); } // Construct using com.google.maps.routeoptimization.v1.ShipmentModel.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getShipmentsFieldBuilder(); getVehiclesFieldBuilder(); getGlobalStartTimeFieldBuilder(); getGlobalEndTimeFieldBuilder(); getDurationDistanceMatricesFieldBuilder(); getTransitionAttributesFieldBuilder(); getShipmentTypeIncompatibilitiesFieldBuilder(); getShipmentTypeRequirementsFieldBuilder(); getPrecedenceRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; if (shipmentsBuilder_ == null) { shipments_ = java.util.Collections.emptyList(); } else { shipments_ = null; shipmentsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); if (vehiclesBuilder_ == null) { vehicles_ = java.util.Collections.emptyList(); } else { vehicles_ = null; vehiclesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); maxActiveVehicles_ = 0; globalStartTime_ = null; if (globalStartTimeBuilder_ != null) { globalStartTimeBuilder_.dispose(); globalStartTimeBuilder_ = null; } globalEndTime_ = null; if (globalEndTimeBuilder_ != null) { globalEndTimeBuilder_.dispose(); globalEndTimeBuilder_ = null; } globalDurationCostPerHour_ = 0D; if (durationDistanceMatricesBuilder_ == null) { durationDistanceMatrices_ = java.util.Collections.emptyList(); } else { durationDistanceMatrices_ = null; durationDistanceMatricesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000040); durationDistanceMatrixSrcTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); durationDistanceMatrixDstTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); if (transitionAttributesBuilder_ == null) { transitionAttributes_ = java.util.Collections.emptyList(); } else { transitionAttributes_ = null; transitionAttributesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000200); if (shipmentTypeIncompatibilitiesBuilder_ == null) { shipmentTypeIncompatibilities_ = java.util.Collections.emptyList(); } else { shipmentTypeIncompatibilities_ = null; shipmentTypeIncompatibilitiesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000400); if (shipmentTypeRequirementsBuilder_ == null) { shipmentTypeRequirements_ = java.util.Collections.emptyList(); } else { shipmentTypeRequirements_ = null; shipmentTypeRequirementsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000800); if (precedenceRulesBuilder_ == null) { precedenceRules_ = java.util.Collections.emptyList(); } else { precedenceRules_ = null; precedenceRulesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00001000); 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_ShipmentModel_descriptor; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel getDefaultInstanceForType() { return com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance(); } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel build() { com.google.maps.routeoptimization.v1.ShipmentModel result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.maps.routeoptimization.v1.ShipmentModel buildPartial() { com.google.maps.routeoptimization.v1.ShipmentModel result = new com.google.maps.routeoptimization.v1.ShipmentModel(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.maps.routeoptimization.v1.ShipmentModel result) { if (shipmentsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { shipments_ = java.util.Collections.unmodifiableList(shipments_); bitField0_ = (bitField0_ & ~0x00000001); } result.shipments_ = shipments_; } else { result.shipments_ = shipmentsBuilder_.build(); } if (vehiclesBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { vehicles_ = java.util.Collections.unmodifiableList(vehicles_); bitField0_ = (bitField0_ & ~0x00000002); } result.vehicles_ = vehicles_; } else { result.vehicles_ = vehiclesBuilder_.build(); } if (durationDistanceMatricesBuilder_ == null) { if (((bitField0_ & 0x00000040) != 0)) { durationDistanceMatrices_ = java.util.Collections.unmodifiableList(durationDistanceMatrices_); bitField0_ = (bitField0_ & ~0x00000040); } result.durationDistanceMatrices_ = durationDistanceMatrices_; } else { result.durationDistanceMatrices_ = durationDistanceMatricesBuilder_.build(); } if (transitionAttributesBuilder_ == null) { if (((bitField0_ & 0x00000200) != 0)) { transitionAttributes_ = java.util.Collections.unmodifiableList(transitionAttributes_); bitField0_ = (bitField0_ & ~0x00000200); } result.transitionAttributes_ = transitionAttributes_; } else { result.transitionAttributes_ = transitionAttributesBuilder_.build(); } if (shipmentTypeIncompatibilitiesBuilder_ == null) { if (((bitField0_ & 0x00000400) != 0)) { shipmentTypeIncompatibilities_ = java.util.Collections.unmodifiableList(shipmentTypeIncompatibilities_); bitField0_ = (bitField0_ & ~0x00000400); } result.shipmentTypeIncompatibilities_ = shipmentTypeIncompatibilities_; } else { result.shipmentTypeIncompatibilities_ = shipmentTypeIncompatibilitiesBuilder_.build(); } if (shipmentTypeRequirementsBuilder_ == null) { if (((bitField0_ & 0x00000800) != 0)) { shipmentTypeRequirements_ = java.util.Collections.unmodifiableList(shipmentTypeRequirements_); bitField0_ = (bitField0_ & ~0x00000800); } result.shipmentTypeRequirements_ = shipmentTypeRequirements_; } else { result.shipmentTypeRequirements_ = shipmentTypeRequirementsBuilder_.build(); } if (precedenceRulesBuilder_ == null) { if (((bitField0_ & 0x00001000) != 0)) { precedenceRules_ = java.util.Collections.unmodifiableList(precedenceRules_); bitField0_ = (bitField0_ & ~0x00001000); } result.precedenceRules_ = precedenceRules_; } else { result.precedenceRules_ = precedenceRulesBuilder_.build(); } } private void buildPartial0(com.google.maps.routeoptimization.v1.ShipmentModel result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000004) != 0)) { result.maxActiveVehicles_ = maxActiveVehicles_; to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000008) != 0)) { result.globalStartTime_ = globalStartTimeBuilder_ == null ? globalStartTime_ : globalStartTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000010) != 0)) { result.globalEndTime_ = globalEndTimeBuilder_ == null ? globalEndTime_ : globalEndTimeBuilder_.build(); to_bitField0_ |= 0x00000004; } if (((from_bitField0_ & 0x00000020) != 0)) { result.globalDurationCostPerHour_ = globalDurationCostPerHour_; } if (((from_bitField0_ & 0x00000080) != 0)) { durationDistanceMatrixSrcTags_.makeImmutable(); result.durationDistanceMatrixSrcTags_ = durationDistanceMatrixSrcTags_; } if (((from_bitField0_ & 0x00000100) != 0)) { durationDistanceMatrixDstTags_.makeImmutable(); result.durationDistanceMatrixDstTags_ = durationDistanceMatrixDstTags_; } 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.ShipmentModel) { return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentModel) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.maps.routeoptimization.v1.ShipmentModel other) { if (other == com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance()) return this; if (shipmentsBuilder_ == null) { if (!other.shipments_.isEmpty()) { if (shipments_.isEmpty()) { shipments_ = other.shipments_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureShipmentsIsMutable(); shipments_.addAll(other.shipments_); } onChanged(); } } else { if (!other.shipments_.isEmpty()) { if (shipmentsBuilder_.isEmpty()) { shipmentsBuilder_.dispose(); shipmentsBuilder_ = null; shipments_ = other.shipments_; bitField0_ = (bitField0_ & ~0x00000001); shipmentsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getShipmentsFieldBuilder() : null; } else { shipmentsBuilder_.addAllMessages(other.shipments_); } } } if (vehiclesBuilder_ == null) { if (!other.vehicles_.isEmpty()) { if (vehicles_.isEmpty()) { vehicles_ = other.vehicles_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureVehiclesIsMutable(); vehicles_.addAll(other.vehicles_); } onChanged(); } } else { if (!other.vehicles_.isEmpty()) { if (vehiclesBuilder_.isEmpty()) { vehiclesBuilder_.dispose(); vehiclesBuilder_ = null; vehicles_ = other.vehicles_; bitField0_ = (bitField0_ & ~0x00000002); vehiclesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getVehiclesFieldBuilder() : null; } else { vehiclesBuilder_.addAllMessages(other.vehicles_); } } } if (other.hasMaxActiveVehicles()) { setMaxActiveVehicles(other.getMaxActiveVehicles()); } if (other.hasGlobalStartTime()) { mergeGlobalStartTime(other.getGlobalStartTime()); } if (other.hasGlobalEndTime()) { mergeGlobalEndTime(other.getGlobalEndTime()); } if (other.getGlobalDurationCostPerHour() != 0D) { setGlobalDurationCostPerHour(other.getGlobalDurationCostPerHour()); } if (durationDistanceMatricesBuilder_ == null) { if (!other.durationDistanceMatrices_.isEmpty()) { if (durationDistanceMatrices_.isEmpty()) { durationDistanceMatrices_ = other.durationDistanceMatrices_; bitField0_ = (bitField0_ & ~0x00000040); } else { ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.addAll(other.durationDistanceMatrices_); } onChanged(); } } else { if (!other.durationDistanceMatrices_.isEmpty()) { if (durationDistanceMatricesBuilder_.isEmpty()) { durationDistanceMatricesBuilder_.dispose(); durationDistanceMatricesBuilder_ = null; durationDistanceMatrices_ = other.durationDistanceMatrices_; bitField0_ = (bitField0_ & ~0x00000040); durationDistanceMatricesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDurationDistanceMatricesFieldBuilder() : null; } else { durationDistanceMatricesBuilder_.addAllMessages(other.durationDistanceMatrices_); } } } if (!other.durationDistanceMatrixSrcTags_.isEmpty()) { if (durationDistanceMatrixSrcTags_.isEmpty()) { durationDistanceMatrixSrcTags_ = other.durationDistanceMatrixSrcTags_; bitField0_ |= 0x00000080; } else { ensureDurationDistanceMatrixSrcTagsIsMutable(); durationDistanceMatrixSrcTags_.addAll(other.durationDistanceMatrixSrcTags_); } onChanged(); } if (!other.durationDistanceMatrixDstTags_.isEmpty()) { if (durationDistanceMatrixDstTags_.isEmpty()) { durationDistanceMatrixDstTags_ = other.durationDistanceMatrixDstTags_; bitField0_ |= 0x00000100; } else { ensureDurationDistanceMatrixDstTagsIsMutable(); durationDistanceMatrixDstTags_.addAll(other.durationDistanceMatrixDstTags_); } onChanged(); } if (transitionAttributesBuilder_ == null) { if (!other.transitionAttributes_.isEmpty()) { if (transitionAttributes_.isEmpty()) { transitionAttributes_ = other.transitionAttributes_; bitField0_ = (bitField0_ & ~0x00000200); } else { ensureTransitionAttributesIsMutable(); transitionAttributes_.addAll(other.transitionAttributes_); } onChanged(); } } else { if (!other.transitionAttributes_.isEmpty()) { if (transitionAttributesBuilder_.isEmpty()) { transitionAttributesBuilder_.dispose(); transitionAttributesBuilder_ = null; transitionAttributes_ = other.transitionAttributes_; bitField0_ = (bitField0_ & ~0x00000200); transitionAttributesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTransitionAttributesFieldBuilder() : null; } else { transitionAttributesBuilder_.addAllMessages(other.transitionAttributes_); } } } if (shipmentTypeIncompatibilitiesBuilder_ == null) { if (!other.shipmentTypeIncompatibilities_.isEmpty()) { if (shipmentTypeIncompatibilities_.isEmpty()) { shipmentTypeIncompatibilities_ = other.shipmentTypeIncompatibilities_; bitField0_ = (bitField0_ & ~0x00000400); } else { ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.addAll(other.shipmentTypeIncompatibilities_); } onChanged(); } } else { if (!other.shipmentTypeIncompatibilities_.isEmpty()) { if (shipmentTypeIncompatibilitiesBuilder_.isEmpty()) { shipmentTypeIncompatibilitiesBuilder_.dispose(); shipmentTypeIncompatibilitiesBuilder_ = null; shipmentTypeIncompatibilities_ = other.shipmentTypeIncompatibilities_; bitField0_ = (bitField0_ & ~0x00000400); shipmentTypeIncompatibilitiesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getShipmentTypeIncompatibilitiesFieldBuilder() : null; } else { shipmentTypeIncompatibilitiesBuilder_.addAllMessages( other.shipmentTypeIncompatibilities_); } } } if (shipmentTypeRequirementsBuilder_ == null) { if (!other.shipmentTypeRequirements_.isEmpty()) { if (shipmentTypeRequirements_.isEmpty()) { shipmentTypeRequirements_ = other.shipmentTypeRequirements_; bitField0_ = (bitField0_ & ~0x00000800); } else { ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.addAll(other.shipmentTypeRequirements_); } onChanged(); } } else { if (!other.shipmentTypeRequirements_.isEmpty()) { if (shipmentTypeRequirementsBuilder_.isEmpty()) { shipmentTypeRequirementsBuilder_.dispose(); shipmentTypeRequirementsBuilder_ = null; shipmentTypeRequirements_ = other.shipmentTypeRequirements_; bitField0_ = (bitField0_ & ~0x00000800); shipmentTypeRequirementsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getShipmentTypeRequirementsFieldBuilder() : null; } else { shipmentTypeRequirementsBuilder_.addAllMessages(other.shipmentTypeRequirements_); } } } if (precedenceRulesBuilder_ == null) { if (!other.precedenceRules_.isEmpty()) { if (precedenceRules_.isEmpty()) { precedenceRules_ = other.precedenceRules_; bitField0_ = (bitField0_ & ~0x00001000); } else { ensurePrecedenceRulesIsMutable(); precedenceRules_.addAll(other.precedenceRules_); } onChanged(); } } else { if (!other.precedenceRules_.isEmpty()) { if (precedenceRulesBuilder_.isEmpty()) { precedenceRulesBuilder_.dispose(); precedenceRulesBuilder_ = null; precedenceRules_ = other.precedenceRules_; bitField0_ = (bitField0_ & ~0x00001000); precedenceRulesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPrecedenceRulesFieldBuilder() : null; } else { precedenceRulesBuilder_.addAllMessages(other.precedenceRules_); } } } 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 m = input.readMessage( com.google.maps.routeoptimization.v1.Shipment.parser(), extensionRegistry); if (shipmentsBuilder_ == null) { ensureShipmentsIsMutable(); shipments_.add(m); } else { shipmentsBuilder_.addMessage(m); } break; } // case 10 case 18: { com.google.maps.routeoptimization.v1.Vehicle m = input.readMessage( com.google.maps.routeoptimization.v1.Vehicle.parser(), extensionRegistry); if (vehiclesBuilder_ == null) { ensureVehiclesIsMutable(); vehicles_.add(m); } else { vehiclesBuilder_.addMessage(m); } break; } // case 18 case 32: { maxActiveVehicles_ = input.readInt32(); bitField0_ |= 0x00000004; break; } // case 32 case 42: { input.readMessage(getGlobalStartTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000008; break; } // case 42 case 50: { input.readMessage(getGlobalEndTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000010; break; } // case 50 case 57: { globalDurationCostPerHour_ = input.readDouble(); bitField0_ |= 0x00000020; break; } // case 57 case 66: { com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix m = input.readMessage( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .parser(), extensionRegistry); if (durationDistanceMatricesBuilder_ == null) { ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.add(m); } else { durationDistanceMatricesBuilder_.addMessage(m); } break; } // case 66 case 74: { java.lang.String s = input.readStringRequireUtf8(); ensureDurationDistanceMatrixSrcTagsIsMutable(); durationDistanceMatrixSrcTags_.add(s); break; } // case 74 case 82: { java.lang.String s = input.readStringRequireUtf8(); ensureDurationDistanceMatrixDstTagsIsMutable(); durationDistanceMatrixDstTags_.add(s); break; } // case 82 case 90: { com.google.maps.routeoptimization.v1.TransitionAttributes m = input.readMessage( com.google.maps.routeoptimization.v1.TransitionAttributes.parser(), extensionRegistry); if (transitionAttributesBuilder_ == null) { ensureTransitionAttributesIsMutable(); transitionAttributes_.add(m); } else { transitionAttributesBuilder_.addMessage(m); } break; } // case 90 case 98: { com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility m = input.readMessage( com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.parser(), extensionRegistry); if (shipmentTypeIncompatibilitiesBuilder_ == null) { ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.add(m); } else { shipmentTypeIncompatibilitiesBuilder_.addMessage(m); } break; } // case 98 case 106: { com.google.maps.routeoptimization.v1.ShipmentTypeRequirement m = input.readMessage( com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.parser(), extensionRegistry); if (shipmentTypeRequirementsBuilder_ == null) { ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.add(m); } else { shipmentTypeRequirementsBuilder_.addMessage(m); } break; } // case 106 case 114: { com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule m = input.readMessage( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.parser(), extensionRegistry); if (precedenceRulesBuilder_ == null) { ensurePrecedenceRulesIsMutable(); precedenceRules_.add(m); } else { precedenceRulesBuilder_.addMessage(m); } break; } // case 114 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.util.List shipments_ = java.util.Collections.emptyList(); private void ensureShipmentsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { shipments_ = new java.util.ArrayList(shipments_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.Shipment, com.google.maps.routeoptimization.v1.Shipment.Builder, com.google.maps.routeoptimization.v1.ShipmentOrBuilder> shipmentsBuilder_; /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public java.util.List getShipmentsList() { if (shipmentsBuilder_ == null) { return java.util.Collections.unmodifiableList(shipments_); } else { return shipmentsBuilder_.getMessageList(); } } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public int getShipmentsCount() { if (shipmentsBuilder_ == null) { return shipments_.size(); } else { return shipmentsBuilder_.getCount(); } } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public com.google.maps.routeoptimization.v1.Shipment getShipments(int index) { if (shipmentsBuilder_ == null) { return shipments_.get(index); } else { return shipmentsBuilder_.getMessage(index); } } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder setShipments(int index, com.google.maps.routeoptimization.v1.Shipment value) { if (shipmentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentsIsMutable(); shipments_.set(index, value); onChanged(); } else { shipmentsBuilder_.setMessage(index, value); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder setShipments( int index, com.google.maps.routeoptimization.v1.Shipment.Builder builderForValue) { if (shipmentsBuilder_ == null) { ensureShipmentsIsMutable(); shipments_.set(index, builderForValue.build()); onChanged(); } else { shipmentsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder addShipments(com.google.maps.routeoptimization.v1.Shipment value) { if (shipmentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentsIsMutable(); shipments_.add(value); onChanged(); } else { shipmentsBuilder_.addMessage(value); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder addShipments(int index, com.google.maps.routeoptimization.v1.Shipment value) { if (shipmentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentsIsMutable(); shipments_.add(index, value); onChanged(); } else { shipmentsBuilder_.addMessage(index, value); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder addShipments( com.google.maps.routeoptimization.v1.Shipment.Builder builderForValue) { if (shipmentsBuilder_ == null) { ensureShipmentsIsMutable(); shipments_.add(builderForValue.build()); onChanged(); } else { shipmentsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder addShipments( int index, com.google.maps.routeoptimization.v1.Shipment.Builder builderForValue) { if (shipmentsBuilder_ == null) { ensureShipmentsIsMutable(); shipments_.add(index, builderForValue.build()); onChanged(); } else { shipmentsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder addAllShipments( java.lang.Iterable values) { if (shipmentsBuilder_ == null) { ensureShipmentsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, shipments_); onChanged(); } else { shipmentsBuilder_.addAllMessages(values); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder clearShipments() { if (shipmentsBuilder_ == null) { shipments_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { shipmentsBuilder_.clear(); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public Builder removeShipments(int index) { if (shipmentsBuilder_ == null) { ensureShipmentsIsMutable(); shipments_.remove(index); onChanged(); } else { shipmentsBuilder_.remove(index); } return this; } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public com.google.maps.routeoptimization.v1.Shipment.Builder getShipmentsBuilder(int index) { return getShipmentsFieldBuilder().getBuilder(index); } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public com.google.maps.routeoptimization.v1.ShipmentOrBuilder getShipmentsOrBuilder(int index) { if (shipmentsBuilder_ == null) { return shipments_.get(index); } else { return shipmentsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public java.util.List getShipmentsOrBuilderList() { if (shipmentsBuilder_ != null) { return shipmentsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(shipments_); } } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public com.google.maps.routeoptimization.v1.Shipment.Builder addShipmentsBuilder() { return getShipmentsFieldBuilder() .addBuilder(com.google.maps.routeoptimization.v1.Shipment.getDefaultInstance()); } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public com.google.maps.routeoptimization.v1.Shipment.Builder addShipmentsBuilder(int index) { return getShipmentsFieldBuilder() .addBuilder(index, com.google.maps.routeoptimization.v1.Shipment.getDefaultInstance()); } /** * * *
     * Set of shipments which must be performed in the model.
     * 
* * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; */ public java.util.List getShipmentsBuilderList() { return getShipmentsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.Shipment, com.google.maps.routeoptimization.v1.Shipment.Builder, com.google.maps.routeoptimization.v1.ShipmentOrBuilder> getShipmentsFieldBuilder() { if (shipmentsBuilder_ == null) { shipmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.Shipment, com.google.maps.routeoptimization.v1.Shipment.Builder, com.google.maps.routeoptimization.v1.ShipmentOrBuilder>( shipments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); shipments_ = null; } return shipmentsBuilder_; } private java.util.List vehicles_ = java.util.Collections.emptyList(); private void ensureVehiclesIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { vehicles_ = new java.util.ArrayList(vehicles_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.Vehicle, com.google.maps.routeoptimization.v1.Vehicle.Builder, com.google.maps.routeoptimization.v1.VehicleOrBuilder> vehiclesBuilder_; /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public java.util.List getVehiclesList() { if (vehiclesBuilder_ == null) { return java.util.Collections.unmodifiableList(vehicles_); } else { return vehiclesBuilder_.getMessageList(); } } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public int getVehiclesCount() { if (vehiclesBuilder_ == null) { return vehicles_.size(); } else { return vehiclesBuilder_.getCount(); } } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public com.google.maps.routeoptimization.v1.Vehicle getVehicles(int index) { if (vehiclesBuilder_ == null) { return vehicles_.get(index); } else { return vehiclesBuilder_.getMessage(index); } } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder setVehicles(int index, com.google.maps.routeoptimization.v1.Vehicle value) { if (vehiclesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureVehiclesIsMutable(); vehicles_.set(index, value); onChanged(); } else { vehiclesBuilder_.setMessage(index, value); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder setVehicles( int index, com.google.maps.routeoptimization.v1.Vehicle.Builder builderForValue) { if (vehiclesBuilder_ == null) { ensureVehiclesIsMutable(); vehicles_.set(index, builderForValue.build()); onChanged(); } else { vehiclesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder addVehicles(com.google.maps.routeoptimization.v1.Vehicle value) { if (vehiclesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureVehiclesIsMutable(); vehicles_.add(value); onChanged(); } else { vehiclesBuilder_.addMessage(value); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder addVehicles(int index, com.google.maps.routeoptimization.v1.Vehicle value) { if (vehiclesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureVehiclesIsMutable(); vehicles_.add(index, value); onChanged(); } else { vehiclesBuilder_.addMessage(index, value); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder addVehicles( com.google.maps.routeoptimization.v1.Vehicle.Builder builderForValue) { if (vehiclesBuilder_ == null) { ensureVehiclesIsMutable(); vehicles_.add(builderForValue.build()); onChanged(); } else { vehiclesBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder addVehicles( int index, com.google.maps.routeoptimization.v1.Vehicle.Builder builderForValue) { if (vehiclesBuilder_ == null) { ensureVehiclesIsMutable(); vehicles_.add(index, builderForValue.build()); onChanged(); } else { vehiclesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder addAllVehicles( java.lang.Iterable values) { if (vehiclesBuilder_ == null) { ensureVehiclesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vehicles_); onChanged(); } else { vehiclesBuilder_.addAllMessages(values); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder clearVehicles() { if (vehiclesBuilder_ == null) { vehicles_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { vehiclesBuilder_.clear(); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public Builder removeVehicles(int index) { if (vehiclesBuilder_ == null) { ensureVehiclesIsMutable(); vehicles_.remove(index); onChanged(); } else { vehiclesBuilder_.remove(index); } return this; } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public com.google.maps.routeoptimization.v1.Vehicle.Builder getVehiclesBuilder(int index) { return getVehiclesFieldBuilder().getBuilder(index); } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public com.google.maps.routeoptimization.v1.VehicleOrBuilder getVehiclesOrBuilder(int index) { if (vehiclesBuilder_ == null) { return vehicles_.get(index); } else { return vehiclesBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public java.util.List getVehiclesOrBuilderList() { if (vehiclesBuilder_ != null) { return vehiclesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(vehicles_); } } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public com.google.maps.routeoptimization.v1.Vehicle.Builder addVehiclesBuilder() { return getVehiclesFieldBuilder() .addBuilder(com.google.maps.routeoptimization.v1.Vehicle.getDefaultInstance()); } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public com.google.maps.routeoptimization.v1.Vehicle.Builder addVehiclesBuilder(int index) { return getVehiclesFieldBuilder() .addBuilder(index, com.google.maps.routeoptimization.v1.Vehicle.getDefaultInstance()); } /** * * *
     * Set of vehicles which can be used to perform visits.
     * 
* * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; */ public java.util.List getVehiclesBuilderList() { return getVehiclesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.Vehicle, com.google.maps.routeoptimization.v1.Vehicle.Builder, com.google.maps.routeoptimization.v1.VehicleOrBuilder> getVehiclesFieldBuilder() { if (vehiclesBuilder_ == null) { vehiclesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.Vehicle, com.google.maps.routeoptimization.v1.Vehicle.Builder, com.google.maps.routeoptimization.v1.VehicleOrBuilder>( vehicles_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); vehicles_ = null; } return vehiclesBuilder_; } private int maxActiveVehicles_; /** * * *
     * Constrains the maximum number of active vehicles. A vehicle is active if
     * its route performs at least one shipment. This can be used to limit the
     * number of routes in the case where there are fewer drivers than
     * vehicles and that the fleet of vehicles is heterogeneous. The optimization
     * will then select the best subset of vehicles to use.
     * Must be strictly positive.
     * 
* * optional int32 max_active_vehicles = 4; * * @return Whether the maxActiveVehicles field is set. */ @java.lang.Override public boolean hasMaxActiveVehicles() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
     * Constrains the maximum number of active vehicles. A vehicle is active if
     * its route performs at least one shipment. This can be used to limit the
     * number of routes in the case where there are fewer drivers than
     * vehicles and that the fleet of vehicles is heterogeneous. The optimization
     * will then select the best subset of vehicles to use.
     * Must be strictly positive.
     * 
* * optional int32 max_active_vehicles = 4; * * @return The maxActiveVehicles. */ @java.lang.Override public int getMaxActiveVehicles() { return maxActiveVehicles_; } /** * * *
     * Constrains the maximum number of active vehicles. A vehicle is active if
     * its route performs at least one shipment. This can be used to limit the
     * number of routes in the case where there are fewer drivers than
     * vehicles and that the fleet of vehicles is heterogeneous. The optimization
     * will then select the best subset of vehicles to use.
     * Must be strictly positive.
     * 
* * optional int32 max_active_vehicles = 4; * * @param value The maxActiveVehicles to set. * @return This builder for chaining. */ public Builder setMaxActiveVehicles(int value) { maxActiveVehicles_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * Constrains the maximum number of active vehicles. A vehicle is active if
     * its route performs at least one shipment. This can be used to limit the
     * number of routes in the case where there are fewer drivers than
     * vehicles and that the fleet of vehicles is heterogeneous. The optimization
     * will then select the best subset of vehicles to use.
     * Must be strictly positive.
     * 
* * optional int32 max_active_vehicles = 4; * * @return This builder for chaining. */ public Builder clearMaxActiveVehicles() { bitField0_ = (bitField0_ & ~0x00000004); maxActiveVehicles_ = 0; onChanged(); return this; } private com.google.protobuf.Timestamp globalStartTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> globalStartTimeBuilder_; /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; * * @return Whether the globalStartTime field is set. */ public boolean hasGlobalStartTime() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; * * @return The globalStartTime. */ public com.google.protobuf.Timestamp getGlobalStartTime() { if (globalStartTimeBuilder_ == null) { return globalStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalStartTime_; } else { return globalStartTimeBuilder_.getMessage(); } } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ public Builder setGlobalStartTime(com.google.protobuf.Timestamp value) { if (globalStartTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } globalStartTime_ = value; } else { globalStartTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ public Builder setGlobalStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (globalStartTimeBuilder_ == null) { globalStartTime_ = builderForValue.build(); } else { globalStartTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ public Builder mergeGlobalStartTime(com.google.protobuf.Timestamp value) { if (globalStartTimeBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && globalStartTime_ != null && globalStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getGlobalStartTimeBuilder().mergeFrom(value); } else { globalStartTime_ = value; } } else { globalStartTimeBuilder_.mergeFrom(value); } if (globalStartTime_ != null) { bitField0_ |= 0x00000008; onChanged(); } return this; } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ public Builder clearGlobalStartTime() { bitField0_ = (bitField0_ & ~0x00000008); globalStartTime_ = null; if (globalStartTimeBuilder_ != null) { globalStartTimeBuilder_.dispose(); globalStartTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ public com.google.protobuf.Timestamp.Builder getGlobalStartTimeBuilder() { bitField0_ |= 0x00000008; onChanged(); return getGlobalStartTimeFieldBuilder().getBuilder(); } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ public com.google.protobuf.TimestampOrBuilder getGlobalStartTimeOrBuilder() { if (globalStartTimeBuilder_ != null) { return globalStartTimeBuilder_.getMessageOrBuilder(); } else { return globalStartTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalStartTime_; } } /** * * *
     * Global start and end time of the model: no times outside of this range
     * can be considered valid.
     *
     * The model's time span must be less than a year, i.e. the `global_end_time`
     * and the `global_start_time` must be within 31536000 seconds of each other.
     *
     * When using `cost_per_*hour` fields, you might want to set this window to a
     * smaller interval to increase performance (eg. if you model a single day,
     * you should set the global time limits to that day).
     * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
     * as default.
     * 
* * .google.protobuf.Timestamp global_start_time = 5; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getGlobalStartTimeFieldBuilder() { if (globalStartTimeBuilder_ == null) { globalStartTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getGlobalStartTime(), getParentForChildren(), isClean()); globalStartTime_ = null; } return globalStartTimeBuilder_; } private com.google.protobuf.Timestamp globalEndTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> globalEndTimeBuilder_; /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; * * @return Whether the globalEndTime field is set. */ public boolean hasGlobalEndTime() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; * * @return The globalEndTime. */ public com.google.protobuf.Timestamp getGlobalEndTime() { if (globalEndTimeBuilder_ == null) { return globalEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalEndTime_; } else { return globalEndTimeBuilder_.getMessage(); } } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ public Builder setGlobalEndTime(com.google.protobuf.Timestamp value) { if (globalEndTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } globalEndTime_ = value; } else { globalEndTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ public Builder setGlobalEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (globalEndTimeBuilder_ == null) { globalEndTime_ = builderForValue.build(); } else { globalEndTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ public Builder mergeGlobalEndTime(com.google.protobuf.Timestamp value) { if (globalEndTimeBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0) && globalEndTime_ != null && globalEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getGlobalEndTimeBuilder().mergeFrom(value); } else { globalEndTime_ = value; } } else { globalEndTimeBuilder_.mergeFrom(value); } if (globalEndTime_ != null) { bitField0_ |= 0x00000010; onChanged(); } return this; } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ public Builder clearGlobalEndTime() { bitField0_ = (bitField0_ & ~0x00000010); globalEndTime_ = null; if (globalEndTimeBuilder_ != null) { globalEndTimeBuilder_.dispose(); globalEndTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ public com.google.protobuf.Timestamp.Builder getGlobalEndTimeBuilder() { bitField0_ |= 0x00000010; onChanged(); return getGlobalEndTimeFieldBuilder().getBuilder(); } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ public com.google.protobuf.TimestampOrBuilder getGlobalEndTimeOrBuilder() { if (globalEndTimeBuilder_ != null) { return globalEndTimeBuilder_.getMessageOrBuilder(); } else { return globalEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : globalEndTime_; } } /** * * *
     * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
     * is used as default.
     * 
* * .google.protobuf.Timestamp global_end_time = 6; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getGlobalEndTimeFieldBuilder() { if (globalEndTimeBuilder_ == null) { globalEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getGlobalEndTime(), getParentForChildren(), isClean()); globalEndTime_ = null; } return globalEndTimeBuilder_; } private double globalDurationCostPerHour_; /** * * *
     * The "global duration" of the overall plan is the difference between the
     * earliest effective start time and the latest effective end time of
     * all vehicles. Users can assign a cost per hour to that quantity to try
     * and optimize for earliest job completion, for example. This cost must be in
     * the same unit as
     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
     * 
* * double global_duration_cost_per_hour = 7; * * @return The globalDurationCostPerHour. */ @java.lang.Override public double getGlobalDurationCostPerHour() { return globalDurationCostPerHour_; } /** * * *
     * The "global duration" of the overall plan is the difference between the
     * earliest effective start time and the latest effective end time of
     * all vehicles. Users can assign a cost per hour to that quantity to try
     * and optimize for earliest job completion, for example. This cost must be in
     * the same unit as
     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
     * 
* * double global_duration_cost_per_hour = 7; * * @param value The globalDurationCostPerHour to set. * @return This builder for chaining. */ public Builder setGlobalDurationCostPerHour(double value) { globalDurationCostPerHour_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } /** * * *
     * The "global duration" of the overall plan is the difference between the
     * earliest effective start time and the latest effective end time of
     * all vehicles. Users can assign a cost per hour to that quantity to try
     * and optimize for earliest job completion, for example. This cost must be in
     * the same unit as
     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
     * 
* * double global_duration_cost_per_hour = 7; * * @return This builder for chaining. */ public Builder clearGlobalDurationCostPerHour() { bitField0_ = (bitField0_ & ~0x00000020); globalDurationCostPerHour_ = 0D; onChanged(); return this; } private java.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix> durationDistanceMatrices_ = java.util.Collections.emptyList(); private void ensureDurationDistanceMatricesIsMutable() { if (!((bitField0_ & 0x00000040) != 0)) { durationDistanceMatrices_ = new java.util.ArrayList< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix>( durationDistanceMatrices_); bitField0_ |= 0x00000040; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder> durationDistanceMatricesBuilder_; /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public java.util.List getDurationDistanceMatricesList() { if (durationDistanceMatricesBuilder_ == null) { return java.util.Collections.unmodifiableList(durationDistanceMatrices_); } else { return durationDistanceMatricesBuilder_.getMessageList(); } } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public int getDurationDistanceMatricesCount() { if (durationDistanceMatricesBuilder_ == null) { return durationDistanceMatrices_.size(); } else { return durationDistanceMatricesBuilder_.getCount(); } } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix getDurationDistanceMatrices(int index) { if (durationDistanceMatricesBuilder_ == null) { return durationDistanceMatrices_.get(index); } else { return durationDistanceMatricesBuilder_.getMessage(index); } } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder setDurationDistanceMatrices( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix value) { if (durationDistanceMatricesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.set(index, value); onChanged(); } else { durationDistanceMatricesBuilder_.setMessage(index, value); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder setDurationDistanceMatrices( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder builderForValue) { if (durationDistanceMatricesBuilder_ == null) { ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.set(index, builderForValue.build()); onChanged(); } else { durationDistanceMatricesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder addDurationDistanceMatrices( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix value) { if (durationDistanceMatricesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.add(value); onChanged(); } else { durationDistanceMatricesBuilder_.addMessage(value); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder addDurationDistanceMatrices( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix value) { if (durationDistanceMatricesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.add(index, value); onChanged(); } else { durationDistanceMatricesBuilder_.addMessage(index, value); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder addDurationDistanceMatrices( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder builderForValue) { if (durationDistanceMatricesBuilder_ == null) { ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.add(builderForValue.build()); onChanged(); } else { durationDistanceMatricesBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder addDurationDistanceMatrices( int index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder builderForValue) { if (durationDistanceMatricesBuilder_ == null) { ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.add(index, builderForValue.build()); onChanged(); } else { durationDistanceMatricesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder addAllDurationDistanceMatrices( java.lang.Iterable< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix> values) { if (durationDistanceMatricesBuilder_ == null) { ensureDurationDistanceMatricesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, durationDistanceMatrices_); onChanged(); } else { durationDistanceMatricesBuilder_.addAllMessages(values); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder clearDurationDistanceMatrices() { if (durationDistanceMatricesBuilder_ == null) { durationDistanceMatrices_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { durationDistanceMatricesBuilder_.clear(); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public Builder removeDurationDistanceMatrices(int index) { if (durationDistanceMatricesBuilder_ == null) { ensureDurationDistanceMatricesIsMutable(); durationDistanceMatrices_.remove(index); onChanged(); } else { durationDistanceMatricesBuilder_.remove(index); } return this; } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder getDurationDistanceMatricesBuilder(int index) { return getDurationDistanceMatricesFieldBuilder().getBuilder(index); } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder getDurationDistanceMatricesOrBuilder(int index) { if (durationDistanceMatricesBuilder_ == null) { return durationDistanceMatrices_.get(index); } else { return durationDistanceMatricesBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder> getDurationDistanceMatricesOrBuilderList() { if (durationDistanceMatricesBuilder_ != null) { return durationDistanceMatricesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(durationDistanceMatrices_); } } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder addDurationDistanceMatricesBuilder() { return getDurationDistanceMatricesFieldBuilder() .addBuilder( com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .getDefaultInstance()); } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder addDurationDistanceMatricesBuilder(int index) { return getDurationDistanceMatricesFieldBuilder() .addBuilder( index, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix .getDefaultInstance()); } /** * * *
     * Specifies duration and distance matrices used in the model. If this field
     * is empty, Google Maps or geodesic distances will be used instead, depending
     * on the value of the `use_geodesic_distances` field. If it is not empty,
     * `use_geodesic_distances` cannot be true and neither
     * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
     * can be empty.
     *
     * Usage examples:
     *
     * * There are two locations: locA and locB.
     * * 1 vehicle starting its route at locA and ending it at locA.
     * * 1 pickup visit request at locB.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA"  end_tags: "locA" }
     *   shipments { pickups { tags: "locB" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locA"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrices {
     *     rows {  # from: locA
     *       durations { seconds: 0 }   meters: 0    # to: locA
     *       durations { seconds: 100 } meters: 1000 # to: locB
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 102 } meters: 990 # to: locA
     *       durations { seconds: 0 }   meters: 0   # to: locB
     *     }
     *   }
     * }
     * ```
     *
     *
     * * There are three locations: locA, locB and locC.
     * * 1 vehicle starting its route at locA and ending it at locB, using
     *   matrix "fast".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "slow".
     * * 1 vehicle starting its route at locB and ending it at locB, using
     *   matrix "fast".
     * * 1 pickup visit request at locC.
     *
     * ```
     * model {
     *   vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
     *   vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
     *   shipments { pickups { tags: "locC" } }
     *   duration_distance_matrix_src_tags: "locA"
     *   duration_distance_matrix_src_tags: "locB"
     *   duration_distance_matrix_src_tags: "locC"
     *   duration_distance_matrix_dst_tags: "locB"
     *   duration_distance_matrix_dst_tags: "locC"
     *   duration_distance_matrices {
     *     vehicle_start_tag: "fast"
     *     rows {  # from: locA
     *       durations { seconds: 1000 } meters: 2000 # to: locB
     *       durations { seconds: 600 }  meters: 1000 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }   meters: 0    # to: locB
     *       durations { seconds: 700 } meters: 1200 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 702 } meters: 1190 # to: locB
     *       durations { seconds: 0 }   meters: 0    # to: locC
     *     }
     *   }
     *   duration_distance_matrices {
     *     vehicle_start_tag: "slow"
     *     rows {  # from: locA
     *       durations { seconds: 1800 } meters: 2001 # to: locB
     *       durations { seconds: 900 }  meters: 1002 # to: locC
     *     }
     *     rows {  # from: locB
     *       durations { seconds: 0 }    meters: 0    # to: locB
     *       durations { seconds: 1000 } meters: 1202 # to: locC
     *     }
     *     rows {  # from: locC
     *       durations { seconds: 1001 } meters: 1195 # to: locB
     *       durations { seconds: 0 }    meters: 0    # to: locC
     *     }
     *   }
     * }
     * ```
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; * */ public java.util.List< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder> getDurationDistanceMatricesBuilderList() { return getDurationDistanceMatricesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder> getDurationDistanceMatricesFieldBuilder() { if (durationDistanceMatricesBuilder_ == null) { durationDistanceMatricesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder>( durationDistanceMatrices_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); durationDistanceMatrices_ = null; } return durationDistanceMatricesBuilder_; } private com.google.protobuf.LazyStringArrayList durationDistanceMatrixSrcTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureDurationDistanceMatrixSrcTagsIsMutable() { if (!durationDistanceMatrixSrcTags_.isModifiable()) { durationDistanceMatrixSrcTags_ = new com.google.protobuf.LazyStringArrayList(durationDistanceMatrixSrcTags_); } bitField0_ |= 0x00000080; } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @return A list containing the durationDistanceMatrixSrcTags. */ public com.google.protobuf.ProtocolStringList getDurationDistanceMatrixSrcTagsList() { durationDistanceMatrixSrcTags_.makeImmutable(); return durationDistanceMatrixSrcTags_; } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @return The count of durationDistanceMatrixSrcTags. */ public int getDurationDistanceMatrixSrcTagsCount() { return durationDistanceMatrixSrcTags_.size(); } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param index The index of the element to return. * @return The durationDistanceMatrixSrcTags at the given index. */ public java.lang.String getDurationDistanceMatrixSrcTags(int index) { return durationDistanceMatrixSrcTags_.get(index); } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param index The index of the value to return. * @return The bytes of the durationDistanceMatrixSrcTags at the given index. */ public com.google.protobuf.ByteString getDurationDistanceMatrixSrcTagsBytes(int index) { return durationDistanceMatrixSrcTags_.getByteString(index); } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param index The index to set the value at. * @param value The durationDistanceMatrixSrcTags to set. * @return This builder for chaining. */ public Builder setDurationDistanceMatrixSrcTags(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatrixSrcTagsIsMutable(); durationDistanceMatrixSrcTags_.set(index, value); bitField0_ |= 0x00000080; onChanged(); return this; } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param value The durationDistanceMatrixSrcTags to add. * @return This builder for chaining. */ public Builder addDurationDistanceMatrixSrcTags(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatrixSrcTagsIsMutable(); durationDistanceMatrixSrcTags_.add(value); bitField0_ |= 0x00000080; onChanged(); return this; } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param values The durationDistanceMatrixSrcTags to add. * @return This builder for chaining. */ public Builder addAllDurationDistanceMatrixSrcTags( java.lang.Iterable values) { ensureDurationDistanceMatrixSrcTagsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, durationDistanceMatrixSrcTags_); bitField0_ |= 0x00000080; onChanged(); return this; } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @return This builder for chaining. */ public Builder clearDurationDistanceMatrixSrcTags() { durationDistanceMatrixSrcTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000080); ; onChanged(); return this; } /** * * *
     * Tags defining the sources of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j)` defines durations and distances
     * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
     * in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_src_tags = 9; * * @param value The bytes of the durationDistanceMatrixSrcTags to add. * @return This builder for chaining. */ public Builder addDurationDistanceMatrixSrcTagsBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureDurationDistanceMatrixSrcTagsIsMutable(); durationDistanceMatrixSrcTags_.add(value); bitField0_ |= 0x00000080; onChanged(); return this; } private com.google.protobuf.LazyStringArrayList durationDistanceMatrixDstTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureDurationDistanceMatrixDstTagsIsMutable() { if (!durationDistanceMatrixDstTags_.isModifiable()) { durationDistanceMatrixDstTags_ = new com.google.protobuf.LazyStringArrayList(durationDistanceMatrixDstTags_); } bitField0_ |= 0x00000100; } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @return A list containing the durationDistanceMatrixDstTags. */ public com.google.protobuf.ProtocolStringList getDurationDistanceMatrixDstTagsList() { durationDistanceMatrixDstTags_.makeImmutable(); return durationDistanceMatrixDstTags_; } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @return The count of durationDistanceMatrixDstTags. */ public int getDurationDistanceMatrixDstTagsCount() { return durationDistanceMatrixDstTags_.size(); } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param index The index of the element to return. * @return The durationDistanceMatrixDstTags at the given index. */ public java.lang.String getDurationDistanceMatrixDstTags(int index) { return durationDistanceMatrixDstTags_.get(index); } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param index The index of the value to return. * @return The bytes of the durationDistanceMatrixDstTags at the given index. */ public com.google.protobuf.ByteString getDurationDistanceMatrixDstTagsBytes(int index) { return durationDistanceMatrixDstTags_.getByteString(index); } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param index The index to set the value at. * @param value The durationDistanceMatrixDstTags to set. * @return This builder for chaining. */ public Builder setDurationDistanceMatrixDstTags(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatrixDstTagsIsMutable(); durationDistanceMatrixDstTags_.set(index, value); bitField0_ |= 0x00000100; onChanged(); return this; } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param value The durationDistanceMatrixDstTags to add. * @return This builder for chaining. */ public Builder addDurationDistanceMatrixDstTags(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureDurationDistanceMatrixDstTagsIsMutable(); durationDistanceMatrixDstTags_.add(value); bitField0_ |= 0x00000100; onChanged(); return this; } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param values The durationDistanceMatrixDstTags to add. * @return This builder for chaining. */ public Builder addAllDurationDistanceMatrixDstTags( java.lang.Iterable values) { ensureDurationDistanceMatrixDstTagsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, durationDistanceMatrixDstTags_); bitField0_ |= 0x00000100; onChanged(); return this; } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @return This builder for chaining. */ public Builder clearDurationDistanceMatrixDstTags() { durationDistanceMatrixDstTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000100); ; onChanged(); return this; } /** * * *
     * Tags defining the destinations of the duration and distance matrices;
     * `duration_distance_matrices(i).rows(j).durations(k)` (resp.
     * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
     * (resp. the distance) of the travel from visits with tag
     * `duration_distance_matrix_src_tags(j)` to visits with tag
     * `duration_distance_matrix_dst_tags(k)` in matrix i.
     *
     * Tags correspond to
     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
     * or
     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags].
     * A given `VisitRequest` or `Vehicle` must match exactly one tag in this
     * field. Note that a `Vehicle`'s source, destination and matrix tags may be
     * the same; similarly a `VisitRequest`'s source and destination tags may be
     * the same. All tags must be different and cannot be empty strings. If this
     * field is not empty, then `duration_distance_matrices` must not be empty.
     * 
* * repeated string duration_distance_matrix_dst_tags = 10; * * @param value The bytes of the durationDistanceMatrixDstTags to add. * @return This builder for chaining. */ public Builder addDurationDistanceMatrixDstTagsBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureDurationDistanceMatrixDstTagsIsMutable(); durationDistanceMatrixDstTags_.add(value); bitField0_ |= 0x00000100; onChanged(); return this; } private java.util.List transitionAttributes_ = java.util.Collections.emptyList(); private void ensureTransitionAttributesIsMutable() { if (!((bitField0_ & 0x00000200) != 0)) { transitionAttributes_ = new java.util.ArrayList( transitionAttributes_); bitField0_ |= 0x00000200; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.TransitionAttributes, com.google.maps.routeoptimization.v1.TransitionAttributes.Builder, com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder> transitionAttributesBuilder_; /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public java.util.List getTransitionAttributesList() { if (transitionAttributesBuilder_ == null) { return java.util.Collections.unmodifiableList(transitionAttributes_); } else { return transitionAttributesBuilder_.getMessageList(); } } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public int getTransitionAttributesCount() { if (transitionAttributesBuilder_ == null) { return transitionAttributes_.size(); } else { return transitionAttributesBuilder_.getCount(); } } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public com.google.maps.routeoptimization.v1.TransitionAttributes getTransitionAttributes( int index) { if (transitionAttributesBuilder_ == null) { return transitionAttributes_.get(index); } else { return transitionAttributesBuilder_.getMessage(index); } } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder setTransitionAttributes( int index, com.google.maps.routeoptimization.v1.TransitionAttributes value) { if (transitionAttributesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTransitionAttributesIsMutable(); transitionAttributes_.set(index, value); onChanged(); } else { transitionAttributesBuilder_.setMessage(index, value); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder setTransitionAttributes( int index, com.google.maps.routeoptimization.v1.TransitionAttributes.Builder builderForValue) { if (transitionAttributesBuilder_ == null) { ensureTransitionAttributesIsMutable(); transitionAttributes_.set(index, builderForValue.build()); onChanged(); } else { transitionAttributesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder addTransitionAttributes( com.google.maps.routeoptimization.v1.TransitionAttributes value) { if (transitionAttributesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTransitionAttributesIsMutable(); transitionAttributes_.add(value); onChanged(); } else { transitionAttributesBuilder_.addMessage(value); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder addTransitionAttributes( int index, com.google.maps.routeoptimization.v1.TransitionAttributes value) { if (transitionAttributesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTransitionAttributesIsMutable(); transitionAttributes_.add(index, value); onChanged(); } else { transitionAttributesBuilder_.addMessage(index, value); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder addTransitionAttributes( com.google.maps.routeoptimization.v1.TransitionAttributes.Builder builderForValue) { if (transitionAttributesBuilder_ == null) { ensureTransitionAttributesIsMutable(); transitionAttributes_.add(builderForValue.build()); onChanged(); } else { transitionAttributesBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder addTransitionAttributes( int index, com.google.maps.routeoptimization.v1.TransitionAttributes.Builder builderForValue) { if (transitionAttributesBuilder_ == null) { ensureTransitionAttributesIsMutable(); transitionAttributes_.add(index, builderForValue.build()); onChanged(); } else { transitionAttributesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder addAllTransitionAttributes( java.lang.Iterable values) { if (transitionAttributesBuilder_ == null) { ensureTransitionAttributesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitionAttributes_); onChanged(); } else { transitionAttributesBuilder_.addAllMessages(values); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder clearTransitionAttributes() { if (transitionAttributesBuilder_ == null) { transitionAttributes_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { transitionAttributesBuilder_.clear(); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public Builder removeTransitionAttributes(int index) { if (transitionAttributesBuilder_ == null) { ensureTransitionAttributesIsMutable(); transitionAttributes_.remove(index); onChanged(); } else { transitionAttributesBuilder_.remove(index); } return this; } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public com.google.maps.routeoptimization.v1.TransitionAttributes.Builder getTransitionAttributesBuilder(int index) { return getTransitionAttributesFieldBuilder().getBuilder(index); } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder getTransitionAttributesOrBuilder(int index) { if (transitionAttributesBuilder_ == null) { return transitionAttributes_.get(index); } else { return transitionAttributesBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public java.util.List< ? extends com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder> getTransitionAttributesOrBuilderList() { if (transitionAttributesBuilder_ != null) { return transitionAttributesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(transitionAttributes_); } } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public com.google.maps.routeoptimization.v1.TransitionAttributes.Builder addTransitionAttributesBuilder() { return getTransitionAttributesFieldBuilder() .addBuilder( com.google.maps.routeoptimization.v1.TransitionAttributes.getDefaultInstance()); } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public com.google.maps.routeoptimization.v1.TransitionAttributes.Builder addTransitionAttributesBuilder(int index) { return getTransitionAttributesFieldBuilder() .addBuilder( index, com.google.maps.routeoptimization.v1.TransitionAttributes.getDefaultInstance()); } /** * * *
     * Transition attributes added to the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; * */ public java.util.List getTransitionAttributesBuilderList() { return getTransitionAttributesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.TransitionAttributes, com.google.maps.routeoptimization.v1.TransitionAttributes.Builder, com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder> getTransitionAttributesFieldBuilder() { if (transitionAttributesBuilder_ == null) { transitionAttributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.TransitionAttributes, com.google.maps.routeoptimization.v1.TransitionAttributes.Builder, com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder>( transitionAttributes_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); transitionAttributes_ = null; } return transitionAttributesBuilder_; } private java.util.List shipmentTypeIncompatibilities_ = java.util.Collections.emptyList(); private void ensureShipmentTypeIncompatibilitiesIsMutable() { if (!((bitField0_ & 0x00000400) != 0)) { shipmentTypeIncompatibilities_ = new java.util.ArrayList< com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility>( shipmentTypeIncompatibilities_); bitField0_ |= 0x00000400; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder> shipmentTypeIncompatibilitiesBuilder_; /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public java.util.List getShipmentTypeIncompatibilitiesList() { if (shipmentTypeIncompatibilitiesBuilder_ == null) { return java.util.Collections.unmodifiableList(shipmentTypeIncompatibilities_); } else { return shipmentTypeIncompatibilitiesBuilder_.getMessageList(); } } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public int getShipmentTypeIncompatibilitiesCount() { if (shipmentTypeIncompatibilitiesBuilder_ == null) { return shipmentTypeIncompatibilities_.size(); } else { return shipmentTypeIncompatibilitiesBuilder_.getCount(); } } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility getShipmentTypeIncompatibilities(int index) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { return shipmentTypeIncompatibilities_.get(index); } else { return shipmentTypeIncompatibilitiesBuilder_.getMessage(index); } } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder setShipmentTypeIncompatibilities( int index, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility value) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.set(index, value); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.setMessage(index, value); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder setShipmentTypeIncompatibilities( int index, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder builderForValue) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.set(index, builderForValue.build()); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder addShipmentTypeIncompatibilities( com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility value) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.add(value); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.addMessage(value); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder addShipmentTypeIncompatibilities( int index, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility value) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.add(index, value); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.addMessage(index, value); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder addShipmentTypeIncompatibilities( com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder builderForValue) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.add(builderForValue.build()); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder addShipmentTypeIncompatibilities( int index, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder builderForValue) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.add(index, builderForValue.build()); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder addAllShipmentTypeIncompatibilities( java.lang.Iterable< ? extends com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility> values) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { ensureShipmentTypeIncompatibilitiesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, shipmentTypeIncompatibilities_); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.addAllMessages(values); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder clearShipmentTypeIncompatibilities() { if (shipmentTypeIncompatibilitiesBuilder_ == null) { shipmentTypeIncompatibilities_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000400); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.clear(); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public Builder removeShipmentTypeIncompatibilities(int index) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { ensureShipmentTypeIncompatibilitiesIsMutable(); shipmentTypeIncompatibilities_.remove(index); onChanged(); } else { shipmentTypeIncompatibilitiesBuilder_.remove(index); } return this; } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder getShipmentTypeIncompatibilitiesBuilder(int index) { return getShipmentTypeIncompatibilitiesFieldBuilder().getBuilder(index); } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder getShipmentTypeIncompatibilitiesOrBuilder(int index) { if (shipmentTypeIncompatibilitiesBuilder_ == null) { return shipmentTypeIncompatibilities_.get(index); } else { return shipmentTypeIncompatibilitiesBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder> getShipmentTypeIncompatibilitiesOrBuilderList() { if (shipmentTypeIncompatibilitiesBuilder_ != null) { return shipmentTypeIncompatibilitiesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(shipmentTypeIncompatibilities_); } } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder addShipmentTypeIncompatibilitiesBuilder() { return getShipmentTypeIncompatibilitiesFieldBuilder() .addBuilder( com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility .getDefaultInstance()); } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder addShipmentTypeIncompatibilitiesBuilder(int index) { return getShipmentTypeIncompatibilitiesFieldBuilder() .addBuilder( index, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility .getDefaultInstance()); } /** * * *
     * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; * */ public java.util.List getShipmentTypeIncompatibilitiesBuilderList() { return getShipmentTypeIncompatibilitiesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder> getShipmentTypeIncompatibilitiesFieldBuilder() { if (shipmentTypeIncompatibilitiesBuilder_ == null) { shipmentTypeIncompatibilitiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder, com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder>( shipmentTypeIncompatibilities_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); shipmentTypeIncompatibilities_ = null; } return shipmentTypeIncompatibilitiesBuilder_; } private java.util.List shipmentTypeRequirements_ = java.util.Collections.emptyList(); private void ensureShipmentTypeRequirementsIsMutable() { if (!((bitField0_ & 0x00000800) != 0)) { shipmentTypeRequirements_ = new java.util.ArrayList( shipmentTypeRequirements_); bitField0_ |= 0x00000800; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentTypeRequirement, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder, com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder> shipmentTypeRequirementsBuilder_; /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public java.util.List getShipmentTypeRequirementsList() { if (shipmentTypeRequirementsBuilder_ == null) { return java.util.Collections.unmodifiableList(shipmentTypeRequirements_); } else { return shipmentTypeRequirementsBuilder_.getMessageList(); } } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public int getShipmentTypeRequirementsCount() { if (shipmentTypeRequirementsBuilder_ == null) { return shipmentTypeRequirements_.size(); } else { return shipmentTypeRequirementsBuilder_.getCount(); } } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement getShipmentTypeRequirements( int index) { if (shipmentTypeRequirementsBuilder_ == null) { return shipmentTypeRequirements_.get(index); } else { return shipmentTypeRequirementsBuilder_.getMessage(index); } } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder setShipmentTypeRequirements( int index, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement value) { if (shipmentTypeRequirementsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.set(index, value); onChanged(); } else { shipmentTypeRequirementsBuilder_.setMessage(index, value); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder setShipmentTypeRequirements( int index, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder builderForValue) { if (shipmentTypeRequirementsBuilder_ == null) { ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.set(index, builderForValue.build()); onChanged(); } else { shipmentTypeRequirementsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder addShipmentTypeRequirements( com.google.maps.routeoptimization.v1.ShipmentTypeRequirement value) { if (shipmentTypeRequirementsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.add(value); onChanged(); } else { shipmentTypeRequirementsBuilder_.addMessage(value); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder addShipmentTypeRequirements( int index, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement value) { if (shipmentTypeRequirementsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.add(index, value); onChanged(); } else { shipmentTypeRequirementsBuilder_.addMessage(index, value); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder addShipmentTypeRequirements( com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder builderForValue) { if (shipmentTypeRequirementsBuilder_ == null) { ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.add(builderForValue.build()); onChanged(); } else { shipmentTypeRequirementsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder addShipmentTypeRequirements( int index, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder builderForValue) { if (shipmentTypeRequirementsBuilder_ == null) { ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.add(index, builderForValue.build()); onChanged(); } else { shipmentTypeRequirementsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder addAllShipmentTypeRequirements( java.lang.Iterable values) { if (shipmentTypeRequirementsBuilder_ == null) { ensureShipmentTypeRequirementsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, shipmentTypeRequirements_); onChanged(); } else { shipmentTypeRequirementsBuilder_.addAllMessages(values); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder clearShipmentTypeRequirements() { if (shipmentTypeRequirementsBuilder_ == null) { shipmentTypeRequirements_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000800); onChanged(); } else { shipmentTypeRequirementsBuilder_.clear(); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public Builder removeShipmentTypeRequirements(int index) { if (shipmentTypeRequirementsBuilder_ == null) { ensureShipmentTypeRequirementsIsMutable(); shipmentTypeRequirements_.remove(index); onChanged(); } else { shipmentTypeRequirementsBuilder_.remove(index); } return this; } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder getShipmentTypeRequirementsBuilder(int index) { return getShipmentTypeRequirementsFieldBuilder().getBuilder(index); } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder getShipmentTypeRequirementsOrBuilder(int index) { if (shipmentTypeRequirementsBuilder_ == null) { return shipmentTypeRequirements_.get(index); } else { return shipmentTypeRequirementsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder> getShipmentTypeRequirementsOrBuilderList() { if (shipmentTypeRequirementsBuilder_ != null) { return shipmentTypeRequirementsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(shipmentTypeRequirements_); } } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder addShipmentTypeRequirementsBuilder() { return getShipmentTypeRequirementsFieldBuilder() .addBuilder( com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.getDefaultInstance()); } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder addShipmentTypeRequirementsBuilder(int index) { return getShipmentTypeRequirementsFieldBuilder() .addBuilder( index, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.getDefaultInstance()); } /** * * *
     * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; * */ public java.util.List getShipmentTypeRequirementsBuilderList() { return getShipmentTypeRequirementsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentTypeRequirement, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder, com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder> getShipmentTypeRequirementsFieldBuilder() { if (shipmentTypeRequirementsBuilder_ == null) { shipmentTypeRequirementsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentTypeRequirement, com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder, com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder>( shipmentTypeRequirements_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); shipmentTypeRequirements_ = null; } return shipmentTypeRequirementsBuilder_; } private java.util.List precedenceRules_ = java.util.Collections.emptyList(); private void ensurePrecedenceRulesIsMutable() { if (!((bitField0_ & 0x00001000) != 0)) { precedenceRules_ = new java.util.ArrayList< com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule>( precedenceRules_); bitField0_ |= 0x00001000; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder> precedenceRulesBuilder_; /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public java.util.List getPrecedenceRulesList() { if (precedenceRulesBuilder_ == null) { return java.util.Collections.unmodifiableList(precedenceRules_); } else { return precedenceRulesBuilder_.getMessageList(); } } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public int getPrecedenceRulesCount() { if (precedenceRulesBuilder_ == null) { return precedenceRules_.size(); } else { return precedenceRulesBuilder_.getCount(); } } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule getPrecedenceRules( int index) { if (precedenceRulesBuilder_ == null) { return precedenceRules_.get(index); } else { return precedenceRulesBuilder_.getMessage(index); } } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder setPrecedenceRules( int index, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule value) { if (precedenceRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePrecedenceRulesIsMutable(); precedenceRules_.set(index, value); onChanged(); } else { precedenceRulesBuilder_.setMessage(index, value); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder setPrecedenceRules( int index, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder builderForValue) { if (precedenceRulesBuilder_ == null) { ensurePrecedenceRulesIsMutable(); precedenceRules_.set(index, builderForValue.build()); onChanged(); } else { precedenceRulesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder addPrecedenceRules( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule value) { if (precedenceRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePrecedenceRulesIsMutable(); precedenceRules_.add(value); onChanged(); } else { precedenceRulesBuilder_.addMessage(value); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder addPrecedenceRules( int index, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule value) { if (precedenceRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePrecedenceRulesIsMutable(); precedenceRules_.add(index, value); onChanged(); } else { precedenceRulesBuilder_.addMessage(index, value); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder addPrecedenceRules( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder builderForValue) { if (precedenceRulesBuilder_ == null) { ensurePrecedenceRulesIsMutable(); precedenceRules_.add(builderForValue.build()); onChanged(); } else { precedenceRulesBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder addPrecedenceRules( int index, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder builderForValue) { if (precedenceRulesBuilder_ == null) { ensurePrecedenceRulesIsMutable(); precedenceRules_.add(index, builderForValue.build()); onChanged(); } else { precedenceRulesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder addAllPrecedenceRules( java.lang.Iterable< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule> values) { if (precedenceRulesBuilder_ == null) { ensurePrecedenceRulesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, precedenceRules_); onChanged(); } else { precedenceRulesBuilder_.addAllMessages(values); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder clearPrecedenceRules() { if (precedenceRulesBuilder_ == null) { precedenceRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00001000); onChanged(); } else { precedenceRulesBuilder_.clear(); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public Builder removePrecedenceRules(int index) { if (precedenceRulesBuilder_ == null) { ensurePrecedenceRulesIsMutable(); precedenceRules_.remove(index); onChanged(); } else { precedenceRulesBuilder_.remove(index); } return this; } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder getPrecedenceRulesBuilder(int index) { return getPrecedenceRulesFieldBuilder().getBuilder(index); } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder getPrecedenceRulesOrBuilder(int index) { if (precedenceRulesBuilder_ == null) { return precedenceRules_.get(index); } else { return precedenceRulesBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public java.util.List< ? extends com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder> getPrecedenceRulesOrBuilderList() { if (precedenceRulesBuilder_ != null) { return precedenceRulesBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(precedenceRules_); } } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder addPrecedenceRulesBuilder() { return getPrecedenceRulesFieldBuilder() .addBuilder( com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule .getDefaultInstance()); } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder addPrecedenceRulesBuilder(int index) { return getPrecedenceRulesFieldBuilder() .addBuilder( index, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule .getDefaultInstance()); } /** * * *
     * Set of precedence rules which must be enforced in the model.
     * 
* * * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; * */ public java.util.List getPrecedenceRulesBuilderList() { return getPrecedenceRulesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder> getPrecedenceRulesFieldBuilder() { if (precedenceRulesBuilder_ == null) { precedenceRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.Builder, com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder>( precedenceRules_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); precedenceRules_ = null; } return precedenceRulesBuilder_; } @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.ShipmentModel) } // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentModel) private static final com.google.maps.routeoptimization.v1.ShipmentModel DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentModel(); } public static com.google.maps.routeoptimization.v1.ShipmentModel getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public ShipmentModel 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.ShipmentModel getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy