diff --git a/generation_config.yaml b/generation_config.yaml index cb908306e063..1d470cec927c 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1175,6 +1175,28 @@ libraries: GAPICs: - proto_path: google/maps/places/v1 +- api_shortname: routeoptimization + name_pretty: Route Optimization API + product_documentation: https://developers.google.com/maps/documentation/route-optimization + api_description: The Route Optimization API assigns tasks and routes to a vehicle + fleet, optimizing against the objectives and constraints that you supply for your + transportation goals. + client_documentation: + https://cloud.google.com/java/docs/reference/google-maps-routeoptimization/latest/overview + release_level: preview + distribution_name: com.google.maps:google-maps-routeoptimization + api_id: routeoptimization.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.maps + cloud_api: false + GAPICs: + - proto_path: google/maps/routeoptimization/v1 + library_name: maps-routeoptimization + requires_billing: true + rest_documentation: + https://developers.google.com/maps/documentation/route-optimization/reference/rest/ + rpc_documentation: + https://developers.google.com/maps/documentation/route-optimization/reference/rpc - api_shortname: maps-routing name_pretty: Routes API product_documentation: https://developers.google.com/maps/documentation/routes diff --git a/java-maps-routeoptimization/.OwlBot-hermetic.yaml b/java-maps-routeoptimization/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..e83512f9377b --- /dev/null +++ b/java-maps-routeoptimization/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# 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 +# +# http://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. + + +deep-remove-regex: +- "/java-maps-routeoptimization/grpc-google-.*/src" +- "/java-maps-routeoptimization/proto-google-.*/src" +- "/java-maps-routeoptimization/google-.*/src" +- "/java-maps-routeoptimization/samples/snippets/generated" + +deep-preserve-regex: +- "/java-maps-routeoptimization/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/maps/routeoptimization/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-maps-routeoptimization/$1/proto-google-maps-routeoptimization-$1/src" +- source: "/google/maps/routeoptimization/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-maps-routeoptimization/$1/grpc-google-maps-routeoptimization-$1/src" +- source: "/google/maps/routeoptimization/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-maps-routeoptimization/$1/google-maps-routeoptimization/src" +- source: "/google/maps/routeoptimization/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-maps-routeoptimization/$1/samples/snippets/generated" + +api-name: routeoptimization \ No newline at end of file diff --git a/java-maps-routeoptimization/.repo-metadata.json b/java-maps-routeoptimization/.repo-metadata.json new file mode 100644 index 000000000000..605a654aeef9 --- /dev/null +++ b/java-maps-routeoptimization/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_shortname": "routeoptimization", + "name_pretty": "Route Optimization API", + "product_documentation": "https://developers.google.com/maps/documentation/route-optimization", + "api_description": "The Route Optimization API assigns tasks and routes to a vehicle fleet, optimizing against the objectives and constraints that you supply for your transportation goals.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-maps-routeoptimization/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-maps-routeoptimization", + "distribution_name": "com.google.maps:google-maps-routeoptimization", + "api_id": "routeoptimization.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true, + "rest_documentation": "https://developers.google.com/maps/documentation/route-optimization/reference/rest/", + "rpc_documentation": "https://developers.google.com/maps/documentation/route-optimization/reference/rpc" +} \ No newline at end of file diff --git a/java-maps-routeoptimization/README.md b/java-maps-routeoptimization/README.md new file mode 100644 index 000000000000..bd4539d2d13c --- /dev/null +++ b/java-maps-routeoptimization/README.md @@ -0,0 +1,225 @@ +# Google Route Optimization API Client for Java + +Java idiomatic client for [Route Optimization API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.38.0 + pom + import + + + + + + + com.google.maps + google-maps-routeoptimization + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.maps + google-maps-routeoptimization + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.maps:google-maps-routeoptimization:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.maps" % "google-maps-routeoptimization" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Route Optimization API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Route Optimization API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Route Optimization API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Route Optimization API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-maps-routeoptimization` library. See the [Quickstart](#quickstart) section +to add `google-maps-routeoptimization` as a dependency in your code. + +## About Route Optimization API + + +[Route Optimization API][product-docs] The Route Optimization API assigns tasks and routes to a vehicle fleet, optimizing against the objectives and constraints that you supply for your transportation goals. + +See the [Route Optimization API client library docs][javadocs] to learn how to +use this Route Optimization API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Route Optimization API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://developers.google.com/maps/documentation/route-optimization +[javadocs]: https://cloud.google.com/java/docs/reference/google-maps-routeoptimization/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.maps/google-maps-routeoptimization.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.maps/google-maps-routeoptimization/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=routeoptimization.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-maps-routeoptimization/google-maps-routeoptimization-bom/pom.xml b/java-maps-routeoptimization/google-maps-routeoptimization-bom/pom.xml new file mode 100644 index 000000000000..74b7dbbf4843 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.maps + google-maps-routeoptimization-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.37.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Route Optimization API BOM + + BOM for Route Optimization API + + + + true + + + + + + com.google.maps + google-maps-routeoptimization + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + grpc-google-maps-routeoptimization-v1 + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + proto-google-maps-routeoptimization-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/pom.xml b/java-maps-routeoptimization/google-maps-routeoptimization/pom.xml new file mode 100644 index 000000000000..46564eb5167b --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.maps + google-maps-routeoptimization + 0.0.1-SNAPSHOT + jar + Google Route Optimization API + Route Optimization API The Route Optimization API assigns tasks and routes to a vehicle fleet, optimizing against the objectives and constraints that you supply for your transportation goals. + + com.google.maps + google-maps-routeoptimization-parent + 0.0.1-SNAPSHOT + + + google-maps-routeoptimization + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.maps.api.grpc + proto-google-maps-routeoptimization-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.maps.api.grpc + grpc-google-maps-routeoptimization-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationClient.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationClient.java new file mode 100644 index 000000000000..b4e6dc4ff914 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationClient.java @@ -0,0 +1,501 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.stub.RouteOptimizationStub; +import com.google.maps.routeoptimization.v1.stub.RouteOptimizationStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service for optimizing vehicle tours. + * + *

Validity of certain types of fields: + * + *

* `google.protobuf.Timestamp` * Times are in Unix time: seconds since + * 1970-01-01T00:00:00+00:00. * seconds must be in [0, 253402300799], i.e. in + * [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. * nanos must be unset or set to 0. + * * `google.protobuf.Duration` * seconds must be in [0, 253402300799], i.e. in + * [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. * nanos must be unset or set to 0. + * * `google.type.LatLng` * latitude must be in [-90.0, 90.0]. * longitude must be in + * [-180.0, 180.0]. * at least one of latitude and longitude must be non-zero. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+ *   OptimizeToursRequest request =
+ *       OptimizeToursRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setTimeout(Duration.newBuilder().build())
+ *           .setModel(ShipmentModel.newBuilder().build())
+ *           .addAllInjectedFirstSolutionRoutes(new ArrayList())
+ *           .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build())
+ *           .addAllRefreshDetailsRoutes(new ArrayList())
+ *           .setInterpretInjectedSolutionsUsingLabels(true)
+ *           .setConsiderRoadTraffic(true)
+ *           .setPopulatePolylines(true)
+ *           .setPopulateTransitionPolylines(true)
+ *           .setAllowLargeDeadlineDespiteInterruptionRisk(true)
+ *           .setUseGeodesicDistances(true)
+ *           .setGeodesicMetersPerSecond(-2129658905)
+ *           .setMaxValidationErrors(-1367418922)
+ *           .setLabel("label102727412")
+ *           .build();
+ *   OptimizeToursResponse response = routeOptimizationClient.optimizeTours(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the RouteOptimizationClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

OptimizeTours

Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing the overall cost. + *

A `ShipmentModel` model consists mainly of `Shipment`s that need to be carried out and `Vehicle`s that can be used to transport the `Shipment`s. The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, they assign a series of `Visit`s to each vehicle, where a `Visit` corresponds to a `VisitRequest`, which is a pickup or delivery for a `Shipment`. + *

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that minimizes the total cost where cost has many components defined in the `ShipmentModel`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • optimizeTours(OptimizeToursRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • optimizeToursCallable() + *

+ *

BatchOptimizeTours

Optimizes vehicle tours for one or more `OptimizeToursRequest` messages as a batch. + *

This method is a Long Running Operation (LRO). The inputs for optimization (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` messages) are read/written from/to Cloud Storage in user-specified format. Like the `OptimizeTours` method, each `OptimizeToursRequest` contains a `ShipmentModel` and returns an `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing the overall cost.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • batchOptimizeToursAsync(BatchOptimizeToursRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • batchOptimizeToursOperationCallable() + *

  • batchOptimizeToursCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of RouteOptimizationSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RouteOptimizationSettings routeOptimizationSettings =
+ *     RouteOptimizationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RouteOptimizationClient routeOptimizationClient =
+ *     RouteOptimizationClient.create(routeOptimizationSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RouteOptimizationSettings routeOptimizationSettings =
+ *     RouteOptimizationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RouteOptimizationClient routeOptimizationClient =
+ *     RouteOptimizationClient.create(routeOptimizationSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RouteOptimizationSettings routeOptimizationSettings =
+ *     RouteOptimizationSettings.newHttpJsonBuilder().build();
+ * RouteOptimizationClient routeOptimizationClient =
+ *     RouteOptimizationClient.create(routeOptimizationSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class RouteOptimizationClient implements BackgroundResource { + private final RouteOptimizationSettings settings; + private final RouteOptimizationStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of RouteOptimizationClient with default settings. */ + public static final RouteOptimizationClient create() throws IOException { + return create(RouteOptimizationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RouteOptimizationClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final RouteOptimizationClient create(RouteOptimizationSettings settings) + throws IOException { + return new RouteOptimizationClient(settings); + } + + /** + * Constructs an instance of RouteOptimizationClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(RouteOptimizationSettings). + */ + public static final RouteOptimizationClient create(RouteOptimizationStub stub) { + return new RouteOptimizationClient(stub); + } + + /** + * Constructs an instance of RouteOptimizationClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected RouteOptimizationClient(RouteOptimizationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RouteOptimizationStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected RouteOptimizationClient(RouteOptimizationStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final RouteOptimizationSettings getSettings() { + return settings; + } + + public RouteOptimizationStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of routes to be performed + * by vehicles minimizing the overall cost. + * + *

A `ShipmentModel` model consists mainly of `Shipment`s that need to be carried out and + * `Vehicle`s that can be used to transport the `Shipment`s. The `ShipmentRoute`s assign + * `Shipment`s to `Vehicle`s. More specifically, they assign a series of `Visit`s to each vehicle, + * where a `Visit` corresponds to a `VisitRequest`, which is a pickup or delivery for a + * `Shipment`. + * + *

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that minimizes the + * total cost where cost has many components defined in the `ShipmentModel`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+   *   OptimizeToursRequest request =
+   *       OptimizeToursRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setTimeout(Duration.newBuilder().build())
+   *           .setModel(ShipmentModel.newBuilder().build())
+   *           .addAllInjectedFirstSolutionRoutes(new ArrayList())
+   *           .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build())
+   *           .addAllRefreshDetailsRoutes(new ArrayList())
+   *           .setInterpretInjectedSolutionsUsingLabels(true)
+   *           .setConsiderRoadTraffic(true)
+   *           .setPopulatePolylines(true)
+   *           .setPopulateTransitionPolylines(true)
+   *           .setAllowLargeDeadlineDespiteInterruptionRisk(true)
+   *           .setUseGeodesicDistances(true)
+   *           .setGeodesicMetersPerSecond(-2129658905)
+   *           .setMaxValidationErrors(-1367418922)
+   *           .setLabel("label102727412")
+   *           .build();
+   *   OptimizeToursResponse response = routeOptimizationClient.optimizeTours(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OptimizeToursResponse optimizeTours(OptimizeToursRequest request) { + return optimizeToursCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of routes to be performed + * by vehicles minimizing the overall cost. + * + *

A `ShipmentModel` model consists mainly of `Shipment`s that need to be carried out and + * `Vehicle`s that can be used to transport the `Shipment`s. The `ShipmentRoute`s assign + * `Shipment`s to `Vehicle`s. More specifically, they assign a series of `Visit`s to each vehicle, + * where a `Visit` corresponds to a `VisitRequest`, which is a pickup or delivery for a + * `Shipment`. + * + *

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that minimizes the + * total cost where cost has many components defined in the `ShipmentModel`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+   *   OptimizeToursRequest request =
+   *       OptimizeToursRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setTimeout(Duration.newBuilder().build())
+   *           .setModel(ShipmentModel.newBuilder().build())
+   *           .addAllInjectedFirstSolutionRoutes(new ArrayList())
+   *           .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build())
+   *           .addAllRefreshDetailsRoutes(new ArrayList())
+   *           .setInterpretInjectedSolutionsUsingLabels(true)
+   *           .setConsiderRoadTraffic(true)
+   *           .setPopulatePolylines(true)
+   *           .setPopulateTransitionPolylines(true)
+   *           .setAllowLargeDeadlineDespiteInterruptionRisk(true)
+   *           .setUseGeodesicDistances(true)
+   *           .setGeodesicMetersPerSecond(-2129658905)
+   *           .setMaxValidationErrors(-1367418922)
+   *           .setLabel("label102727412")
+   *           .build();
+   *   ApiFuture future =
+   *       routeOptimizationClient.optimizeToursCallable().futureCall(request);
+   *   // Do something.
+   *   OptimizeToursResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable optimizeToursCallable() { + return stub.optimizeToursCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Optimizes vehicle tours for one or more `OptimizeToursRequest` messages as a batch. + * + *

This method is a Long Running Operation (LRO). The inputs for optimization + * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` messages) are + * read/written from/to Cloud Storage in user-specified format. Like the `OptimizeTours` method, + * each `OptimizeToursRequest` contains a `ShipmentModel` and returns an `OptimizeToursResponse` + * containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing + * the overall cost. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+   *   BatchOptimizeToursRequest request =
+   *       BatchOptimizeToursRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .addAllModelConfigs(new ArrayList())
+   *           .build();
+   *   BatchOptimizeToursResponse response =
+   *       routeOptimizationClient.batchOptimizeToursAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchOptimizeToursAsync(BatchOptimizeToursRequest request) { + return batchOptimizeToursOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Optimizes vehicle tours for one or more `OptimizeToursRequest` messages as a batch. + * + *

This method is a Long Running Operation (LRO). The inputs for optimization + * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` messages) are + * read/written from/to Cloud Storage in user-specified format. Like the `OptimizeTours` method, + * each `OptimizeToursRequest` contains a `ShipmentModel` and returns an `OptimizeToursResponse` + * containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing + * the overall cost. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+   *   BatchOptimizeToursRequest request =
+   *       BatchOptimizeToursRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .addAllModelConfigs(new ArrayList())
+   *           .build();
+   *   OperationFuture future =
+   *       routeOptimizationClient.batchOptimizeToursOperationCallable().futureCall(request);
+   *   // Do something.
+   *   BatchOptimizeToursResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationCallable() { + return stub.batchOptimizeToursOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Optimizes vehicle tours for one or more `OptimizeToursRequest` messages as a batch. + * + *

This method is a Long Running Operation (LRO). The inputs for optimization + * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` messages) are + * read/written from/to Cloud Storage in user-specified format. Like the `OptimizeTours` method, + * each `OptimizeToursRequest` contains a `ShipmentModel` and returns an `OptimizeToursResponse` + * containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing + * the overall cost. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+   *   BatchOptimizeToursRequest request =
+   *       BatchOptimizeToursRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .addAllModelConfigs(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       routeOptimizationClient.batchOptimizeToursCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable batchOptimizeToursCallable() { + return stub.batchOptimizeToursCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationSettings.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationSettings.java new file mode 100644 index 000000000000..6d3c90b0939e --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationSettings.java @@ -0,0 +1,232 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.stub.RouteOptimizationStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RouteOptimizationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (routeoptimization.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of optimizeTours to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RouteOptimizationSettings.Builder routeOptimizationSettingsBuilder =
+ *     RouteOptimizationSettings.newBuilder();
+ * routeOptimizationSettingsBuilder
+ *     .optimizeToursSettings()
+ *     .setRetrySettings(
+ *         routeOptimizationSettingsBuilder
+ *             .optimizeToursSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RouteOptimizationSettings routeOptimizationSettings = routeOptimizationSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RouteOptimizationSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to optimizeTours. */ + public UnaryCallSettings optimizeToursSettings() { + return ((RouteOptimizationStubSettings) getStubSettings()).optimizeToursSettings(); + } + + /** Returns the object with the settings used for calls to batchOptimizeTours. */ + public UnaryCallSettings batchOptimizeToursSettings() { + return ((RouteOptimizationStubSettings) getStubSettings()).batchOptimizeToursSettings(); + } + + /** Returns the object with the settings used for calls to batchOptimizeTours. */ + public OperationCallSettings< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationSettings() { + return ((RouteOptimizationStubSettings) getStubSettings()) + .batchOptimizeToursOperationSettings(); + } + + public static final RouteOptimizationSettings create(RouteOptimizationStubSettings stub) + throws IOException { + return new RouteOptimizationSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RouteOptimizationStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RouteOptimizationStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RouteOptimizationStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RouteOptimizationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RouteOptimizationStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RouteOptimizationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RouteOptimizationStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RouteOptimizationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RouteOptimizationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RouteOptimizationSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RouteOptimizationStubSettings.newBuilder(clientContext)); + } + + protected Builder(RouteOptimizationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RouteOptimizationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RouteOptimizationStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(RouteOptimizationStubSettings.newHttpJsonBuilder()); + } + + public RouteOptimizationStubSettings.Builder getStubSettingsBuilder() { + return ((RouteOptimizationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to optimizeTours. */ + public UnaryCallSettings.Builder + optimizeToursSettings() { + return getStubSettingsBuilder().optimizeToursSettings(); + } + + /** Returns the builder for the settings used for calls to batchOptimizeTours. */ + public UnaryCallSettings.Builder + batchOptimizeToursSettings() { + return getStubSettingsBuilder().batchOptimizeToursSettings(); + } + + /** Returns the builder for the settings used for calls to batchOptimizeTours. */ + public OperationCallSettings.Builder< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationSettings() { + return getStubSettingsBuilder().batchOptimizeToursOperationSettings(); + } + + @Override + public RouteOptimizationSettings build() throws IOException { + return new RouteOptimizationSettings(this); + } + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/gapic_metadata.json b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/gapic_metadata.json new file mode 100644 index 000000000000..b2f778ef7650 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/gapic_metadata.json @@ -0,0 +1,24 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.maps.routeoptimization.v1", + "libraryPackage": "com.google.maps.routeoptimization.v1", + "services": { + "RouteOptimization": { + "clients": { + "grpc": { + "libraryClient": "RouteOptimizationClient", + "rpcs": { + "BatchOptimizeTours": { + "methods": ["batchOptimizeToursAsync", "batchOptimizeToursOperationCallable", "batchOptimizeToursCallable"] + }, + "OptimizeTours": { + "methods": ["optimizeTours", "optimizeToursCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/package-info.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/package-info.java new file mode 100644 index 000000000000..632f9853019f --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/package-info.java @@ -0,0 +1,70 @@ +/* + * 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. + */ + +/** + * A client to Route Optimization API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= RouteOptimizationClient ======================= + * + *

Service Description: A service for optimizing vehicle tours. + * + *

Validity of certain types of fields: + * + *

* `google.protobuf.Timestamp` * Times are in Unix time: seconds since + * 1970-01-01T00:00:00+00:00. * seconds must be in [0, 253402300799], i.e. in + * [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. * nanos must be unset or set to 0. + * * `google.protobuf.Duration` * seconds must be in [0, 253402300799], i.e. in + * [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. * nanos must be unset or set to 0. + * * `google.type.LatLng` * latitude must be in [-90.0, 90.0]. * longitude must be in + * [-180.0, 180.0]. * at least one of latitude and longitude must be non-zero. + * + *

Sample for RouteOptimizationClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) {
+ *   OptimizeToursRequest request =
+ *       OptimizeToursRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setTimeout(Duration.newBuilder().build())
+ *           .setModel(ShipmentModel.newBuilder().build())
+ *           .addAllInjectedFirstSolutionRoutes(new ArrayList())
+ *           .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build())
+ *           .addAllRefreshDetailsRoutes(new ArrayList())
+ *           .setInterpretInjectedSolutionsUsingLabels(true)
+ *           .setConsiderRoadTraffic(true)
+ *           .setPopulatePolylines(true)
+ *           .setPopulateTransitionPolylines(true)
+ *           .setAllowLargeDeadlineDespiteInterruptionRisk(true)
+ *           .setUseGeodesicDistances(true)
+ *           .setGeodesicMetersPerSecond(-2129658905)
+ *           .setMaxValidationErrors(-1367418922)
+ *           .setLabel("label102727412")
+ *           .build();
+ *   OptimizeToursResponse response = routeOptimizationClient.optimizeTours(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.maps.routeoptimization.v1; + +import javax.annotation.Generated; diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/GrpcRouteOptimizationCallableFactory.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/GrpcRouteOptimizationCallableFactory.java new file mode 100644 index 000000000000..fe321c4a4a7b --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/GrpcRouteOptimizationCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the RouteOptimization service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcRouteOptimizationCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/GrpcRouteOptimizationStub.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/GrpcRouteOptimizationStub.java new file mode 100644 index 000000000000..cc67d72fa6d0 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/GrpcRouteOptimizationStub.java @@ -0,0 +1,216 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse; +import com.google.maps.routeoptimization.v1.OptimizeToursRequest; +import com.google.maps.routeoptimization.v1.OptimizeToursResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the RouteOptimization service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcRouteOptimizationStub extends RouteOptimizationStub { + private static final MethodDescriptor + optimizeToursMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.maps.routeoptimization.v1.RouteOptimization/OptimizeTours") + .setRequestMarshaller( + ProtoUtils.marshaller(OptimizeToursRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OptimizeToursResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchOptimizeToursMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.routeoptimization.v1.RouteOptimization/BatchOptimizeTours") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchOptimizeToursRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable optimizeToursCallable; + private final UnaryCallable batchOptimizeToursCallable; + private final OperationCallable< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRouteOptimizationStub create(RouteOptimizationStubSettings settings) + throws IOException { + return new GrpcRouteOptimizationStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRouteOptimizationStub create(ClientContext clientContext) + throws IOException { + return new GrpcRouteOptimizationStub( + RouteOptimizationStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRouteOptimizationStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRouteOptimizationStub( + RouteOptimizationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRouteOptimizationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcRouteOptimizationStub( + RouteOptimizationStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcRouteOptimizationCallableFactory()); + } + + /** + * Constructs an instance of GrpcRouteOptimizationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcRouteOptimizationStub( + RouteOptimizationStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings optimizeToursTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(optimizeToursMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings batchOptimizeToursTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchOptimizeToursMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.optimizeToursCallable = + callableFactory.createUnaryCallable( + optimizeToursTransportSettings, settings.optimizeToursSettings(), clientContext); + this.batchOptimizeToursCallable = + callableFactory.createUnaryCallable( + batchOptimizeToursTransportSettings, + settings.batchOptimizeToursSettings(), + clientContext); + this.batchOptimizeToursOperationCallable = + callableFactory.createOperationCallable( + batchOptimizeToursTransportSettings, + settings.batchOptimizeToursOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable optimizeToursCallable() { + return optimizeToursCallable; + } + + @Override + public UnaryCallable batchOptimizeToursCallable() { + return batchOptimizeToursCallable; + } + + @Override + public OperationCallable< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationCallable() { + return batchOptimizeToursOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/HttpJsonRouteOptimizationCallableFactory.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/HttpJsonRouteOptimizationCallableFactory.java new file mode 100644 index 000000000000..0c8e759c7fa9 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/HttpJsonRouteOptimizationCallableFactory.java @@ -0,0 +1,101 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the RouteOptimization service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonRouteOptimizationCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/HttpJsonRouteOptimizationStub.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/HttpJsonRouteOptimizationStub.java new file mode 100644 index 000000000000..7f65d6da5b49 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/HttpJsonRouteOptimizationStub.java @@ -0,0 +1,313 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub; + +import com.google.api.HttpRule; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse; +import com.google.maps.routeoptimization.v1.OptimizeToursRequest; +import com.google.maps.routeoptimization.v1.OptimizeToursResponse; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the RouteOptimization service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonRouteOptimizationStub extends RouteOptimizationStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(BatchOptimizeToursResponse.getDescriptor()) + .add(BatchOptimizeToursMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + optimizeToursMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.maps.routeoptimization.v1.RouteOptimization/OptimizeTours") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}:optimizeTours", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*}:optimizeTours") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(OptimizeToursResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + batchOptimizeToursMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.routeoptimization.v1.RouteOptimization/BatchOptimizeTours") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}:batchOptimizeTours", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*}:batchOptimizeTours") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchOptimizeToursRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable optimizeToursCallable; + private final UnaryCallable batchOptimizeToursCallable; + private final OperationCallable< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRouteOptimizationStub create(RouteOptimizationStubSettings settings) + throws IOException { + return new HttpJsonRouteOptimizationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRouteOptimizationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRouteOptimizationStub( + RouteOptimizationStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRouteOptimizationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRouteOptimizationStub( + RouteOptimizationStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRouteOptimizationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonRouteOptimizationStub( + RouteOptimizationStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRouteOptimizationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRouteOptimizationStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonRouteOptimizationStub( + RouteOptimizationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .build()); + + HttpJsonCallSettings + optimizeToursTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(optimizeToursMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings batchOptimizeToursTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchOptimizeToursMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.optimizeToursCallable = + callableFactory.createUnaryCallable( + optimizeToursTransportSettings, settings.optimizeToursSettings(), clientContext); + this.batchOptimizeToursCallable = + callableFactory.createUnaryCallable( + batchOptimizeToursTransportSettings, + settings.batchOptimizeToursSettings(), + clientContext); + this.batchOptimizeToursOperationCallable = + callableFactory.createOperationCallable( + batchOptimizeToursTransportSettings, + settings.batchOptimizeToursOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(optimizeToursMethodDescriptor); + methodDescriptors.add(batchOptimizeToursMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable optimizeToursCallable() { + return optimizeToursCallable; + } + + @Override + public UnaryCallable batchOptimizeToursCallable() { + return batchOptimizeToursCallable; + } + + @Override + public OperationCallable< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationCallable() { + return batchOptimizeToursOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/RouteOptimizationStub.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/RouteOptimizationStub.java new file mode 100644 index 000000000000..eb6625593b4a --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/RouteOptimizationStub.java @@ -0,0 +1,65 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse; +import com.google.maps.routeoptimization.v1.OptimizeToursRequest; +import com.google.maps.routeoptimization.v1.OptimizeToursResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RouteOptimization service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class RouteOptimizationStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable optimizeToursCallable() { + throw new UnsupportedOperationException("Not implemented: optimizeToursCallable()"); + } + + public OperationCallable< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchOptimizeToursOperationCallable()"); + } + + public UnaryCallable batchOptimizeToursCallable() { + throw new UnsupportedOperationException("Not implemented: batchOptimizeToursCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/RouteOptimizationStubSettings.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/RouteOptimizationStubSettings.java new file mode 100644 index 000000000000..b47dca234edd --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/java/com/google/maps/routeoptimization/v1/stub/RouteOptimizationStubSettings.java @@ -0,0 +1,418 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse; +import com.google.maps.routeoptimization.v1.OptimizeToursRequest; +import com.google.maps.routeoptimization.v1.OptimizeToursResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RouteOptimizationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (routeoptimization.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of optimizeTours to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RouteOptimizationStubSettings.Builder routeOptimizationSettingsBuilder =
+ *     RouteOptimizationStubSettings.newBuilder();
+ * routeOptimizationSettingsBuilder
+ *     .optimizeToursSettings()
+ *     .setRetrySettings(
+ *         routeOptimizationSettingsBuilder
+ *             .optimizeToursSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RouteOptimizationStubSettings routeOptimizationSettings =
+ *     routeOptimizationSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RouteOptimizationStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + optimizeToursSettings; + private final UnaryCallSettings batchOptimizeToursSettings; + private final OperationCallSettings< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationSettings; + + /** Returns the object with the settings used for calls to optimizeTours. */ + public UnaryCallSettings optimizeToursSettings() { + return optimizeToursSettings; + } + + /** Returns the object with the settings used for calls to batchOptimizeTours. */ + public UnaryCallSettings batchOptimizeToursSettings() { + return batchOptimizeToursSettings; + } + + /** Returns the object with the settings used for calls to batchOptimizeTours. */ + public OperationCallSettings< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationSettings() { + return batchOptimizeToursOperationSettings; + } + + public RouteOptimizationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRouteOptimizationStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRouteOptimizationStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "routeoptimization"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "routeoptimization.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "routeoptimization.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RouteOptimizationStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RouteOptimizationStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RouteOptimizationStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RouteOptimizationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + optimizeToursSettings = settingsBuilder.optimizeToursSettings().build(); + batchOptimizeToursSettings = settingsBuilder.batchOptimizeToursSettings().build(); + batchOptimizeToursOperationSettings = + settingsBuilder.batchOptimizeToursOperationSettings().build(); + } + + /** Builder for RouteOptimizationStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + optimizeToursSettings; + private final UnaryCallSettings.Builder + batchOptimizeToursSettings; + private final OperationCallSettings.Builder< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3600000L)) + .setTotalTimeout(Duration.ofMillis(3600000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + optimizeToursSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchOptimizeToursSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchOptimizeToursOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + optimizeToursSettings, batchOptimizeToursSettings); + initDefaults(this); + } + + protected Builder(RouteOptimizationStubSettings settings) { + super(settings); + + optimizeToursSettings = settings.optimizeToursSettings.toBuilder(); + batchOptimizeToursSettings = settings.batchOptimizeToursSettings.toBuilder(); + batchOptimizeToursOperationSettings = + settings.batchOptimizeToursOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + optimizeToursSettings, batchOptimizeToursSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .optimizeToursSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .batchOptimizeToursSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .batchOptimizeToursOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchOptimizeToursResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + BatchOptimizeToursMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to optimizeTours. */ + public UnaryCallSettings.Builder + optimizeToursSettings() { + return optimizeToursSettings; + } + + /** Returns the builder for the settings used for calls to batchOptimizeTours. */ + public UnaryCallSettings.Builder + batchOptimizeToursSettings() { + return batchOptimizeToursSettings; + } + + /** Returns the builder for the settings used for calls to batchOptimizeTours. */ + public OperationCallSettings.Builder< + BatchOptimizeToursRequest, BatchOptimizeToursResponse, BatchOptimizeToursMetadata> + batchOptimizeToursOperationSettings() { + return batchOptimizeToursOperationSettings; + } + + @Override + public RouteOptimizationStubSettings build() throws IOException { + return new RouteOptimizationStubSettings(this); + } + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/main/resources/META-INF/native-image/com.google.maps.routeoptimization.v1/reflect-config.json b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/resources/META-INF/native-image/com.google.maps.routeoptimization.v1/reflect-config.json new file mode 100644 index 000000000000..172948331b5c --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/main/resources/META-INF/native-image/com.google.maps.routeoptimization.v1/reflect-config.json @@ -0,0 +1,2270 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.AggregatedMetrics", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.AggregatedMetrics$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest$AsyncModelConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest$AsyncModelConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BreakRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BreakRule$BreakRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BreakRule$BreakRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BreakRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BreakRule$FrequencyConstraint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.BreakRule$FrequencyConstraint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.DistanceLimit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.DistanceLimit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.GcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.GcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint$ConstraintRelaxation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint$ConstraintRelaxation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint$ConstraintRelaxation$Relaxation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint$ConstraintRelaxation$Relaxation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InjectedSolutionConstraint$ConstraintRelaxation$Relaxation$Level", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.InputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursRequest$SearchMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursRequest$SolvingMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursResponse$Metrics", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursResponse$Metrics$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursValidationError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursValidationError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursValidationError$FieldReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OptimizeToursValidationError$FieldReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.OutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Shipment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Shipment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Shipment$Load", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Shipment$Load$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Shipment$VisitRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Shipment$VisitRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$DurationDistanceMatrix", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$DurationDistanceMatrix$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$DurationDistanceMatrix$Row", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$DurationDistanceMatrix$Row$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$PrecedenceRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentModel$PrecedenceRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Break", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Break$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$EncodedPolyline", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$EncodedPolyline$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Transition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Transition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$VehicleLoad", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$VehicleLoad$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Visit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentRoute$Visit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility$IncompatibilityMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentTypeRequirement", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentTypeRequirement$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.ShipmentTypeRequirement$RequirementMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.SkippedShipment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.SkippedShipment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.SkippedShipment$Reason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.SkippedShipment$Reason$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.SkippedShipment$Reason$Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.TimeWindow", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.TimeWindow$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.TransitionAttributes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.TransitionAttributes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$DurationLimit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$DurationLimit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$LoadLimit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$LoadLimit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$LoadLimit$Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$LoadLimit$Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$TravelMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Vehicle$UnloadingPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Waypoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.maps.routeoptimization.v1.Waypoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.LatLng", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.LatLng$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/MockRouteOptimization.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/MockRouteOptimization.java new file mode 100644 index 000000000000..516935526d75 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/MockRouteOptimization.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockRouteOptimization implements MockGrpcService { + private final MockRouteOptimizationImpl serviceImpl; + + public MockRouteOptimization() { + serviceImpl = new MockRouteOptimizationImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/MockRouteOptimizationImpl.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/MockRouteOptimizationImpl.java new file mode 100644 index 000000000000..3aa1ee590e6f --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/MockRouteOptimizationImpl.java @@ -0,0 +1,103 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.RouteOptimizationGrpc.RouteOptimizationImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockRouteOptimizationImpl extends RouteOptimizationImplBase { + private List requests; + private Queue responses; + + public MockRouteOptimizationImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void optimizeTours( + OptimizeToursRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OptimizeToursResponse) { + requests.add(request); + responseObserver.onNext(((OptimizeToursResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method OptimizeTours, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OptimizeToursResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void batchOptimizeTours( + BatchOptimizeToursRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method BatchOptimizeTours, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/RouteOptimizationClientHttpJsonTest.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/RouteOptimizationClientHttpJsonTest.java new file mode 100644 index 000000000000..6adc71e0726c --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/RouteOptimizationClientHttpJsonTest.java @@ -0,0 +1,214 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.stub.HttpJsonRouteOptimizationStub; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class RouteOptimizationClientHttpJsonTest { + private static MockHttpService mockService; + private static RouteOptimizationClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRouteOptimizationStub.getMethodDescriptors(), + RouteOptimizationSettings.getDefaultEndpoint()); + RouteOptimizationSettings settings = + RouteOptimizationSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RouteOptimizationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RouteOptimizationClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void optimizeToursTest() throws Exception { + OptimizeToursResponse expectedResponse = + OptimizeToursResponse.newBuilder() + .addAllRoutes(new ArrayList()) + .setRequestLabel("requestLabel1285152165") + .addAllSkippedShipments(new ArrayList()) + .addAllValidationErrors(new ArrayList()) + .setMetrics(OptimizeToursResponse.Metrics.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + OptimizeToursRequest request = + OptimizeToursRequest.newBuilder() + .setParent("projects/project-5833/locations/location-5833") + .setTimeout(Duration.newBuilder().build()) + .setModel(ShipmentModel.newBuilder().build()) + .addAllInjectedFirstSolutionRoutes(new ArrayList()) + .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build()) + .addAllRefreshDetailsRoutes(new ArrayList()) + .setInterpretInjectedSolutionsUsingLabels(true) + .setConsiderRoadTraffic(true) + .setPopulatePolylines(true) + .setPopulateTransitionPolylines(true) + .setAllowLargeDeadlineDespiteInterruptionRisk(true) + .setUseGeodesicDistances(true) + .setGeodesicMetersPerSecond(-2129658905) + .setMaxValidationErrors(-1367418922) + .setLabel("label102727412") + .build(); + + OptimizeToursResponse actualResponse = client.optimizeTours(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void optimizeToursExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OptimizeToursRequest request = + OptimizeToursRequest.newBuilder() + .setParent("projects/project-5833/locations/location-5833") + .setTimeout(Duration.newBuilder().build()) + .setModel(ShipmentModel.newBuilder().build()) + .addAllInjectedFirstSolutionRoutes(new ArrayList()) + .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build()) + .addAllRefreshDetailsRoutes(new ArrayList()) + .setInterpretInjectedSolutionsUsingLabels(true) + .setConsiderRoadTraffic(true) + .setPopulatePolylines(true) + .setPopulateTransitionPolylines(true) + .setAllowLargeDeadlineDespiteInterruptionRisk(true) + .setUseGeodesicDistances(true) + .setGeodesicMetersPerSecond(-2129658905) + .setMaxValidationErrors(-1367418922) + .setLabel("label102727412") + .build(); + client.optimizeTours(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchOptimizeToursTest() throws Exception { + BatchOptimizeToursResponse expectedResponse = BatchOptimizeToursResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchOptimizeToursTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("projects/project-5833/locations/location-5833") + .addAllModelConfigs(new ArrayList()) + .build(); + + BatchOptimizeToursResponse actualResponse = client.batchOptimizeToursAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchOptimizeToursExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("projects/project-5833/locations/location-5833") + .addAllModelConfigs(new ArrayList()) + .build(); + client.batchOptimizeToursAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/RouteOptimizationClientTest.java b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/RouteOptimizationClientTest.java new file mode 100644 index 000000000000..1abe2e041c31 --- /dev/null +++ b/java-maps-routeoptimization/google-maps-routeoptimization/src/test/java/com/google/maps/routeoptimization/v1/RouteOptimizationClientTest.java @@ -0,0 +1,237 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class RouteOptimizationClientTest { + private static MockRouteOptimization mockRouteOptimization; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RouteOptimizationClient client; + + @BeforeClass + public static void startStaticServer() { + mockRouteOptimization = new MockRouteOptimization(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockRouteOptimization)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RouteOptimizationSettings settings = + RouteOptimizationSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RouteOptimizationClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void optimizeToursTest() throws Exception { + OptimizeToursResponse expectedResponse = + OptimizeToursResponse.newBuilder() + .addAllRoutes(new ArrayList()) + .setRequestLabel("requestLabel1285152165") + .addAllSkippedShipments(new ArrayList()) + .addAllValidationErrors(new ArrayList()) + .setMetrics(OptimizeToursResponse.Metrics.newBuilder().build()) + .build(); + mockRouteOptimization.addResponse(expectedResponse); + + OptimizeToursRequest request = + OptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .setTimeout(Duration.newBuilder().build()) + .setModel(ShipmentModel.newBuilder().build()) + .addAllInjectedFirstSolutionRoutes(new ArrayList()) + .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build()) + .addAllRefreshDetailsRoutes(new ArrayList()) + .setInterpretInjectedSolutionsUsingLabels(true) + .setConsiderRoadTraffic(true) + .setPopulatePolylines(true) + .setPopulateTransitionPolylines(true) + .setAllowLargeDeadlineDespiteInterruptionRisk(true) + .setUseGeodesicDistances(true) + .setGeodesicMetersPerSecond(-2129658905) + .setMaxValidationErrors(-1367418922) + .setLabel("label102727412") + .build(); + + OptimizeToursResponse actualResponse = client.optimizeTours(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRouteOptimization.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + OptimizeToursRequest actualRequest = ((OptimizeToursRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getTimeout(), actualRequest.getTimeout()); + Assert.assertEquals(request.getModel(), actualRequest.getModel()); + Assert.assertEquals(request.getSolvingMode(), actualRequest.getSolvingMode()); + Assert.assertEquals(request.getSearchMode(), actualRequest.getSearchMode()); + Assert.assertEquals( + request.getInjectedFirstSolutionRoutesList(), + actualRequest.getInjectedFirstSolutionRoutesList()); + Assert.assertEquals( + request.getInjectedSolutionConstraint(), actualRequest.getInjectedSolutionConstraint()); + Assert.assertEquals( + request.getRefreshDetailsRoutesList(), actualRequest.getRefreshDetailsRoutesList()); + Assert.assertEquals( + request.getInterpretInjectedSolutionsUsingLabels(), + actualRequest.getInterpretInjectedSolutionsUsingLabels()); + Assert.assertEquals(request.getConsiderRoadTraffic(), actualRequest.getConsiderRoadTraffic()); + Assert.assertEquals(request.getPopulatePolylines(), actualRequest.getPopulatePolylines()); + Assert.assertEquals( + request.getPopulateTransitionPolylines(), actualRequest.getPopulateTransitionPolylines()); + Assert.assertEquals( + request.getAllowLargeDeadlineDespiteInterruptionRisk(), + actualRequest.getAllowLargeDeadlineDespiteInterruptionRisk()); + Assert.assertEquals(request.getUseGeodesicDistances(), actualRequest.getUseGeodesicDistances()); + Assert.assertEquals( + request.getGeodesicMetersPerSecond(), actualRequest.getGeodesicMetersPerSecond(), 0.0001); + Assert.assertEquals(request.getMaxValidationErrors(), actualRequest.getMaxValidationErrors()); + Assert.assertEquals(request.getLabel(), actualRequest.getLabel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void optimizeToursExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRouteOptimization.addException(exception); + + try { + OptimizeToursRequest request = + OptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .setTimeout(Duration.newBuilder().build()) + .setModel(ShipmentModel.newBuilder().build()) + .addAllInjectedFirstSolutionRoutes(new ArrayList()) + .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build()) + .addAllRefreshDetailsRoutes(new ArrayList()) + .setInterpretInjectedSolutionsUsingLabels(true) + .setConsiderRoadTraffic(true) + .setPopulatePolylines(true) + .setPopulateTransitionPolylines(true) + .setAllowLargeDeadlineDespiteInterruptionRisk(true) + .setUseGeodesicDistances(true) + .setGeodesicMetersPerSecond(-2129658905) + .setMaxValidationErrors(-1367418922) + .setLabel("label102727412") + .build(); + client.optimizeTours(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchOptimizeToursTest() throws Exception { + BatchOptimizeToursResponse expectedResponse = BatchOptimizeToursResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchOptimizeToursTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRouteOptimization.addResponse(resultOperation); + + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .addAllModelConfigs(new ArrayList()) + .build(); + + BatchOptimizeToursResponse actualResponse = client.batchOptimizeToursAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRouteOptimization.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchOptimizeToursRequest actualRequest = ((BatchOptimizeToursRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getModelConfigsList(), actualRequest.getModelConfigsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchOptimizeToursExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRouteOptimization.addException(exception); + + try { + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .addAllModelConfigs(new ArrayList()) + .build(); + client.batchOptimizeToursAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-maps-routeoptimization/grpc-google-maps-routeoptimization-v1/pom.xml b/java-maps-routeoptimization/grpc-google-maps-routeoptimization-v1/pom.xml new file mode 100644 index 000000000000..71f6fbe21c53 --- /dev/null +++ b/java-maps-routeoptimization/grpc-google-maps-routeoptimization-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.maps.api.grpc + grpc-google-maps-routeoptimization-v1 + 0.0.1-SNAPSHOT + grpc-google-maps-routeoptimization-v1 + GRPC library for google-maps-routeoptimization + + com.google.maps + google-maps-routeoptimization-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.maps.api.grpc + proto-google-maps-routeoptimization-v1 + + + com.google.guava + guava + + + diff --git a/java-maps-routeoptimization/grpc-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationGrpc.java b/java-maps-routeoptimization/grpc-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationGrpc.java new file mode 100644 index 000000000000..a825cad6eaf7 --- /dev/null +++ b/java-maps-routeoptimization/grpc-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationGrpc.java @@ -0,0 +1,658 @@ +/* + * 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. + */ +package com.google.maps.routeoptimization.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A service for optimizing vehicle tours.
+ * Validity of certain types of fields:
+ *   * `google.protobuf.Timestamp`
+ *     * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
+ *     * seconds must be in [0, 253402300799],
+ *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+ *     * nanos must be unset or set to 0.
+ *   * `google.protobuf.Duration`
+ *     * seconds must be in [0, 253402300799],
+ *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+ *     * nanos must be unset or set to 0.
+ *   * `google.type.LatLng`
+ *     * latitude must be in [-90.0, 90.0].
+ *     * longitude must be in [-180.0, 180.0].
+ *     * at least one of latitude and longitude must be non-zero.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/maps/routeoptimization/v1/route_optimization_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RouteOptimizationGrpc { + + private RouteOptimizationGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.maps.routeoptimization.v1.RouteOptimization"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.maps.routeoptimization.v1.OptimizeToursRequest, + com.google.maps.routeoptimization.v1.OptimizeToursResponse> + getOptimizeToursMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OptimizeTours", + requestType = com.google.maps.routeoptimization.v1.OptimizeToursRequest.class, + responseType = com.google.maps.routeoptimization.v1.OptimizeToursResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.routeoptimization.v1.OptimizeToursRequest, + com.google.maps.routeoptimization.v1.OptimizeToursResponse> + getOptimizeToursMethod() { + io.grpc.MethodDescriptor< + com.google.maps.routeoptimization.v1.OptimizeToursRequest, + com.google.maps.routeoptimization.v1.OptimizeToursResponse> + getOptimizeToursMethod; + if ((getOptimizeToursMethod = RouteOptimizationGrpc.getOptimizeToursMethod) == null) { + synchronized (RouteOptimizationGrpc.class) { + if ((getOptimizeToursMethod = RouteOptimizationGrpc.getOptimizeToursMethod) == null) { + RouteOptimizationGrpc.getOptimizeToursMethod = + getOptimizeToursMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "OptimizeTours")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routeoptimization.v1.OptimizeToursRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routeoptimization.v1.OptimizeToursResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RouteOptimizationMethodDescriptorSupplier("OptimizeTours")) + .build(); + } + } + } + return getOptimizeToursMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest, + com.google.longrunning.Operation> + getBatchOptimizeToursMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchOptimizeTours", + requestType = com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest, + com.google.longrunning.Operation> + getBatchOptimizeToursMethod() { + io.grpc.MethodDescriptor< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest, + com.google.longrunning.Operation> + getBatchOptimizeToursMethod; + if ((getBatchOptimizeToursMethod = RouteOptimizationGrpc.getBatchOptimizeToursMethod) == null) { + synchronized (RouteOptimizationGrpc.class) { + if ((getBatchOptimizeToursMethod = RouteOptimizationGrpc.getBatchOptimizeToursMethod) + == null) { + RouteOptimizationGrpc.getBatchOptimizeToursMethod = + getBatchOptimizeToursMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "BatchOptimizeTours")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RouteOptimizationMethodDescriptorSupplier("BatchOptimizeTours")) + .build(); + } + } + } + return getBatchOptimizeToursMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RouteOptimizationStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RouteOptimizationStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RouteOptimizationStub(channel, callOptions); + } + }; + return RouteOptimizationStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RouteOptimizationBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RouteOptimizationBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RouteOptimizationBlockingStub(channel, callOptions); + } + }; + return RouteOptimizationBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RouteOptimizationFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RouteOptimizationFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RouteOptimizationFutureStub(channel, callOptions); + } + }; + return RouteOptimizationFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A service for optimizing vehicle tours.
+   * Validity of certain types of fields:
+   *   * `google.protobuf.Timestamp`
+   *     * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.protobuf.Duration`
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.type.LatLng`
+   *     * latitude must be in [-90.0, 90.0].
+   *     * longitude must be in [-180.0, 180.0].
+   *     * at least one of latitude and longitude must be non-zero.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
+     * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
+     * routes to be performed by vehicles minimizing the overall cost.
+     * A `ShipmentModel` model consists mainly of `Shipment`s that need to be
+     * carried out and `Vehicle`s that can be used to transport the `Shipment`s.
+     * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
+     * they assign a series of `Visit`s to each vehicle, where a `Visit`
+     * corresponds to a `VisitRequest`, which is a pickup or delivery for a
+     * `Shipment`.
+     * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
+     * minimizes the total cost where cost has many components defined in the
+     * `ShipmentModel`.
+     * 
+ */ + default void optimizeTours( + com.google.maps.routeoptimization.v1.OptimizeToursRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getOptimizeToursMethod(), responseObserver); + } + + /** + * + * + *
+     * Optimizes vehicle tours for one or more `OptimizeToursRequest`
+     * messages as a batch.
+     * This method is a Long Running Operation (LRO). The inputs for optimization
+     * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
+     * messages) are read/written from/to Cloud Storage in user-specified
+     * format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
+     * contains a `ShipmentModel` and returns an `OptimizeToursResponse`
+     * containing `ShipmentRoute`s, which are a set of routes to be performed by
+     * vehicles minimizing the overall cost.
+     * 
+ */ + default void batchOptimizeTours( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchOptimizeToursMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service RouteOptimization. + * + *
+   * A service for optimizing vehicle tours.
+   * Validity of certain types of fields:
+   *   * `google.protobuf.Timestamp`
+   *     * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.protobuf.Duration`
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.type.LatLng`
+   *     * latitude must be in [-90.0, 90.0].
+   *     * longitude must be in [-180.0, 180.0].
+   *     * at least one of latitude and longitude must be non-zero.
+   * 
+ */ + public abstract static class RouteOptimizationImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return RouteOptimizationGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service RouteOptimization. + * + *
+   * A service for optimizing vehicle tours.
+   * Validity of certain types of fields:
+   *   * `google.protobuf.Timestamp`
+   *     * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.protobuf.Duration`
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.type.LatLng`
+   *     * latitude must be in [-90.0, 90.0].
+   *     * longitude must be in [-180.0, 180.0].
+   *     * at least one of latitude and longitude must be non-zero.
+   * 
+ */ + public static final class RouteOptimizationStub + extends io.grpc.stub.AbstractAsyncStub { + private RouteOptimizationStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RouteOptimizationStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RouteOptimizationStub(channel, callOptions); + } + + /** + * + * + *
+     * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
+     * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
+     * routes to be performed by vehicles minimizing the overall cost.
+     * A `ShipmentModel` model consists mainly of `Shipment`s that need to be
+     * carried out and `Vehicle`s that can be used to transport the `Shipment`s.
+     * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
+     * they assign a series of `Visit`s to each vehicle, where a `Visit`
+     * corresponds to a `VisitRequest`, which is a pickup or delivery for a
+     * `Shipment`.
+     * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
+     * minimizes the total cost where cost has many components defined in the
+     * `ShipmentModel`.
+     * 
+ */ + public void optimizeTours( + com.google.maps.routeoptimization.v1.OptimizeToursRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getOptimizeToursMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Optimizes vehicle tours for one or more `OptimizeToursRequest`
+     * messages as a batch.
+     * This method is a Long Running Operation (LRO). The inputs for optimization
+     * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
+     * messages) are read/written from/to Cloud Storage in user-specified
+     * format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
+     * contains a `ShipmentModel` and returns an `OptimizeToursResponse`
+     * containing `ShipmentRoute`s, which are a set of routes to be performed by
+     * vehicles minimizing the overall cost.
+     * 
+ */ + public void batchOptimizeTours( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchOptimizeToursMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service RouteOptimization. + * + *
+   * A service for optimizing vehicle tours.
+   * Validity of certain types of fields:
+   *   * `google.protobuf.Timestamp`
+   *     * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.protobuf.Duration`
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.type.LatLng`
+   *     * latitude must be in [-90.0, 90.0].
+   *     * longitude must be in [-180.0, 180.0].
+   *     * at least one of latitude and longitude must be non-zero.
+   * 
+ */ + public static final class RouteOptimizationBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RouteOptimizationBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RouteOptimizationBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RouteOptimizationBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
+     * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
+     * routes to be performed by vehicles minimizing the overall cost.
+     * A `ShipmentModel` model consists mainly of `Shipment`s that need to be
+     * carried out and `Vehicle`s that can be used to transport the `Shipment`s.
+     * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
+     * they assign a series of `Visit`s to each vehicle, where a `Visit`
+     * corresponds to a `VisitRequest`, which is a pickup or delivery for a
+     * `Shipment`.
+     * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
+     * minimizes the total cost where cost has many components defined in the
+     * `ShipmentModel`.
+     * 
+ */ + public com.google.maps.routeoptimization.v1.OptimizeToursResponse optimizeTours( + com.google.maps.routeoptimization.v1.OptimizeToursRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getOptimizeToursMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Optimizes vehicle tours for one or more `OptimizeToursRequest`
+     * messages as a batch.
+     * This method is a Long Running Operation (LRO). The inputs for optimization
+     * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
+     * messages) are read/written from/to Cloud Storage in user-specified
+     * format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
+     * contains a `ShipmentModel` and returns an `OptimizeToursResponse`
+     * containing `ShipmentRoute`s, which are a set of routes to be performed by
+     * vehicles minimizing the overall cost.
+     * 
+ */ + public com.google.longrunning.Operation batchOptimizeTours( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchOptimizeToursMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service RouteOptimization. + * + *
+   * A service for optimizing vehicle tours.
+   * Validity of certain types of fields:
+   *   * `google.protobuf.Timestamp`
+   *     * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.protobuf.Duration`
+   *     * seconds must be in [0, 253402300799],
+   *       i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
+   *     * nanos must be unset or set to 0.
+   *   * `google.type.LatLng`
+   *     * latitude must be in [-90.0, 90.0].
+   *     * longitude must be in [-180.0, 180.0].
+   *     * at least one of latitude and longitude must be non-zero.
+   * 
+ */ + public static final class RouteOptimizationFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RouteOptimizationFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RouteOptimizationFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RouteOptimizationFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
+     * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
+     * routes to be performed by vehicles minimizing the overall cost.
+     * A `ShipmentModel` model consists mainly of `Shipment`s that need to be
+     * carried out and `Vehicle`s that can be used to transport the `Shipment`s.
+     * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
+     * they assign a series of `Visit`s to each vehicle, where a `Visit`
+     * corresponds to a `VisitRequest`, which is a pickup or delivery for a
+     * `Shipment`.
+     * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
+     * minimizes the total cost where cost has many components defined in the
+     * `ShipmentModel`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.routeoptimization.v1.OptimizeToursResponse> + optimizeTours(com.google.maps.routeoptimization.v1.OptimizeToursRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getOptimizeToursMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Optimizes vehicle tours for one or more `OptimizeToursRequest`
+     * messages as a batch.
+     * This method is a Long Running Operation (LRO). The inputs for optimization
+     * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
+     * messages) are read/written from/to Cloud Storage in user-specified
+     * format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
+     * contains a `ShipmentModel` and returns an `OptimizeToursResponse`
+     * containing `ShipmentRoute`s, which are a set of routes to be performed by
+     * vehicles minimizing the overall cost.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchOptimizeTours(com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchOptimizeToursMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_OPTIMIZE_TOURS = 0; + private static final int METHODID_BATCH_OPTIMIZE_TOURS = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_OPTIMIZE_TOURS: + serviceImpl.optimizeTours( + (com.google.maps.routeoptimization.v1.OptimizeToursRequest) request, + (io.grpc.stub.StreamObserver< + com.google.maps.routeoptimization.v1.OptimizeToursResponse>) + responseObserver); + break; + case METHODID_BATCH_OPTIMIZE_TOURS: + serviceImpl.batchOptimizeTours( + (com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getOptimizeToursMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.routeoptimization.v1.OptimizeToursRequest, + com.google.maps.routeoptimization.v1.OptimizeToursResponse>( + service, METHODID_OPTIMIZE_TOURS))) + .addMethod( + getBatchOptimizeToursMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest, + com.google.longrunning.Operation>(service, METHODID_BATCH_OPTIMIZE_TOURS))) + .build(); + } + + private abstract static class RouteOptimizationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RouteOptimizationBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RouteOptimization"); + } + } + + private static final class RouteOptimizationFileDescriptorSupplier + extends RouteOptimizationBaseDescriptorSupplier { + RouteOptimizationFileDescriptorSupplier() {} + } + + private static final class RouteOptimizationMethodDescriptorSupplier + extends RouteOptimizationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + RouteOptimizationMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RouteOptimizationGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RouteOptimizationFileDescriptorSupplier()) + .addMethod(getOptimizeToursMethod()) + .addMethod(getBatchOptimizeToursMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-maps-routeoptimization/owlbot.py b/java-maps-routeoptimization/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-maps-routeoptimization/owlbot.py @@ -0,0 +1,36 @@ +# 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-maps-routeoptimization/pom.xml b/java-maps-routeoptimization/pom.xml new file mode 100644 index 000000000000..7050e1350b91 --- /dev/null +++ b/java-maps-routeoptimization/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.maps + google-maps-routeoptimization-parent + pom + 0.0.1-SNAPSHOT + Google Route Optimization API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.37.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-maps-routeoptimization-parent + + + + + + com.google.maps + google-maps-routeoptimization + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + grpc-google-maps-routeoptimization-v1 + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + proto-google-maps-routeoptimization-v1 + 0.0.1-SNAPSHOT + + + + + + + google-maps-routeoptimization + grpc-google-maps-routeoptimization-v1 + proto-google-maps-routeoptimization-v1 + google-maps-routeoptimization-bom + + + diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/clirr-ignored-differences.xml b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..3c6e8d73335d --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/maps/routeoptimization/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/maps/routeoptimization/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/maps/routeoptimization/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/pom.xml b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/pom.xml new file mode 100644 index 000000000000..db7e834d1ea3 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.maps.api.grpc + proto-google-maps-routeoptimization-v1 + 0.0.1-SNAPSHOT + proto-google-maps-routeoptimization-v1 + Proto library for google-maps-routeoptimization + + com.google.maps + google-maps-routeoptimization-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/AggregatedMetrics.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/AggregatedMetrics.java new file mode 100644 index 000000000000..95933111dcb4 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/AggregatedMetrics.java @@ -0,0 +1,2879 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Aggregated metrics for
+ * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute] (resp. for
+ * [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse]
+ * over all
+ * [Transition][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+ * and/or [Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit] (resp.
+ * over all [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute])
+ * elements.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.AggregatedMetrics} + */ +public final class AggregatedMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.AggregatedMetrics) + AggregatedMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AggregatedMetrics.newBuilder() to construct. + private AggregatedMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AggregatedMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AggregatedMetrics(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetMaxLoads(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.AggregatedMetrics.class, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder.class); + } + + private int bitField0_; + public static final int PERFORMED_SHIPMENT_COUNT_FIELD_NUMBER = 1; + private int performedShipmentCount_ = 0; + /** + * + * + *
+   * Number of shipments performed. Note that a pickup and delivery pair only
+   * counts once.
+   * 
+ * + * int32 performed_shipment_count = 1; + * + * @return The performedShipmentCount. + */ + @java.lang.Override + public int getPerformedShipmentCount() { + return performedShipmentCount_; + } + + public static final int TRAVEL_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration travelDuration_; + /** + * + * + *
+   * Total travel duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration travel_duration = 2; + * + * @return Whether the travelDuration field is set. + */ + @java.lang.Override + public boolean hasTravelDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Total travel duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration travel_duration = 2; + * + * @return The travelDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getTravelDuration() { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } + /** + * + * + *
+   * Total travel duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTravelDurationOrBuilder() { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } + + public static final int WAIT_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration waitDuration_; + /** + * + * + *
+   * Total wait duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration wait_duration = 3; + * + * @return Whether the waitDuration field is set. + */ + @java.lang.Override + public boolean hasWaitDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Total wait duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration wait_duration = 3; + * + * @return The waitDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getWaitDuration() { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } + /** + * + * + *
+   * Total wait duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getWaitDurationOrBuilder() { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } + + public static final int DELAY_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration delayDuration_; + /** + * + * + *
+   * Total delay duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return Whether the delayDuration field is set. + */ + @java.lang.Override + public boolean hasDelayDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Total delay duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return The delayDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelayDuration() { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } + /** + * + * + *
+   * Total delay duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayDurationOrBuilder() { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } + + public static final int BREAK_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration breakDuration_; + /** + * + * + *
+   * Total break duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return Whether the breakDuration field is set. + */ + @java.lang.Override + public boolean hasBreakDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Total break duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return The breakDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getBreakDuration() { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } + /** + * + * + *
+   * Total break duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBreakDurationOrBuilder() { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } + + public static final int VISIT_DURATION_FIELD_NUMBER = 6; + private com.google.protobuf.Duration visitDuration_; + /** + * + * + *
+   * Total visit duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration visit_duration = 6; + * + * @return Whether the visitDuration field is set. + */ + @java.lang.Override + public boolean hasVisitDuration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Total visit duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration visit_duration = 6; + * + * @return The visitDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getVisitDuration() { + return visitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : visitDuration_; + } + /** + * + * + *
+   * Total visit duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getVisitDurationOrBuilder() { + return visitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : visitDuration_; + } + + public static final int TOTAL_DURATION_FIELD_NUMBER = 7; + private com.google.protobuf.Duration totalDuration_; + /** + * + * + *
+   * The total duration should be equal to the sum of all durations above.
+   * For routes, it also corresponds to:
+   * ```
+   * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+   * -
+   * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+   * ```
+   * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return Whether the totalDuration field is set. + */ + @java.lang.Override + public boolean hasTotalDuration() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * The total duration should be equal to the sum of all durations above.
+   * For routes, it also corresponds to:
+   * ```
+   * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+   * -
+   * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+   * ```
+   * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return The totalDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalDuration() { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } + /** + * + * + *
+   * The total duration should be equal to the sum of all durations above.
+   * For routes, it also corresponds to:
+   * ```
+   * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+   * -
+   * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+   * ```
+   * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalDurationOrBuilder() { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } + + public static final int TRAVEL_DISTANCE_METERS_FIELD_NUMBER = 8; + private double travelDistanceMeters_ = 0D; + /** + * + * + *
+   * Total travel distance for a route or a solution.
+   * 
+ * + * double travel_distance_meters = 8; + * + * @return The travelDistanceMeters. + */ + @java.lang.Override + public double getTravelDistanceMeters() { + return travelDistanceMeters_; + } + + public static final int MAX_LOADS_FIELD_NUMBER = 9; + + private static final class MaxLoadsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_MaxLoadsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + maxLoads_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + internalGetMaxLoads() { + if (maxLoads_ == null) { + return com.google.protobuf.MapField.emptyMapField(MaxLoadsDefaultEntryHolder.defaultEntry); + } + return maxLoads_; + } + + public int getMaxLoadsCount() { + return internalGetMaxLoads().getMap().size(); + } + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public boolean containsMaxLoads(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMaxLoads().getMap().containsKey(key); + } + /** Use {@link #getMaxLoadsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getMaxLoads() { + return getMaxLoadsMap(); + } + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getMaxLoadsMap() { + return internalGetMaxLoads().getMap(); + } + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + getMaxLoadsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMaxLoads().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getMaxLoadsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMaxLoads().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (performedShipmentCount_ != 0) { + output.writeInt32(1, performedShipmentCount_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTravelDuration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getWaitDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getDelayDuration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getBreakDuration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getVisitDuration()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(7, getTotalDuration()); + } + if (java.lang.Double.doubleToRawLongBits(travelDistanceMeters_) != 0) { + output.writeDouble(8, travelDistanceMeters_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMaxLoads(), MaxLoadsDefaultEntryHolder.defaultEntry, 9); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (performedShipmentCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, performedShipmentCount_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTravelDuration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getWaitDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDelayDuration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getBreakDuration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getVisitDuration()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTotalDuration()); + } + if (java.lang.Double.doubleToRawLongBits(travelDistanceMeters_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, travelDistanceMeters_); + } + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + entry : internalGetMaxLoads().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + maxLoads__ = + MaxLoadsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, maxLoads__); + } + 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.AggregatedMetrics)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.AggregatedMetrics other = + (com.google.maps.routeoptimization.v1.AggregatedMetrics) obj; + + if (getPerformedShipmentCount() != other.getPerformedShipmentCount()) return false; + if (hasTravelDuration() != other.hasTravelDuration()) return false; + if (hasTravelDuration()) { + if (!getTravelDuration().equals(other.getTravelDuration())) return false; + } + if (hasWaitDuration() != other.hasWaitDuration()) return false; + if (hasWaitDuration()) { + if (!getWaitDuration().equals(other.getWaitDuration())) return false; + } + if (hasDelayDuration() != other.hasDelayDuration()) return false; + if (hasDelayDuration()) { + if (!getDelayDuration().equals(other.getDelayDuration())) return false; + } + if (hasBreakDuration() != other.hasBreakDuration()) return false; + if (hasBreakDuration()) { + if (!getBreakDuration().equals(other.getBreakDuration())) return false; + } + if (hasVisitDuration() != other.hasVisitDuration()) return false; + if (hasVisitDuration()) { + if (!getVisitDuration().equals(other.getVisitDuration())) return false; + } + if (hasTotalDuration() != other.hasTotalDuration()) return false; + if (hasTotalDuration()) { + if (!getTotalDuration().equals(other.getTotalDuration())) return false; + } + if (java.lang.Double.doubleToLongBits(getTravelDistanceMeters()) + != java.lang.Double.doubleToLongBits(other.getTravelDistanceMeters())) return false; + if (!internalGetMaxLoads().equals(other.internalGetMaxLoads())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PERFORMED_SHIPMENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPerformedShipmentCount(); + if (hasTravelDuration()) { + hash = (37 * hash) + TRAVEL_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getTravelDuration().hashCode(); + } + if (hasWaitDuration()) { + hash = (37 * hash) + WAIT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getWaitDuration().hashCode(); + } + if (hasDelayDuration()) { + hash = (37 * hash) + DELAY_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDelayDuration().hashCode(); + } + if (hasBreakDuration()) { + hash = (37 * hash) + BREAK_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getBreakDuration().hashCode(); + } + if (hasVisitDuration()) { + hash = (37 * hash) + VISIT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getVisitDuration().hashCode(); + } + if (hasTotalDuration()) { + hash = (37 * hash) + TOTAL_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getTotalDuration().hashCode(); + } + hash = (37 * hash) + TRAVEL_DISTANCE_METERS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getTravelDistanceMeters())); + if (!internalGetMaxLoads().getMap().isEmpty()) { + hash = (37 * hash) + MAX_LOADS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMaxLoads().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics 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.AggregatedMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics 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.AggregatedMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics 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.AggregatedMetrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics 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.AggregatedMetrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics 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.AggregatedMetrics 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.AggregatedMetrics 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.AggregatedMetrics 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; + } + /** + * + * + *
+   * Aggregated metrics for
+   * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute] (resp. for
+   * [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse]
+   * over all
+   * [Transition][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+   * and/or [Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit] (resp.
+   * over all [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute])
+   * elements.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.AggregatedMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.AggregatedMetrics) + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetMaxLoads(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetMutableMaxLoads(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.AggregatedMetrics.class, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.AggregatedMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTravelDurationFieldBuilder(); + getWaitDurationFieldBuilder(); + getDelayDurationFieldBuilder(); + getBreakDurationFieldBuilder(); + getVisitDurationFieldBuilder(); + getTotalDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + performedShipmentCount_ = 0; + travelDuration_ = null; + if (travelDurationBuilder_ != null) { + travelDurationBuilder_.dispose(); + travelDurationBuilder_ = null; + } + waitDuration_ = null; + if (waitDurationBuilder_ != null) { + waitDurationBuilder_.dispose(); + waitDurationBuilder_ = null; + } + delayDuration_ = null; + if (delayDurationBuilder_ != null) { + delayDurationBuilder_.dispose(); + delayDurationBuilder_ = null; + } + breakDuration_ = null; + if (breakDurationBuilder_ != null) { + breakDurationBuilder_.dispose(); + breakDurationBuilder_ = null; + } + visitDuration_ = null; + if (visitDurationBuilder_ != null) { + visitDurationBuilder_.dispose(); + visitDurationBuilder_ = null; + } + totalDuration_ = null; + if (totalDurationBuilder_ != null) { + totalDurationBuilder_.dispose(); + totalDurationBuilder_ = null; + } + travelDistanceMeters_ = 0D; + internalGetMutableMaxLoads().clear(); + 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_AggregatedMetrics_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetrics getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetrics build() { + com.google.maps.routeoptimization.v1.AggregatedMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetrics buildPartial() { + com.google.maps.routeoptimization.v1.AggregatedMetrics result = + new com.google.maps.routeoptimization.v1.AggregatedMetrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.AggregatedMetrics result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.performedShipmentCount_ = performedShipmentCount_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.travelDuration_ = + travelDurationBuilder_ == null ? travelDuration_ : travelDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.waitDuration_ = + waitDurationBuilder_ == null ? waitDuration_ : waitDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.delayDuration_ = + delayDurationBuilder_ == null ? delayDuration_ : delayDurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.breakDuration_ = + breakDurationBuilder_ == null ? breakDuration_ : breakDurationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.visitDuration_ = + visitDurationBuilder_ == null ? visitDuration_ : visitDurationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.totalDuration_ = + totalDurationBuilder_ == null ? totalDuration_ : totalDurationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.travelDistanceMeters_ = travelDistanceMeters_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.maxLoads_ = internalGetMaxLoads().build(MaxLoadsDefaultEntryHolder.defaultEntry); + } + 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.AggregatedMetrics) { + return mergeFrom((com.google.maps.routeoptimization.v1.AggregatedMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.AggregatedMetrics other) { + if (other == com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance()) + return this; + if (other.getPerformedShipmentCount() != 0) { + setPerformedShipmentCount(other.getPerformedShipmentCount()); + } + if (other.hasTravelDuration()) { + mergeTravelDuration(other.getTravelDuration()); + } + if (other.hasWaitDuration()) { + mergeWaitDuration(other.getWaitDuration()); + } + if (other.hasDelayDuration()) { + mergeDelayDuration(other.getDelayDuration()); + } + if (other.hasBreakDuration()) { + mergeBreakDuration(other.getBreakDuration()); + } + if (other.hasVisitDuration()) { + mergeVisitDuration(other.getVisitDuration()); + } + if (other.hasTotalDuration()) { + mergeTotalDuration(other.getTotalDuration()); + } + if (other.getTravelDistanceMeters() != 0D) { + setTravelDistanceMeters(other.getTravelDistanceMeters()); + } + internalGetMutableMaxLoads().mergeFrom(other.internalGetMaxLoads()); + bitField0_ |= 0x00000100; + 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: + { + performedShipmentCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getTravelDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getWaitDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getDelayDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getBreakDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getVisitDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getTotalDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 65: + { + travelDistanceMeters_ = input.readDouble(); + bitField0_ |= 0x00000080; + break; + } // case 65 + case 74: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + maxLoads__ = + input.readMessage( + MaxLoadsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableMaxLoads() + .ensureBuilderMap() + .put(maxLoads__.getKey(), maxLoads__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 74 + 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 performedShipmentCount_; + /** + * + * + *
+     * Number of shipments performed. Note that a pickup and delivery pair only
+     * counts once.
+     * 
+ * + * int32 performed_shipment_count = 1; + * + * @return The performedShipmentCount. + */ + @java.lang.Override + public int getPerformedShipmentCount() { + return performedShipmentCount_; + } + /** + * + * + *
+     * Number of shipments performed. Note that a pickup and delivery pair only
+     * counts once.
+     * 
+ * + * int32 performed_shipment_count = 1; + * + * @param value The performedShipmentCount to set. + * @return This builder for chaining. + */ + public Builder setPerformedShipmentCount(int value) { + + performedShipmentCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of shipments performed. Note that a pickup and delivery pair only
+     * counts once.
+     * 
+ * + * int32 performed_shipment_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPerformedShipmentCount() { + bitField0_ = (bitField0_ & ~0x00000001); + performedShipmentCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration travelDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + travelDurationBuilder_; + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + * + * @return Whether the travelDuration field is set. + */ + public boolean hasTravelDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + * + * @return The travelDuration. + */ + public com.google.protobuf.Duration getTravelDuration() { + if (travelDurationBuilder_ == null) { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } else { + return travelDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + public Builder setTravelDuration(com.google.protobuf.Duration value) { + if (travelDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelDuration_ = value; + } else { + travelDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + public Builder setTravelDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (travelDurationBuilder_ == null) { + travelDuration_ = builderForValue.build(); + } else { + travelDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + public Builder mergeTravelDuration(com.google.protobuf.Duration value) { + if (travelDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && travelDuration_ != null + && travelDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTravelDurationBuilder().mergeFrom(value); + } else { + travelDuration_ = value; + } + } else { + travelDurationBuilder_.mergeFrom(value); + } + if (travelDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + public Builder clearTravelDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + travelDuration_ = null; + if (travelDurationBuilder_ != null) { + travelDurationBuilder_.dispose(); + travelDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + public com.google.protobuf.Duration.Builder getTravelDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTravelDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getTravelDurationOrBuilder() { + if (travelDurationBuilder_ != null) { + return travelDurationBuilder_.getMessageOrBuilder(); + } else { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } + } + /** + * + * + *
+     * Total travel duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTravelDurationFieldBuilder() { + if (travelDurationBuilder_ == null) { + travelDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTravelDuration(), getParentForChildren(), isClean()); + travelDuration_ = null; + } + return travelDurationBuilder_; + } + + private com.google.protobuf.Duration waitDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + waitDurationBuilder_; + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + * + * @return Whether the waitDuration field is set. + */ + public boolean hasWaitDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + * + * @return The waitDuration. + */ + public com.google.protobuf.Duration getWaitDuration() { + if (waitDurationBuilder_ == null) { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } else { + return waitDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + public Builder setWaitDuration(com.google.protobuf.Duration value) { + if (waitDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + waitDuration_ = value; + } else { + waitDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + public Builder setWaitDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (waitDurationBuilder_ == null) { + waitDuration_ = builderForValue.build(); + } else { + waitDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + public Builder mergeWaitDuration(com.google.protobuf.Duration value) { + if (waitDurationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && waitDuration_ != null + && waitDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getWaitDurationBuilder().mergeFrom(value); + } else { + waitDuration_ = value; + } + } else { + waitDurationBuilder_.mergeFrom(value); + } + if (waitDuration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + public Builder clearWaitDuration() { + bitField0_ = (bitField0_ & ~0x00000004); + waitDuration_ = null; + if (waitDurationBuilder_ != null) { + waitDurationBuilder_.dispose(); + waitDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + public com.google.protobuf.Duration.Builder getWaitDurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getWaitDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getWaitDurationOrBuilder() { + if (waitDurationBuilder_ != null) { + return waitDurationBuilder_.getMessageOrBuilder(); + } else { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } + } + /** + * + * + *
+     * Total wait duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getWaitDurationFieldBuilder() { + if (waitDurationBuilder_ == null) { + waitDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getWaitDuration(), getParentForChildren(), isClean()); + waitDuration_ = null; + } + return waitDurationBuilder_; + } + + private com.google.protobuf.Duration delayDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayDurationBuilder_; + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return Whether the delayDuration field is set. + */ + public boolean hasDelayDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return The delayDuration. + */ + public com.google.protobuf.Duration getDelayDuration() { + if (delayDurationBuilder_ == null) { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } else { + return delayDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder setDelayDuration(com.google.protobuf.Duration value) { + if (delayDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delayDuration_ = value; + } else { + delayDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder setDelayDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (delayDurationBuilder_ == null) { + delayDuration_ = builderForValue.build(); + } else { + delayDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder mergeDelayDuration(com.google.protobuf.Duration value) { + if (delayDurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && delayDuration_ != null + && delayDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayDurationBuilder().mergeFrom(value); + } else { + delayDuration_ = value; + } + } else { + delayDurationBuilder_.mergeFrom(value); + } + if (delayDuration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder clearDelayDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + delayDuration_ = null; + if (delayDurationBuilder_ != null) { + delayDurationBuilder_.dispose(); + delayDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public com.google.protobuf.Duration.Builder getDelayDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDelayDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getDelayDurationOrBuilder() { + if (delayDurationBuilder_ != null) { + return delayDurationBuilder_.getMessageOrBuilder(); + } else { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } + } + /** + * + * + *
+     * Total delay duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayDurationFieldBuilder() { + if (delayDurationBuilder_ == null) { + delayDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelayDuration(), getParentForChildren(), isClean()); + delayDuration_ = null; + } + return delayDurationBuilder_; + } + + private com.google.protobuf.Duration breakDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + breakDurationBuilder_; + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return Whether the breakDuration field is set. + */ + public boolean hasBreakDuration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return The breakDuration. + */ + public com.google.protobuf.Duration getBreakDuration() { + if (breakDurationBuilder_ == null) { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } else { + return breakDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder setBreakDuration(com.google.protobuf.Duration value) { + if (breakDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + breakDuration_ = value; + } else { + breakDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder setBreakDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (breakDurationBuilder_ == null) { + breakDuration_ = builderForValue.build(); + } else { + breakDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder mergeBreakDuration(com.google.protobuf.Duration value) { + if (breakDurationBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && breakDuration_ != null + && breakDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBreakDurationBuilder().mergeFrom(value); + } else { + breakDuration_ = value; + } + } else { + breakDurationBuilder_.mergeFrom(value); + } + if (breakDuration_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder clearBreakDuration() { + bitField0_ = (bitField0_ & ~0x00000010); + breakDuration_ = null; + if (breakDurationBuilder_ != null) { + breakDurationBuilder_.dispose(); + breakDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public com.google.protobuf.Duration.Builder getBreakDurationBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBreakDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getBreakDurationOrBuilder() { + if (breakDurationBuilder_ != null) { + return breakDurationBuilder_.getMessageOrBuilder(); + } else { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } + } + /** + * + * + *
+     * Total break duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getBreakDurationFieldBuilder() { + if (breakDurationBuilder_ == null) { + breakDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBreakDuration(), getParentForChildren(), isClean()); + breakDuration_ = null; + } + return breakDurationBuilder_; + } + + private com.google.protobuf.Duration visitDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + visitDurationBuilder_; + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + * + * @return Whether the visitDuration field is set. + */ + public boolean hasVisitDuration() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + * + * @return The visitDuration. + */ + public com.google.protobuf.Duration getVisitDuration() { + if (visitDurationBuilder_ == null) { + return visitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : visitDuration_; + } else { + return visitDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + public Builder setVisitDuration(com.google.protobuf.Duration value) { + if (visitDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + visitDuration_ = value; + } else { + visitDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + public Builder setVisitDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (visitDurationBuilder_ == null) { + visitDuration_ = builderForValue.build(); + } else { + visitDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + public Builder mergeVisitDuration(com.google.protobuf.Duration value) { + if (visitDurationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && visitDuration_ != null + && visitDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getVisitDurationBuilder().mergeFrom(value); + } else { + visitDuration_ = value; + } + } else { + visitDurationBuilder_.mergeFrom(value); + } + if (visitDuration_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + public Builder clearVisitDuration() { + bitField0_ = (bitField0_ & ~0x00000020); + visitDuration_ = null; + if (visitDurationBuilder_ != null) { + visitDurationBuilder_.dispose(); + visitDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + public com.google.protobuf.Duration.Builder getVisitDurationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getVisitDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + public com.google.protobuf.DurationOrBuilder getVisitDurationOrBuilder() { + if (visitDurationBuilder_ != null) { + return visitDurationBuilder_.getMessageOrBuilder(); + } else { + return visitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : visitDuration_; + } + } + /** + * + * + *
+     * Total visit duration for a route or a solution.
+     * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getVisitDurationFieldBuilder() { + if (visitDurationBuilder_ == null) { + visitDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getVisitDuration(), getParentForChildren(), isClean()); + visitDuration_ = null; + } + return visitDurationBuilder_; + } + + private com.google.protobuf.Duration totalDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + totalDurationBuilder_; + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return Whether the totalDuration field is set. + */ + public boolean hasTotalDuration() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return The totalDuration. + */ + public com.google.protobuf.Duration getTotalDuration() { + if (totalDurationBuilder_ == null) { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } else { + return totalDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder setTotalDuration(com.google.protobuf.Duration value) { + if (totalDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalDuration_ = value; + } else { + totalDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder setTotalDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (totalDurationBuilder_ == null) { + totalDuration_ = builderForValue.build(); + } else { + totalDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder mergeTotalDuration(com.google.protobuf.Duration value) { + if (totalDurationBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && totalDuration_ != null + && totalDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTotalDurationBuilder().mergeFrom(value); + } else { + totalDuration_ = value; + } + } else { + totalDurationBuilder_.mergeFrom(value); + } + if (totalDuration_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder clearTotalDuration() { + bitField0_ = (bitField0_ & ~0x00000040); + totalDuration_ = null; + if (totalDurationBuilder_ != null) { + totalDurationBuilder_.dispose(); + totalDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public com.google.protobuf.Duration.Builder getTotalDurationBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getTotalDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public com.google.protobuf.DurationOrBuilder getTotalDurationOrBuilder() { + if (totalDurationBuilder_ != null) { + return totalDurationBuilder_.getMessageOrBuilder(); + } else { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } + } + /** + * + * + *
+     * The total duration should be equal to the sum of all durations above.
+     * For routes, it also corresponds to:
+     * ```
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+     * -
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+     * ```
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTotalDurationFieldBuilder() { + if (totalDurationBuilder_ == null) { + totalDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTotalDuration(), getParentForChildren(), isClean()); + totalDuration_ = null; + } + return totalDurationBuilder_; + } + + private double travelDistanceMeters_; + /** + * + * + *
+     * Total travel distance for a route or a solution.
+     * 
+ * + * double travel_distance_meters = 8; + * + * @return The travelDistanceMeters. + */ + @java.lang.Override + public double getTravelDistanceMeters() { + return travelDistanceMeters_; + } + /** + * + * + *
+     * Total travel distance for a route or a solution.
+     * 
+ * + * double travel_distance_meters = 8; + * + * @param value The travelDistanceMeters to set. + * @return This builder for chaining. + */ + public Builder setTravelDistanceMeters(double value) { + + travelDistanceMeters_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Total travel distance for a route or a solution.
+     * 
+ * + * double travel_distance_meters = 8; + * + * @return This builder for chaining. + */ + public Builder clearTravelDistanceMeters() { + bitField0_ = (bitField0_ & ~0x00000080); + travelDistanceMeters_ = 0D; + onChanged(); + return this; + } + + private static final class MaxLoadsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> { + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad build( + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder val) { + if (val instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) { + return (com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) val; + } + return ((com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder) val) + .build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + defaultEntry() { + return MaxLoadsDefaultEntryHolder.defaultEntry; + } + }; + + private static final MaxLoadsConverter maxLoadsConverter = new MaxLoadsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder> + maxLoads_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder> + internalGetMaxLoads() { + if (maxLoads_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(maxLoadsConverter); + } + return maxLoads_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder> + internalGetMutableMaxLoads() { + if (maxLoads_ == null) { + maxLoads_ = new com.google.protobuf.MapFieldBuilder<>(maxLoadsConverter); + } + bitField0_ |= 0x00000100; + onChanged(); + return maxLoads_; + } + + public int getMaxLoadsCount() { + return internalGetMaxLoads().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public boolean containsMaxLoads(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetMaxLoads().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getMaxLoadsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getMaxLoads() { + return getMaxLoadsMap(); + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getMaxLoadsMap() { + return internalGetMaxLoads().getImmutableMap(); + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + getMaxLoadsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder> + map = internalGetMutableMaxLoads().ensureBuilderMap(); + return map.containsKey(key) ? maxLoadsConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getMaxLoadsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder> + map = internalGetMutableMaxLoads().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return maxLoadsConverter.build(map.get(key)); + } + + public Builder clearMaxLoads() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableMaxLoads().clear(); + return this; + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + public Builder removeMaxLoads(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableMaxLoads().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getMutableMaxLoads() { + bitField0_ |= 0x00000100; + return internalGetMutableMaxLoads().ensureMessageMap(); + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + public Builder putMaxLoads( + java.lang.String key, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableMaxLoads().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + public Builder putAllMaxLoads( + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableMaxLoads().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Maximum load achieved over the entire route (resp. solution), for each of
+     * the quantities on this route (resp. solution), computed as the maximum over
+     * all
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+     * (resp.
+     * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder + putMaxLoadsBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder> + builderMap = internalGetMutableMaxLoads().ensureBuilderMap(); + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder entry = + builderMap.get(key); + if (entry == null) { + entry = com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) { + entry = + ((com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder) entry; + } + + @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.AggregatedMetrics) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.AggregatedMetrics) + private static final com.google.maps.routeoptimization.v1.AggregatedMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.AggregatedMetrics(); + } + + public static com.google.maps.routeoptimization.v1.AggregatedMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AggregatedMetrics 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.AggregatedMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/AggregatedMetricsOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/AggregatedMetricsOrBuilder.java new file mode 100644 index 000000000000..ae8723d14379 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/AggregatedMetricsOrBuilder.java @@ -0,0 +1,377 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface AggregatedMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.AggregatedMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Number of shipments performed. Note that a pickup and delivery pair only
+   * counts once.
+   * 
+ * + * int32 performed_shipment_count = 1; + * + * @return The performedShipmentCount. + */ + int getPerformedShipmentCount(); + + /** + * + * + *
+   * Total travel duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration travel_duration = 2; + * + * @return Whether the travelDuration field is set. + */ + boolean hasTravelDuration(); + /** + * + * + *
+   * Total travel duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration travel_duration = 2; + * + * @return The travelDuration. + */ + com.google.protobuf.Duration getTravelDuration(); + /** + * + * + *
+   * Total travel duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration travel_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getTravelDurationOrBuilder(); + + /** + * + * + *
+   * Total wait duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration wait_duration = 3; + * + * @return Whether the waitDuration field is set. + */ + boolean hasWaitDuration(); + /** + * + * + *
+   * Total wait duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration wait_duration = 3; + * + * @return The waitDuration. + */ + com.google.protobuf.Duration getWaitDuration(); + /** + * + * + *
+   * Total wait duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration wait_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getWaitDurationOrBuilder(); + + /** + * + * + *
+   * Total delay duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return Whether the delayDuration field is set. + */ + boolean hasDelayDuration(); + /** + * + * + *
+   * Total delay duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return The delayDuration. + */ + com.google.protobuf.Duration getDelayDuration(); + /** + * + * + *
+   * Total delay duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getDelayDurationOrBuilder(); + + /** + * + * + *
+   * Total break duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return Whether the breakDuration field is set. + */ + boolean hasBreakDuration(); + /** + * + * + *
+   * Total break duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return The breakDuration. + */ + com.google.protobuf.Duration getBreakDuration(); + /** + * + * + *
+   * Total break duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getBreakDurationOrBuilder(); + + /** + * + * + *
+   * Total visit duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration visit_duration = 6; + * + * @return Whether the visitDuration field is set. + */ + boolean hasVisitDuration(); + /** + * + * + *
+   * Total visit duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration visit_duration = 6; + * + * @return The visitDuration. + */ + com.google.protobuf.Duration getVisitDuration(); + /** + * + * + *
+   * Total visit duration for a route or a solution.
+   * 
+ * + * .google.protobuf.Duration visit_duration = 6; + */ + com.google.protobuf.DurationOrBuilder getVisitDurationOrBuilder(); + + /** + * + * + *
+   * The total duration should be equal to the sum of all durations above.
+   * For routes, it also corresponds to:
+   * ```
+   * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+   * -
+   * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+   * ```
+   * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return Whether the totalDuration field is set. + */ + boolean hasTotalDuration(); + /** + * + * + *
+   * The total duration should be equal to the sum of all durations above.
+   * For routes, it also corresponds to:
+   * ```
+   * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+   * -
+   * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+   * ```
+   * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return The totalDuration. + */ + com.google.protobuf.Duration getTotalDuration(); + /** + * + * + *
+   * The total duration should be equal to the sum of all durations above.
+   * For routes, it also corresponds to:
+   * ```
+   * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]
+   * -
+   * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
+   * ```
+   * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + com.google.protobuf.DurationOrBuilder getTotalDurationOrBuilder(); + + /** + * + * + *
+   * Total travel distance for a route or a solution.
+   * 
+ * + * double travel_distance_meters = 8; + * + * @return The travelDistanceMeters. + */ + double getTravelDistanceMeters(); + + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + int getMaxLoadsCount(); + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + boolean containsMaxLoads(java.lang.String key); + /** Use {@link #getMaxLoadsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getMaxLoads(); + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + java.util.Map + getMaxLoadsMap(); + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getMaxLoadsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad defaultValue); + /** + * + * + *
+   * Maximum load achieved over the entire route (resp. solution), for each of
+   * the quantities on this route (resp. solution), computed as the maximum over
+   * all
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]
+   * (resp.
+   * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads].
+   * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> max_loads = 9; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getMaxLoadsOrThrow( + java.lang.String key); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursMetadata.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursMetadata.java new file mode 100644 index 000000000000..59dae189f9be --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursMetadata.java @@ -0,0 +1,439 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Operation metadata for `BatchOptimizeToursRequest` calls.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} + */ +public final class BatchOptimizeToursMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) + BatchOptimizeToursMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchOptimizeToursMetadata.newBuilder() to construct. + private BatchOptimizeToursMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchOptimizeToursMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchOptimizeToursMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.BatchOptimizeToursMetadata)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata other = + (com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata 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; + } + /** + * + * + *
+   * Operation metadata for `BatchOptimizeToursRequest` calls.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + 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_BatchOptimizeToursMetadata_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata build() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata buildPartial() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata result = + new com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata(this); + onBuilt(); + return result; + } + + @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.BatchOptimizeToursMetadata) { + return mergeFrom((com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata other) { + if (other + == com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.getDefaultInstance()) + return this; + 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; + 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; + } + + @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.BatchOptimizeToursMetadata) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) + private static final com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata(); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchOptimizeToursMetadata 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.BatchOptimizeToursMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursMetadataOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursMetadataOrBuilder.java new file mode 100644 index 000000000000..b3b8b3cf7746 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursMetadataOrBuilder.java @@ -0,0 +1,25 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface BatchOptimizeToursMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursRequest.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursRequest.java new file mode 100644 index 000000000000..ac70d3459152 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursRequest.java @@ -0,0 +1,2659 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Request to batch optimize tours as an asynchronous operation.
+ * Each input file should contain one `OptimizeToursRequest`, and each output
+ * file will contain one `OptimizeToursResponse`. The request contains
+ * information to read/write and parse the files. All the input and output files
+ * should be under the same project.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BatchOptimizeToursRequest} + */ +public final class BatchOptimizeToursRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BatchOptimizeToursRequest) + BatchOptimizeToursRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchOptimizeToursRequest.newBuilder() to construct. + private BatchOptimizeToursRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchOptimizeToursRequest() { + parent_ = ""; + modelConfigs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchOptimizeToursRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.Builder.class); + } + + public interface AsyncModelConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. User defined model name, can be used as alias by users to keep
+     * track of models.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * Optional. User defined model name, can be used as alias by users to keep
+     * track of models.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * Required. Information about the input model.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + boolean hasInputConfig(); + /** + * + * + *
+     * Required. Information about the input model.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + com.google.maps.routeoptimization.v1.InputConfig getInputConfig(); + /** + * + * + *
+     * Required. Information about the input model.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routeoptimization.v1.InputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+     * Required. The desired output location information.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+     * Required. The desired output location information.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + com.google.maps.routeoptimization.v1.OutputConfig getOutputConfig(); + /** + * + * + *
+     * Required. The desired output location information.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routeoptimization.v1.OutputConfigOrBuilder getOutputConfigOrBuilder(); + } + /** + * + * + *
+   * Information for solving one optimization model asynchronously.
+   * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} + */ + public static final class AsyncModelConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) + AsyncModelConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AsyncModelConfig.newBuilder() to construct. + private AsyncModelConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AsyncModelConfig() { + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AsyncModelConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .Builder.class); + } + + private int bitField0_; + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Optional. User defined model name, can be used as alias by users to keep
+     * track of models.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. User defined model name, can be used as alias by users to keep
+     * track of models.
+     * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.maps.routeoptimization.v1.InputConfig inputConfig_; + /** + * + * + *
+     * Required. Information about the input model.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + @java.lang.Override + public boolean hasInputConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Information about the input model.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+     * Required. Information about the input model.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InputConfigOrBuilder getInputConfigOrBuilder() { + return inputConfig_ == null + ? com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 3; + private com.google.maps.routeoptimization.v1.OutputConfig outputConfig_; + /** + * + * + *
+     * Required. The desired output location information.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The desired output location information.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+     * Required. The desired output location information.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return outputConfig_ == null + ? com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getInputConfig()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getOutputConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInputConfig()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOutputConfig()); + } + 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.BatchOptimizeToursRequest.AsyncModelConfig)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig other = + (com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig + 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.BatchOptimizeToursRequest.AsyncModelConfig 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; + } + /** + * + * + *
+     * Information for solving one optimization model asynchronously.
+     * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInputConfigFieldBuilder(); + getOutputConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayName_ = ""; + inputConfig_ = null; + if (inputConfigBuilder_ != null) { + inputConfigBuilder_.dispose(); + inputConfigBuilder_ = null; + } + outputConfig_ = null; + if (outputConfigBuilder_ != null) { + outputConfigBuilder_.dispose(); + outputConfigBuilder_ = 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_BatchOptimizeToursRequest_AsyncModelConfig_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + build() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + buildPartial() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig result = + new com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.inputConfig_ = + inputConfigBuilder_ == null ? inputConfig_ : inputConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputConfig_ = + outputConfigBuilder_ == null ? outputConfig_ : outputConfigBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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.BatchOptimizeToursRequest.AsyncModelConfig) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig other) { + if (other + == com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getInputConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getOutputConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * Optional. User defined model name, can be used as alias by users to keep
+       * track of models.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. User defined model name, can be used as alias by users to keep
+       * track of models.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. User defined model name, can be used as alias by users to keep
+       * track of models.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. User defined model name, can be used as alias by users to keep
+       * track of models.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. User defined model name, can be used as alias by users to keep
+       * track of models.
+       * 
+ * + * string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.maps.routeoptimization.v1.InputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.InputConfig, + com.google.maps.routeoptimization.v1.InputConfig.Builder, + com.google.maps.routeoptimization.v1.InputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the inputConfig field is set. + */ + public boolean hasInputConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The inputConfig. + */ + public com.google.maps.routeoptimization.v1.InputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig(com.google.maps.routeoptimization.v1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + } else { + inputConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInputConfig( + com.google.maps.routeoptimization.v1.InputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInputConfig(com.google.maps.routeoptimization.v1.InputConfig value) { + if (inputConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && inputConfig_ != null + && inputConfig_ + != com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance()) { + getInputConfigBuilder().mergeFrom(value); + } else { + inputConfig_ = value; + } + } else { + inputConfigBuilder_.mergeFrom(value); + } + if (inputConfig_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInputConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + inputConfig_ = null; + if (inputConfigBuilder_ != null) { + inputConfigBuilder_.dispose(); + inputConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.InputConfig.Builder getInputConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.InputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+       * Required. Information about the input model.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.InputConfig, + com.google.maps.routeoptimization.v1.InputConfig.Builder, + com.google.maps.routeoptimization.v1.InputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.InputConfig, + com.google.maps.routeoptimization.v1.InputConfig.Builder, + com.google.maps.routeoptimization.v1.InputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.maps.routeoptimization.v1.OutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OutputConfig, + com.google.maps.routeoptimization.v1.OutputConfig.Builder, + com.google.maps.routeoptimization.v1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + public com.google.maps.routeoptimization.v1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig(com.google.maps.routeoptimization.v1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + } else { + outputConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.maps.routeoptimization.v1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOutputConfig(com.google.maps.routeoptimization.v1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && outputConfig_ != null + && outputConfig_ + != com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance()) { + getOutputConfigBuilder().mergeFrom(value); + } else { + outputConfig_ = value; + } + } else { + outputConfigBuilder_.mergeFrom(value); + } + if (outputConfig_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOutputConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + outputConfig_ = null; + if (outputConfigBuilder_ != null) { + outputConfigBuilder_.dispose(); + outputConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.OutputConfig.Builder getOutputConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+       * Required. The desired output location information.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OutputConfig, + com.google.maps.routeoptimization.v1.OutputConfig.Builder, + com.google.maps.routeoptimization.v1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OutputConfig, + com.google.maps.routeoptimization.v1.OutputConfig.Builder, + com.google.maps.routeoptimization.v1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + @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.BatchOptimizeToursRequest.AsyncModelConfig) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) + private static final com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig(); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsyncModelConfig 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.BatchOptimizeToursRequest.AsyncModelConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Target project and location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Target project and location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_CONFIGS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig> + modelConfigs_; + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig> + getModelConfigsList() { + return modelConfigs_; + } + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfigOrBuilder> + getModelConfigsOrBuilderList() { + return modelConfigs_; + } + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getModelConfigsCount() { + return modelConfigs_.size(); + } + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + getModelConfigs(int index) { + return modelConfigs_.get(index); + } + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfigOrBuilder + getModelConfigsOrBuilder(int index) { + return modelConfigs_.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 { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + for (int i = 0; i < modelConfigs_.size(); i++) { + output.writeMessage(2, modelConfigs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + for (int i = 0; i < modelConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, modelConfigs_.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.BatchOptimizeToursRequest)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest other = + (com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getModelConfigsList().equals(other.getModelConfigsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (getModelConfigsCount() > 0) { + hash = (37 * hash) + MODEL_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getModelConfigsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest 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.BatchOptimizeToursRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request to batch optimize tours as an asynchronous operation.
+   * Each input file should contain one `OptimizeToursRequest`, and each output
+   * file will contain one `OptimizeToursResponse`. The request contains
+   * information to read/write and parse the files. All the input and output files
+   * should be under the same project.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BatchOptimizeToursRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BatchOptimizeToursRequest) + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + if (modelConfigsBuilder_ == null) { + modelConfigs_ = java.util.Collections.emptyList(); + } else { + modelConfigs_ = null; + modelConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + 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_BatchOptimizeToursRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest build() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest buildPartial() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest result = + new com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest result) { + if (modelConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + modelConfigs_ = java.util.Collections.unmodifiableList(modelConfigs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.modelConfigs_ = modelConfigs_; + } else { + result.modelConfigs_ = modelConfigsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @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.BatchOptimizeToursRequest) { + return mergeFrom((com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest other) { + if (other + == com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (modelConfigsBuilder_ == null) { + if (!other.modelConfigs_.isEmpty()) { + if (modelConfigs_.isEmpty()) { + modelConfigs_ = other.modelConfigs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureModelConfigsIsMutable(); + modelConfigs_.addAll(other.modelConfigs_); + } + onChanged(); + } + } else { + if (!other.modelConfigs_.isEmpty()) { + if (modelConfigsBuilder_.isEmpty()) { + modelConfigsBuilder_.dispose(); + modelConfigsBuilder_ = null; + modelConfigs_ = other.modelConfigs_; + bitField0_ = (bitField0_ & ~0x00000002); + modelConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getModelConfigsFieldBuilder() + : null; + } else { + modelConfigsBuilder_.addAllMessages(other.modelConfigs_); + } + } + } + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig m = + input.readMessage( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfig.parser(), + extensionRegistry); + if (modelConfigsBuilder_ == null) { + ensureModelConfigsIsMutable(); + modelConfigs_.add(m); + } else { + modelConfigsBuilder_.addMessage(m); + } + 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.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Target project and location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Target project and location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Target project and location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target project and location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target project and location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig> + modelConfigs_ = java.util.Collections.emptyList(); + + private void ensureModelConfigsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + modelConfigs_ = + new java.util.ArrayList< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig>( + modelConfigs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfigOrBuilder> + modelConfigsBuilder_; + + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig> + getModelConfigsList() { + if (modelConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(modelConfigs_); + } else { + return modelConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getModelConfigsCount() { + if (modelConfigsBuilder_ == null) { + return modelConfigs_.size(); + } else { + return modelConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + getModelConfigs(int index) { + if (modelConfigsBuilder_ == null) { + return modelConfigs_.get(index); + } else { + return modelConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModelConfigs( + int index, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig value) { + if (modelConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelConfigsIsMutable(); + modelConfigs_.set(index, value); + onChanged(); + } else { + modelConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModelConfigs( + int index, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder + builderForValue) { + if (modelConfigsBuilder_ == null) { + ensureModelConfigsIsMutable(); + modelConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + modelConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModelConfigs( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig value) { + if (modelConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelConfigsIsMutable(); + modelConfigs_.add(value); + onChanged(); + } else { + modelConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModelConfigs( + int index, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig value) { + if (modelConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelConfigsIsMutable(); + modelConfigs_.add(index, value); + onChanged(); + } else { + modelConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModelConfigs( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder + builderForValue) { + if (modelConfigsBuilder_ == null) { + ensureModelConfigsIsMutable(); + modelConfigs_.add(builderForValue.build()); + onChanged(); + } else { + modelConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModelConfigs( + int index, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder + builderForValue) { + if (modelConfigsBuilder_ == null) { + ensureModelConfigsIsMutable(); + modelConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + modelConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllModelConfigs( + java.lang.Iterable< + ? extends + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig> + values) { + if (modelConfigsBuilder_ == null) { + ensureModelConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modelConfigs_); + onChanged(); + } else { + modelConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearModelConfigs() { + if (modelConfigsBuilder_ == null) { + modelConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + modelConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeModelConfigs(int index) { + if (modelConfigsBuilder_ == null) { + ensureModelConfigsIsMutable(); + modelConfigs_.remove(index); + onChanged(); + } else { + modelConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder + getModelConfigsBuilder(int index) { + return getModelConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfigOrBuilder + getModelConfigsOrBuilder(int index) { + if (modelConfigsBuilder_ == null) { + return modelConfigs_.get(index); + } else { + return modelConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfigOrBuilder> + getModelConfigsOrBuilderList() { + if (modelConfigsBuilder_ != null) { + return modelConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(modelConfigs_); + } + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder + addModelConfigsBuilder() { + return getModelConfigsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .getDefaultInstance()); + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder + addModelConfigsBuilder(int index) { + return getModelConfigsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .getDefaultInstance()); + } + /** + * + * + *
+     * Required. Input/Output information each purchase model, such as file paths
+     * and data formats.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder> + getModelConfigsBuilderList() { + return getModelConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.Builder, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfigOrBuilder> + getModelConfigsFieldBuilder() { + if (modelConfigsBuilder_ == null) { + modelConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + .Builder, + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfigOrBuilder>( + modelConfigs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + modelConfigs_ = null; + } + return modelConfigsBuilder_; + } + + @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.BatchOptimizeToursRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BatchOptimizeToursRequest) + private static final com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest(); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchOptimizeToursRequest 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.BatchOptimizeToursRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursRequestOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursRequestOrBuilder.java new file mode 100644 index 000000000000..c626f4dad40a --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface BatchOptimizeToursRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BatchOptimizeToursRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Target project and location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Target project and location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getModelConfigsList(); + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig getModelConfigs( + int index); + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getModelConfigsCount(); + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List< + ? extends + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest + .AsyncModelConfigOrBuilder> + getModelConfigsOrBuilderList(); + /** + * + * + *
+   * Required. Input/Output information each purchase model, such as file paths
+   * and data formats.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfigOrBuilder + getModelConfigsOrBuilder(int index); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursResponse.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursResponse.java new file mode 100644 index 000000000000..c01715873eb7 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursResponse.java @@ -0,0 +1,441 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Response to a `BatchOptimizeToursRequest`. This is returned in
+ * the Long Running Operation after the operation is complete.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BatchOptimizeToursResponse} + */ +public final class BatchOptimizeToursResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BatchOptimizeToursResponse) + BatchOptimizeToursResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchOptimizeToursResponse.newBuilder() to construct. + private BatchOptimizeToursResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchOptimizeToursResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchOptimizeToursResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.BatchOptimizeToursResponse)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse other = + (com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse 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.BatchOptimizeToursResponse 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; + } + /** + * + * + *
+   * Response to a `BatchOptimizeToursRequest`. This is returned in
+   * the Long Running Operation after the operation is complete.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BatchOptimizeToursResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BatchOptimizeToursResponse) + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.class, + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + 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_BatchOptimizeToursResponse_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse build() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse buildPartial() { + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse result = + new com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse(this); + onBuilt(); + return result; + } + + @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.BatchOptimizeToursResponse) { + return mergeFrom((com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse other) { + if (other + == com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse.getDefaultInstance()) + return this; + 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; + 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; + } + + @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.BatchOptimizeToursResponse) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BatchOptimizeToursResponse) + private static final com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse(); + } + + public static com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchOptimizeToursResponse 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.BatchOptimizeToursResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursResponseOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursResponseOrBuilder.java new file mode 100644 index 000000000000..e19060b598f7 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BatchOptimizeToursResponseOrBuilder.java @@ -0,0 +1,25 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface BatchOptimizeToursResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BatchOptimizeToursResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BreakRule.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BreakRule.java new file mode 100644 index 000000000000..72cf067f1b00 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BreakRule.java @@ -0,0 +1,4284 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break
+ * is a contiguous period of time during which the vehicle remains idle at its
+ * current position and cannot perform any visit. A break may occur:
+ *
+ * * during the travel between two visits (which includes the time right
+ *   before or right after a visit, but not in the middle of a visit), in
+ *   which case it extends the corresponding transit time between the visits,
+ * * or before the vehicle start (the vehicle may not start in the middle of
+ *   a break), in which case it does not affect the vehicle start time.
+ * * or after the vehicle end (ditto, with the vehicle end time).
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BreakRule} + */ +public final class BreakRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BreakRule) + BreakRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use BreakRule.newBuilder() to construct. + private BreakRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BreakRule() { + breakRequests_ = java.util.Collections.emptyList(); + frequencyConstraints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BreakRule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BreakRule.class, + com.google.maps.routeoptimization.v1.BreakRule.Builder.class); + } + + public interface BreakRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BreakRule.BreakRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Lower bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the earliestStartTime field is set. + */ + boolean hasEarliestStartTime(); + /** + * + * + *
+     * Required. Lower bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The earliestStartTime. + */ + com.google.protobuf.Timestamp getEarliestStartTime(); + /** + * + * + *
+     * Required. Lower bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getEarliestStartTimeOrBuilder(); + + /** + * + * + *
+     * Required. Upper bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the latestStartTime field is set. + */ + boolean hasLatestStartTime(); + /** + * + * + *
+     * Required. Upper bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The latestStartTime. + */ + com.google.protobuf.Timestamp getLatestStartTime(); + /** + * + * + *
+     * Required. Upper bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getLatestStartTimeOrBuilder(); + + /** + * + * + *
+     * Required. Minimum duration of the break. Must be positive.
+     * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the minDuration field is set. + */ + boolean hasMinDuration(); + /** + * + * + *
+     * Required. Minimum duration of the break. Must be positive.
+     * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The minDuration. + */ + com.google.protobuf.Duration getMinDuration(); + /** + * + * + *
+     * Required. Minimum duration of the break. Must be positive.
+     * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getMinDurationOrBuilder(); + } + /** + * + * + *
+   * The sequence of breaks (i.e. their number and order) that apply to each
+   * vehicle must be known beforehand. The repeated `BreakRequest`s define
+   * that sequence, in the order in which they must occur. Their time windows
+   * (`earliest_start_time` / `latest_start_time`) may overlap, but they must
+   * be compatible with the order (this is checked).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BreakRule.BreakRequest} + */ + public static final class BreakRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BreakRule.BreakRequest) + BreakRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BreakRequest.newBuilder() to construct. + private BreakRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BreakRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BreakRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.class, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder.class); + } + + private int bitField0_; + public static final int EARLIEST_START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp earliestStartTime_; + /** + * + * + *
+     * Required. Lower bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the earliestStartTime field is set. + */ + @java.lang.Override + public boolean hasEarliestStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Lower bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The earliestStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestStartTime() { + return earliestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestStartTime_; + } + /** + * + * + *
+     * Required. Lower bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestStartTimeOrBuilder() { + return earliestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestStartTime_; + } + + public static final int LATEST_START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp latestStartTime_; + /** + * + * + *
+     * Required. Upper bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the latestStartTime field is set. + */ + @java.lang.Override + public boolean hasLatestStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Upper bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The latestStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLatestStartTime() { + return latestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestStartTime_; + } + /** + * + * + *
+     * Required. Upper bound (inclusive) on the start of the break.
+     * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLatestStartTimeOrBuilder() { + return latestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestStartTime_; + } + + public static final int MIN_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration minDuration_; + /** + * + * + *
+     * Required. Minimum duration of the break. Must be positive.
+     * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the minDuration field is set. + */ + @java.lang.Override + public boolean hasMinDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Minimum duration of the break. Must be positive.
+     * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The minDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getMinDuration() { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } + /** + * + * + *
+     * Required. Minimum duration of the break. Must be positive.
+     * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMinDurationOrBuilder() { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEarliestStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getLatestStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getMinDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEarliestStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLatestStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMinDuration()); + } + 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.BreakRule.BreakRequest)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest other = + (com.google.maps.routeoptimization.v1.BreakRule.BreakRequest) obj; + + if (hasEarliestStartTime() != other.hasEarliestStartTime()) return false; + if (hasEarliestStartTime()) { + if (!getEarliestStartTime().equals(other.getEarliestStartTime())) return false; + } + if (hasLatestStartTime() != other.hasLatestStartTime()) return false; + if (hasLatestStartTime()) { + if (!getLatestStartTime().equals(other.getLatestStartTime())) return false; + } + if (hasMinDuration() != other.hasMinDuration()) return false; + if (hasMinDuration()) { + if (!getMinDuration().equals(other.getMinDuration())) 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 (hasEarliestStartTime()) { + hash = (37 * hash) + EARLIEST_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestStartTime().hashCode(); + } + if (hasLatestStartTime()) { + hash = (37 * hash) + LATEST_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLatestStartTime().hashCode(); + } + if (hasMinDuration()) { + hash = (37 * hash) + MIN_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMinDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest 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.BreakRule.BreakRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest 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.BreakRule.BreakRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest 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.BreakRule.BreakRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest 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.BreakRule.BreakRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest 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.BreakRule.BreakRequest 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.BreakRule.BreakRequest 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.BreakRule.BreakRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The sequence of breaks (i.e. their number and order) that apply to each
+     * vehicle must be known beforehand. The repeated `BreakRequest`s define
+     * that sequence, in the order in which they must occur. Their time windows
+     * (`earliest_start_time` / `latest_start_time`) may overlap, but they must
+     * be compatible with the order (this is checked).
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BreakRule.BreakRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BreakRule.BreakRequest) + com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.class, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEarliestStartTimeFieldBuilder(); + getLatestStartTimeFieldBuilder(); + getMinDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + earliestStartTime_ = null; + if (earliestStartTimeBuilder_ != null) { + earliestStartTimeBuilder_.dispose(); + earliestStartTimeBuilder_ = null; + } + latestStartTime_ = null; + if (latestStartTimeBuilder_ != null) { + latestStartTimeBuilder_.dispose(); + latestStartTimeBuilder_ = null; + } + minDuration_ = null; + if (minDurationBuilder_ != null) { + minDurationBuilder_.dispose(); + minDurationBuilder_ = 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_BreakRule_BreakRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest build() { + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest buildPartial() { + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest result = + new com.google.maps.routeoptimization.v1.BreakRule.BreakRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.earliestStartTime_ = + earliestStartTimeBuilder_ == null + ? earliestStartTime_ + : earliestStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.latestStartTime_ = + latestStartTimeBuilder_ == null ? latestStartTime_ : latestStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.minDuration_ = + minDurationBuilder_ == null ? minDuration_ : minDurationBuilder_.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.BreakRule.BreakRequest) { + return mergeFrom((com.google.maps.routeoptimization.v1.BreakRule.BreakRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.BreakRule.BreakRequest other) { + if (other + == com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.getDefaultInstance()) + return this; + if (other.hasEarliestStartTime()) { + mergeEarliestStartTime(other.getEarliestStartTime()); + } + if (other.hasLatestStartTime()) { + mergeLatestStartTime(other.getLatestStartTime()); + } + if (other.hasMinDuration()) { + mergeMinDuration(other.getMinDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getEarliestStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getLatestStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getMinDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp earliestStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestStartTimeBuilder_; + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the earliestStartTime field is set. + */ + public boolean hasEarliestStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The earliestStartTime. + */ + public com.google.protobuf.Timestamp getEarliestStartTime() { + if (earliestStartTimeBuilder_ == null) { + return earliestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestStartTime_; + } else { + return earliestStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEarliestStartTime(com.google.protobuf.Timestamp value) { + if (earliestStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestStartTime_ = value; + } else { + earliestStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEarliestStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestStartTimeBuilder_ == null) { + earliestStartTime_ = builderForValue.build(); + } else { + earliestStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEarliestStartTime(com.google.protobuf.Timestamp value) { + if (earliestStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && earliestStartTime_ != null + && earliestStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestStartTimeBuilder().mergeFrom(value); + } else { + earliestStartTime_ = value; + } + } else { + earliestStartTimeBuilder_.mergeFrom(value); + } + if (earliestStartTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEarliestStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + earliestStartTime_ = null; + if (earliestStartTimeBuilder_ != null) { + earliestStartTimeBuilder_.dispose(); + earliestStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getEarliestStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEarliestStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEarliestStartTimeOrBuilder() { + if (earliestStartTimeBuilder_ != null) { + return earliestStartTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestStartTime_; + } + } + /** + * + * + *
+       * Required. Lower bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEarliestStartTimeFieldBuilder() { + if (earliestStartTimeBuilder_ == null) { + earliestStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestStartTime(), getParentForChildren(), isClean()); + earliestStartTime_ = null; + } + return earliestStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp latestStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + latestStartTimeBuilder_; + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the latestStartTime field is set. + */ + public boolean hasLatestStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The latestStartTime. + */ + public com.google.protobuf.Timestamp getLatestStartTime() { + if (latestStartTimeBuilder_ == null) { + return latestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestStartTime_; + } else { + return latestStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLatestStartTime(com.google.protobuf.Timestamp value) { + if (latestStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestStartTime_ = value; + } else { + latestStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLatestStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (latestStartTimeBuilder_ == null) { + latestStartTime_ = builderForValue.build(); + } else { + latestStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeLatestStartTime(com.google.protobuf.Timestamp value) { + if (latestStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && latestStartTime_ != null + && latestStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getLatestStartTimeBuilder().mergeFrom(value); + } else { + latestStartTime_ = value; + } + } else { + latestStartTimeBuilder_.mergeFrom(value); + } + if (latestStartTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearLatestStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + latestStartTime_ = null; + if (latestStartTimeBuilder_ != null) { + latestStartTimeBuilder_.dispose(); + latestStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getLatestStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLatestStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getLatestStartTimeOrBuilder() { + if (latestStartTimeBuilder_ != null) { + return latestStartTimeBuilder_.getMessageOrBuilder(); + } else { + return latestStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestStartTime_; + } + } + /** + * + * + *
+       * Required. Upper bound (inclusive) on the start of the break.
+       * 
+ * + * + * .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getLatestStartTimeFieldBuilder() { + if (latestStartTimeBuilder_ == null) { + latestStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLatestStartTime(), getParentForChildren(), isClean()); + latestStartTime_ = null; + } + return latestStartTimeBuilder_; + } + + private com.google.protobuf.Duration minDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + minDurationBuilder_; + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the minDuration field is set. + */ + public boolean hasMinDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The minDuration. + */ + public com.google.protobuf.Duration getMinDuration() { + if (minDurationBuilder_ == null) { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } else { + return minDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMinDuration(com.google.protobuf.Duration value) { + if (minDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minDuration_ = value; + } else { + minDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMinDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (minDurationBuilder_ == null) { + minDuration_ = builderForValue.build(); + } else { + minDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMinDuration(com.google.protobuf.Duration value) { + if (minDurationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && minDuration_ != null + && minDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getMinDurationBuilder().mergeFrom(value); + } else { + minDuration_ = value; + } + } else { + minDurationBuilder_.mergeFrom(value); + } + if (minDuration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMinDuration() { + bitField0_ = (bitField0_ & ~0x00000004); + minDuration_ = null; + if (minDurationBuilder_ != null) { + minDurationBuilder_.dispose(); + minDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getMinDurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getMinDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.DurationOrBuilder getMinDurationOrBuilder() { + if (minDurationBuilder_ != null) { + return minDurationBuilder_.getMessageOrBuilder(); + } else { + return minDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minDuration_; + } + } + /** + * + * + *
+       * Required. Minimum duration of the break. Must be positive.
+       * 
+ * + * .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMinDurationFieldBuilder() { + if (minDurationBuilder_ == null) { + minDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMinDuration(), getParentForChildren(), isClean()); + minDuration_ = null; + } + return minDurationBuilder_; + } + + @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.BreakRule.BreakRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BreakRule.BreakRequest) + private static final com.google.maps.routeoptimization.v1.BreakRule.BreakRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.BreakRule.BreakRequest(); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.BreakRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BreakRequest 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.BreakRule.BreakRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FrequencyConstraintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Minimum break duration for this constraint. Nonnegative.
+     * See description of `FrequencyConstraint`.
+     * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the minBreakDuration field is set. + */ + boolean hasMinBreakDuration(); + /** + * + * + *
+     * Required. Minimum break duration for this constraint. Nonnegative.
+     * See description of `FrequencyConstraint`.
+     * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The minBreakDuration. + */ + com.google.protobuf.Duration getMinBreakDuration(); + /** + * + * + *
+     * Required. Minimum break duration for this constraint. Nonnegative.
+     * See description of `FrequencyConstraint`.
+     * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getMinBreakDurationOrBuilder(); + + /** + * + * + *
+     * Required. Maximum allowed span of any interval of time in the route that
+     * does not include at least partially a break of `duration >=
+     * min_break_duration`. Must be positive.
+     * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the maxInterBreakDuration field is set. + */ + boolean hasMaxInterBreakDuration(); + /** + * + * + *
+     * Required. Maximum allowed span of any interval of time in the route that
+     * does not include at least partially a break of `duration >=
+     * min_break_duration`. Must be positive.
+     * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The maxInterBreakDuration. + */ + com.google.protobuf.Duration getMaxInterBreakDuration(); + /** + * + * + *
+     * Required. Maximum allowed span of any interval of time in the route that
+     * does not include at least partially a break of `duration >=
+     * min_break_duration`. Must be positive.
+     * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getMaxInterBreakDurationOrBuilder(); + } + /** + * + * + *
+   * One may further constrain the frequency and duration of the breaks
+   * specified above, by enforcing a minimum break frequency, such as
+   * "There must be a break of at least 1 hour every 12 hours". Assuming that
+   * this can be interpreted as "Within any sliding time window of 12h, there
+   * must be at least one break of at least one hour", that example would
+   * translate to the following `FrequencyConstraint`:
+   * ```
+   * {
+   *    min_break_duration { seconds: 3600 }         # 1 hour.
+   *    max_inter_break_duration { seconds: 39600 }  # 11 hours (12 - 1 = 11).
+   * }
+   * ```
+   *
+   * The timing and duration of the breaks in the solution will respect all
+   * such constraints, in addition to the time windows and minimum durations
+   * already specified in the `BreakRequest`.
+   *
+   * A `FrequencyConstraint` may in practice apply to non-consecutive breaks.
+   * For example, the following schedule honors the "1h every 12h" example:
+   * ```
+   *   04:00 vehicle start
+   *    .. performing travel and visits ..
+   *   09:00 1 hour break
+   *   10:00 end of the break
+   *    .. performing travel and visits ..
+   *   12:00 20-min lunch break
+   *   12:20 end of the break
+   *    .. performing travel and visits ..
+   *   21:00 1 hour break
+   *   22:00 end of the break
+   *    .. performing travel and visits ..
+   *   23:59 vehicle end
+   * ```
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} + */ + public static final class FrequencyConstraint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) + FrequencyConstraintOrBuilder { + private static final long serialVersionUID = 0L; + // Use FrequencyConstraint.newBuilder() to construct. + private FrequencyConstraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FrequencyConstraint() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FrequencyConstraint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.class, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder.class); + } + + private int bitField0_; + public static final int MIN_BREAK_DURATION_FIELD_NUMBER = 1; + private com.google.protobuf.Duration minBreakDuration_; + /** + * + * + *
+     * Required. Minimum break duration for this constraint. Nonnegative.
+     * See description of `FrequencyConstraint`.
+     * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the minBreakDuration field is set. + */ + @java.lang.Override + public boolean hasMinBreakDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Minimum break duration for this constraint. Nonnegative.
+     * See description of `FrequencyConstraint`.
+     * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The minBreakDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getMinBreakDuration() { + return minBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minBreakDuration_; + } + /** + * + * + *
+     * Required. Minimum break duration for this constraint. Nonnegative.
+     * See description of `FrequencyConstraint`.
+     * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMinBreakDurationOrBuilder() { + return minBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minBreakDuration_; + } + + public static final int MAX_INTER_BREAK_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration maxInterBreakDuration_; + /** + * + * + *
+     * Required. Maximum allowed span of any interval of time in the route that
+     * does not include at least partially a break of `duration >=
+     * min_break_duration`. Must be positive.
+     * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the maxInterBreakDuration field is set. + */ + @java.lang.Override + public boolean hasMaxInterBreakDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Maximum allowed span of any interval of time in the route that
+     * does not include at least partially a break of `duration >=
+     * min_break_duration`. Must be positive.
+     * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The maxInterBreakDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getMaxInterBreakDuration() { + return maxInterBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxInterBreakDuration_; + } + /** + * + * + *
+     * Required. Maximum allowed span of any interval of time in the route that
+     * does not include at least partially a break of `duration >=
+     * min_break_duration`. Must be positive.
+     * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMaxInterBreakDurationOrBuilder() { + return maxInterBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxInterBreakDuration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMinBreakDuration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getMaxInterBreakDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinBreakDuration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxInterBreakDuration()); + } + 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.BreakRule.FrequencyConstraint)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint other = + (com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) obj; + + if (hasMinBreakDuration() != other.hasMinBreakDuration()) return false; + if (hasMinBreakDuration()) { + if (!getMinBreakDuration().equals(other.getMinBreakDuration())) return false; + } + if (hasMaxInterBreakDuration() != other.hasMaxInterBreakDuration()) return false; + if (hasMaxInterBreakDuration()) { + if (!getMaxInterBreakDuration().equals(other.getMaxInterBreakDuration())) 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 (hasMinBreakDuration()) { + hash = (37 * hash) + MIN_BREAK_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMinBreakDuration().hashCode(); + } + if (hasMaxInterBreakDuration()) { + hash = (37 * hash) + MAX_INTER_BREAK_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMaxInterBreakDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint 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.BreakRule.FrequencyConstraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint 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.BreakRule.FrequencyConstraint parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint 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.BreakRule.FrequencyConstraint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint 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.BreakRule.FrequencyConstraint + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + 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.BreakRule.FrequencyConstraint 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.BreakRule.FrequencyConstraint 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.BreakRule.FrequencyConstraint 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; + } + /** + * + * + *
+     * One may further constrain the frequency and duration of the breaks
+     * specified above, by enforcing a minimum break frequency, such as
+     * "There must be a break of at least 1 hour every 12 hours". Assuming that
+     * this can be interpreted as "Within any sliding time window of 12h, there
+     * must be at least one break of at least one hour", that example would
+     * translate to the following `FrequencyConstraint`:
+     * ```
+     * {
+     *    min_break_duration { seconds: 3600 }         # 1 hour.
+     *    max_inter_break_duration { seconds: 39600 }  # 11 hours (12 - 1 = 11).
+     * }
+     * ```
+     *
+     * The timing and duration of the breaks in the solution will respect all
+     * such constraints, in addition to the time windows and minimum durations
+     * already specified in the `BreakRequest`.
+     *
+     * A `FrequencyConstraint` may in practice apply to non-consecutive breaks.
+     * For example, the following schedule honors the "1h every 12h" example:
+     * ```
+     *   04:00 vehicle start
+     *    .. performing travel and visits ..
+     *   09:00 1 hour break
+     *   10:00 end of the break
+     *    .. performing travel and visits ..
+     *   12:00 20-min lunch break
+     *   12:20 end of the break
+     *    .. performing travel and visits ..
+     *   21:00 1 hour break
+     *   22:00 end of the break
+     *    .. performing travel and visits ..
+     *   23:59 vehicle end
+     * ```
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.class, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMinBreakDurationFieldBuilder(); + getMaxInterBreakDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minBreakDuration_ = null; + if (minBreakDurationBuilder_ != null) { + minBreakDurationBuilder_.dispose(); + minBreakDurationBuilder_ = null; + } + maxInterBreakDuration_ = null; + if (maxInterBreakDurationBuilder_ != null) { + maxInterBreakDurationBuilder_.dispose(); + maxInterBreakDurationBuilder_ = 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_BreakRule_FrequencyConstraint_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint build() { + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint buildPartial() { + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint result = + new com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minBreakDuration_ = + minBreakDurationBuilder_ == null + ? minBreakDuration_ + : minBreakDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxInterBreakDuration_ = + maxInterBreakDurationBuilder_ == null + ? maxInterBreakDuration_ + : maxInterBreakDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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.BreakRule.FrequencyConstraint) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint other) { + if (other + == com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + .getDefaultInstance()) return this; + if (other.hasMinBreakDuration()) { + mergeMinBreakDuration(other.getMinBreakDuration()); + } + if (other.hasMaxInterBreakDuration()) { + mergeMaxInterBreakDuration(other.getMaxInterBreakDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getMinBreakDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getMaxInterBreakDurationFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.protobuf.Duration minBreakDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + minBreakDurationBuilder_; + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the minBreakDuration field is set. + */ + public boolean hasMinBreakDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The minBreakDuration. + */ + public com.google.protobuf.Duration getMinBreakDuration() { + if (minBreakDurationBuilder_ == null) { + return minBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minBreakDuration_; + } else { + return minBreakDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMinBreakDuration(com.google.protobuf.Duration value) { + if (minBreakDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minBreakDuration_ = value; + } else { + minBreakDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMinBreakDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (minBreakDurationBuilder_ == null) { + minBreakDuration_ = builderForValue.build(); + } else { + minBreakDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMinBreakDuration(com.google.protobuf.Duration value) { + if (minBreakDurationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && minBreakDuration_ != null + && minBreakDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getMinBreakDurationBuilder().mergeFrom(value); + } else { + minBreakDuration_ = value; + } + } else { + minBreakDurationBuilder_.mergeFrom(value); + } + if (minBreakDuration_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMinBreakDuration() { + bitField0_ = (bitField0_ & ~0x00000001); + minBreakDuration_ = null; + if (minBreakDurationBuilder_ != null) { + minBreakDurationBuilder_.dispose(); + minBreakDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getMinBreakDurationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMinBreakDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.DurationOrBuilder getMinBreakDurationOrBuilder() { + if (minBreakDurationBuilder_ != null) { + return minBreakDurationBuilder_.getMessageOrBuilder(); + } else { + return minBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minBreakDuration_; + } + } + /** + * + * + *
+       * Required. Minimum break duration for this constraint. Nonnegative.
+       * See description of `FrequencyConstraint`.
+       * 
+ * + * + * .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMinBreakDurationFieldBuilder() { + if (minBreakDurationBuilder_ == null) { + minBreakDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMinBreakDuration(), getParentForChildren(), isClean()); + minBreakDuration_ = null; + } + return minBreakDurationBuilder_; + } + + private com.google.protobuf.Duration maxInterBreakDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + maxInterBreakDurationBuilder_; + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the maxInterBreakDuration field is set. + */ + public boolean hasMaxInterBreakDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The maxInterBreakDuration. + */ + public com.google.protobuf.Duration getMaxInterBreakDuration() { + if (maxInterBreakDurationBuilder_ == null) { + return maxInterBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxInterBreakDuration_; + } else { + return maxInterBreakDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaxInterBreakDuration(com.google.protobuf.Duration value) { + if (maxInterBreakDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxInterBreakDuration_ = value; + } else { + maxInterBreakDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaxInterBreakDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (maxInterBreakDurationBuilder_ == null) { + maxInterBreakDuration_ = builderForValue.build(); + } else { + maxInterBreakDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMaxInterBreakDuration(com.google.protobuf.Duration value) { + if (maxInterBreakDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && maxInterBreakDuration_ != null + && maxInterBreakDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getMaxInterBreakDurationBuilder().mergeFrom(value); + } else { + maxInterBreakDuration_ = value; + } + } else { + maxInterBreakDurationBuilder_.mergeFrom(value); + } + if (maxInterBreakDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMaxInterBreakDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + maxInterBreakDuration_ = null; + if (maxInterBreakDurationBuilder_ != null) { + maxInterBreakDurationBuilder_.dispose(); + maxInterBreakDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getMaxInterBreakDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMaxInterBreakDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.DurationOrBuilder getMaxInterBreakDurationOrBuilder() { + if (maxInterBreakDurationBuilder_ != null) { + return maxInterBreakDurationBuilder_.getMessageOrBuilder(); + } else { + return maxInterBreakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxInterBreakDuration_; + } + } + /** + * + * + *
+       * Required. Maximum allowed span of any interval of time in the route that
+       * does not include at least partially a break of `duration >=
+       * min_break_duration`. Must be positive.
+       * 
+ * + * + * .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMaxInterBreakDurationFieldBuilder() { + if (maxInterBreakDurationBuilder_ == null) { + maxInterBreakDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMaxInterBreakDuration(), getParentForChildren(), isClean()); + maxInterBreakDuration_ = null; + } + return maxInterBreakDurationBuilder_; + } + + @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.BreakRule.FrequencyConstraint) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) + private static final com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint(); + } + + public static com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FrequencyConstraint 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.BreakRule.FrequencyConstraint + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int BREAK_REQUESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + breakRequests_; + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + @java.lang.Override + public java.util.List + getBreakRequestsList() { + return breakRequests_; + } + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder> + getBreakRequestsOrBuilderList() { + return breakRequests_; + } + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + @java.lang.Override + public int getBreakRequestsCount() { + return breakRequests_.size(); + } + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest getBreakRequests(int index) { + return breakRequests_.get(index); + } + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder + getBreakRequestsOrBuilder(int index) { + return breakRequests_.get(index); + } + + public static final int FREQUENCY_CONSTRAINTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + frequencyConstraints_; + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + @java.lang.Override + public java.util.List + getFrequencyConstraintsList() { + return frequencyConstraints_; + } + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder> + getFrequencyConstraintsOrBuilderList() { + return frequencyConstraints_; + } + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + @java.lang.Override + public int getFrequencyConstraintsCount() { + return frequencyConstraints_.size(); + } + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint getFrequencyConstraints( + int index) { + return frequencyConstraints_.get(index); + } + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder + getFrequencyConstraintsOrBuilder(int index) { + return frequencyConstraints_.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 < breakRequests_.size(); i++) { + output.writeMessage(1, breakRequests_.get(i)); + } + for (int i = 0; i < frequencyConstraints_.size(); i++) { + output.writeMessage(2, frequencyConstraints_.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 < breakRequests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, breakRequests_.get(i)); + } + for (int i = 0; i < frequencyConstraints_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, frequencyConstraints_.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.BreakRule)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.BreakRule other = + (com.google.maps.routeoptimization.v1.BreakRule) obj; + + if (!getBreakRequestsList().equals(other.getBreakRequestsList())) return false; + if (!getFrequencyConstraintsList().equals(other.getFrequencyConstraintsList())) 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 (getBreakRequestsCount() > 0) { + hash = (37 * hash) + BREAK_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getBreakRequestsList().hashCode(); + } + if (getFrequencyConstraintsCount() > 0) { + hash = (37 * hash) + FREQUENCY_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getFrequencyConstraintsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.BreakRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule 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.BreakRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule 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.BreakRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.BreakRule 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.BreakRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BreakRule 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.BreakRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.BreakRule 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.BreakRule 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.BreakRule 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.BreakRule 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; + } + /** + * + * + *
+   * Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break
+   * is a contiguous period of time during which the vehicle remains idle at its
+   * current position and cannot perform any visit. A break may occur:
+   *
+   * * during the travel between two visits (which includes the time right
+   *   before or right after a visit, but not in the middle of a visit), in
+   *   which case it extends the corresponding transit time between the visits,
+   * * or before the vehicle start (the vehicle may not start in the middle of
+   *   a break), in which case it does not affect the vehicle start time.
+   * * or after the vehicle end (ditto, with the vehicle end time).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.BreakRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.BreakRule) + com.google.maps.routeoptimization.v1.BreakRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_BreakRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.BreakRule.class, + com.google.maps.routeoptimization.v1.BreakRule.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.BreakRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (breakRequestsBuilder_ == null) { + breakRequests_ = java.util.Collections.emptyList(); + } else { + breakRequests_ = null; + breakRequestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (frequencyConstraintsBuilder_ == null) { + frequencyConstraints_ = java.util.Collections.emptyList(); + } else { + frequencyConstraints_ = null; + frequencyConstraintsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + 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_BreakRule_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule build() { + com.google.maps.routeoptimization.v1.BreakRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule buildPartial() { + com.google.maps.routeoptimization.v1.BreakRule result = + new com.google.maps.routeoptimization.v1.BreakRule(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.maps.routeoptimization.v1.BreakRule result) { + if (breakRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + breakRequests_ = java.util.Collections.unmodifiableList(breakRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.breakRequests_ = breakRequests_; + } else { + result.breakRequests_ = breakRequestsBuilder_.build(); + } + if (frequencyConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + frequencyConstraints_ = java.util.Collections.unmodifiableList(frequencyConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.frequencyConstraints_ = frequencyConstraints_; + } else { + result.frequencyConstraints_ = frequencyConstraintsBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.BreakRule result) { + int from_bitField0_ = 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.BreakRule) { + return mergeFrom((com.google.maps.routeoptimization.v1.BreakRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.BreakRule other) { + if (other == com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance()) return this; + if (breakRequestsBuilder_ == null) { + if (!other.breakRequests_.isEmpty()) { + if (breakRequests_.isEmpty()) { + breakRequests_ = other.breakRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBreakRequestsIsMutable(); + breakRequests_.addAll(other.breakRequests_); + } + onChanged(); + } + } else { + if (!other.breakRequests_.isEmpty()) { + if (breakRequestsBuilder_.isEmpty()) { + breakRequestsBuilder_.dispose(); + breakRequestsBuilder_ = null; + breakRequests_ = other.breakRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + breakRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBreakRequestsFieldBuilder() + : null; + } else { + breakRequestsBuilder_.addAllMessages(other.breakRequests_); + } + } + } + if (frequencyConstraintsBuilder_ == null) { + if (!other.frequencyConstraints_.isEmpty()) { + if (frequencyConstraints_.isEmpty()) { + frequencyConstraints_ = other.frequencyConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.addAll(other.frequencyConstraints_); + } + onChanged(); + } + } else { + if (!other.frequencyConstraints_.isEmpty()) { + if (frequencyConstraintsBuilder_.isEmpty()) { + frequencyConstraintsBuilder_.dispose(); + frequencyConstraintsBuilder_ = null; + frequencyConstraints_ = other.frequencyConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + frequencyConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFrequencyConstraintsFieldBuilder() + : null; + } else { + frequencyConstraintsBuilder_.addAllMessages(other.frequencyConstraints_); + } + } + } + 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.BreakRule.BreakRequest m = + input.readMessage( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.parser(), + extensionRegistry); + if (breakRequestsBuilder_ == null) { + ensureBreakRequestsIsMutable(); + breakRequests_.add(m); + } else { + breakRequestsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint m = + input.readMessage( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.parser(), + extensionRegistry); + if (frequencyConstraintsBuilder_ == null) { + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.add(m); + } else { + frequencyConstraintsBuilder_.addMessage(m); + } + 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 + breakRequests_ = java.util.Collections.emptyList(); + + private void ensureBreakRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + breakRequests_ = + new java.util.ArrayList( + breakRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder> + breakRequestsBuilder_; + + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public java.util.List + getBreakRequestsList() { + if (breakRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(breakRequests_); + } else { + return breakRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public int getBreakRequestsCount() { + if (breakRequestsBuilder_ == null) { + return breakRequests_.size(); + } else { + return breakRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest getBreakRequests(int index) { + if (breakRequestsBuilder_ == null) { + return breakRequests_.get(index); + } else { + return breakRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder setBreakRequests( + int index, com.google.maps.routeoptimization.v1.BreakRule.BreakRequest value) { + if (breakRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBreakRequestsIsMutable(); + breakRequests_.set(index, value); + onChanged(); + } else { + breakRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder setBreakRequests( + int index, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder builderForValue) { + if (breakRequestsBuilder_ == null) { + ensureBreakRequestsIsMutable(); + breakRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + breakRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder addBreakRequests( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest value) { + if (breakRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBreakRequestsIsMutable(); + breakRequests_.add(value); + onChanged(); + } else { + breakRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder addBreakRequests( + int index, com.google.maps.routeoptimization.v1.BreakRule.BreakRequest value) { + if (breakRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBreakRequestsIsMutable(); + breakRequests_.add(index, value); + onChanged(); + } else { + breakRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder addBreakRequests( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder builderForValue) { + if (breakRequestsBuilder_ == null) { + ensureBreakRequestsIsMutable(); + breakRequests_.add(builderForValue.build()); + onChanged(); + } else { + breakRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder addBreakRequests( + int index, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder builderForValue) { + if (breakRequestsBuilder_ == null) { + ensureBreakRequestsIsMutable(); + breakRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + breakRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder addAllBreakRequests( + java.lang.Iterable + values) { + if (breakRequestsBuilder_ == null) { + ensureBreakRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, breakRequests_); + onChanged(); + } else { + breakRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder clearBreakRequests() { + if (breakRequestsBuilder_ == null) { + breakRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + breakRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public Builder removeBreakRequests(int index) { + if (breakRequestsBuilder_ == null) { + ensureBreakRequestsIsMutable(); + breakRequests_.remove(index); + onChanged(); + } else { + breakRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder + getBreakRequestsBuilder(int index) { + return getBreakRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder + getBreakRequestsOrBuilder(int index) { + if (breakRequestsBuilder_ == null) { + return breakRequests_.get(index); + } else { + return breakRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder> + getBreakRequestsOrBuilderList() { + if (breakRequestsBuilder_ != null) { + return breakRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(breakRequests_); + } + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder + addBreakRequestsBuilder() { + return getBreakRequestsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder + addBreakRequestsBuilder(int index) { + return getBreakRequestsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Sequence of breaks. See the `BreakRequest` message.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + public java.util.List + getBreakRequestsBuilderList() { + return getBreakRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder> + getBreakRequestsFieldBuilder() { + if (breakRequestsBuilder_ == null) { + breakRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest.Builder, + com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder>( + breakRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + breakRequests_ = null; + } + return breakRequestsBuilder_; + } + + private java.util.List + frequencyConstraints_ = java.util.Collections.emptyList(); + + private void ensureFrequencyConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + frequencyConstraints_ = + new java.util.ArrayList< + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint>( + frequencyConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder> + frequencyConstraintsBuilder_; + + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public java.util.List + getFrequencyConstraintsList() { + if (frequencyConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(frequencyConstraints_); + } else { + return frequencyConstraintsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public int getFrequencyConstraintsCount() { + if (frequencyConstraintsBuilder_ == null) { + return frequencyConstraints_.size(); + } else { + return frequencyConstraintsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + getFrequencyConstraints(int index) { + if (frequencyConstraintsBuilder_ == null) { + return frequencyConstraints_.get(index); + } else { + return frequencyConstraintsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder setFrequencyConstraints( + int index, com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint value) { + if (frequencyConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.set(index, value); + onChanged(); + } else { + frequencyConstraintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder setFrequencyConstraints( + int index, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder + builderForValue) { + if (frequencyConstraintsBuilder_ == null) { + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.set(index, builderForValue.build()); + onChanged(); + } else { + frequencyConstraintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder addFrequencyConstraints( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint value) { + if (frequencyConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.add(value); + onChanged(); + } else { + frequencyConstraintsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder addFrequencyConstraints( + int index, com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint value) { + if (frequencyConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.add(index, value); + onChanged(); + } else { + frequencyConstraintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder addFrequencyConstraints( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder + builderForValue) { + if (frequencyConstraintsBuilder_ == null) { + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.add(builderForValue.build()); + onChanged(); + } else { + frequencyConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder addFrequencyConstraints( + int index, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder + builderForValue) { + if (frequencyConstraintsBuilder_ == null) { + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.add(index, builderForValue.build()); + onChanged(); + } else { + frequencyConstraintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder addAllFrequencyConstraints( + java.lang.Iterable< + ? extends com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint> + values) { + if (frequencyConstraintsBuilder_ == null) { + ensureFrequencyConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, frequencyConstraints_); + onChanged(); + } else { + frequencyConstraintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder clearFrequencyConstraints() { + if (frequencyConstraintsBuilder_ == null) { + frequencyConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + frequencyConstraintsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public Builder removeFrequencyConstraints(int index) { + if (frequencyConstraintsBuilder_ == null) { + ensureFrequencyConstraintsIsMutable(); + frequencyConstraints_.remove(index); + onChanged(); + } else { + frequencyConstraintsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder + getFrequencyConstraintsBuilder(int index) { + return getFrequencyConstraintsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder + getFrequencyConstraintsOrBuilder(int index) { + if (frequencyConstraintsBuilder_ == null) { + return frequencyConstraints_.get(index); + } else { + return frequencyConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder> + getFrequencyConstraintsOrBuilderList() { + if (frequencyConstraintsBuilder_ != null) { + return frequencyConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(frequencyConstraints_); + } + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder + addFrequencyConstraintsBuilder() { + return getFrequencyConstraintsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + .getDefaultInstance()); + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder + addFrequencyConstraintsBuilder(int index) { + return getFrequencyConstraintsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + .getDefaultInstance()); + } + /** + * + * + *
+     * Several `FrequencyConstraint` may apply. They must all be satisfied by
+     * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder> + getFrequencyConstraintsBuilderList() { + return getFrequencyConstraintsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder> + getFrequencyConstraintsFieldBuilder() { + if (frequencyConstraintsBuilder_ == null) { + frequencyConstraintsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.Builder, + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder>( + frequencyConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + frequencyConstraints_ = null; + } + return frequencyConstraintsBuilder_; + } + + @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.BreakRule) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.BreakRule) + private static final com.google.maps.routeoptimization.v1.BreakRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.BreakRule(); + } + + public static com.google.maps.routeoptimization.v1.BreakRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BreakRule 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.BreakRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BreakRuleOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BreakRuleOrBuilder.java new file mode 100644 index 000000000000..10e0a97c33fb --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/BreakRuleOrBuilder.java @@ -0,0 +1,156 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface BreakRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.BreakRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + java.util.List + getBreakRequestsList(); + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + com.google.maps.routeoptimization.v1.BreakRule.BreakRequest getBreakRequests(int index); + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + int getBreakRequestsCount(); + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + java.util.List + getBreakRequestsOrBuilderList(); + /** + * + * + *
+   * Sequence of breaks. See the `BreakRequest` message.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * + */ + com.google.maps.routeoptimization.v1.BreakRule.BreakRequestOrBuilder getBreakRequestsOrBuilder( + int index); + + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + java.util.List + getFrequencyConstraintsList(); + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint getFrequencyConstraints( + int index); + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + int getFrequencyConstraintsCount(); + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + java.util.List< + ? extends com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder> + getFrequencyConstraintsOrBuilderList(); + /** + * + * + *
+   * Several `FrequencyConstraint` may apply. They must all be satisfied by
+   * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * + */ + com.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraintOrBuilder + getFrequencyConstraintsOrBuilder(int index); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DataFormat.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DataFormat.java new file mode 100644 index 000000000000..e30ccc7dd294 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DataFormat.java @@ -0,0 +1,181 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Data formats for input and output files.
+ * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.DataFormat} + */ +public enum DataFormat implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Invalid value, format must not be UNSPECIFIED.
+   * 
+ * + * DATA_FORMAT_UNSPECIFIED = 0; + */ + DATA_FORMAT_UNSPECIFIED(0), + /** + * + * + *
+   * JavaScript Object Notation.
+   * 
+ * + * JSON = 1; + */ + JSON(1), + /** + * + * + *
+   * Protocol Buffers text format.  See
+   * https://protobuf.dev/reference/protobuf/textformat-spec/
+   * 
+ * + * PROTO_TEXT = 2; + */ + PROTO_TEXT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Invalid value, format must not be UNSPECIFIED.
+   * 
+ * + * DATA_FORMAT_UNSPECIFIED = 0; + */ + public static final int DATA_FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * JavaScript Object Notation.
+   * 
+ * + * JSON = 1; + */ + public static final int JSON_VALUE = 1; + /** + * + * + *
+   * Protocol Buffers text format.  See
+   * https://protobuf.dev/reference/protobuf/textformat-spec/
+   * 
+ * + * PROTO_TEXT = 2; + */ + public static final int PROTO_TEXT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataFormat valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DataFormat forNumber(int value) { + switch (value) { + case 0: + return DATA_FORMAT_UNSPECIFIED; + case 1: + return JSON; + case 2: + return PROTO_TEXT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataFormat findValueByNumber(int number) { + return DataFormat.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DataFormat[] VALUES = values(); + + public static DataFormat valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DataFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.DataFormat) +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DistanceLimit.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DistanceLimit.java new file mode 100644 index 000000000000..22063d15e719 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DistanceLimit.java @@ -0,0 +1,924 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * A limit defining a maximum distance which can be traveled. It can be either
+ * hard or soft.
+ *
+ * If a soft limit is defined, both `soft_max_meters` and
+ * `cost_per_kilometer_above_soft_max` must be defined and be nonnegative.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.DistanceLimit} + */ +public final class DistanceLimit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.DistanceLimit) + DistanceLimitOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistanceLimit.newBuilder() to construct. + private DistanceLimit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DistanceLimit() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DistanceLimit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_DistanceLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_DistanceLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.DistanceLimit.class, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder.class); + } + + private int bitField0_; + public static final int MAX_METERS_FIELD_NUMBER = 1; + private long maxMeters_ = 0L; + /** + * + * + *
+   * A hard limit constraining the distance to be at most max_meters. The limit
+   * must be nonnegative.
+   * 
+ * + * optional int64 max_meters = 1; + * + * @return Whether the maxMeters field is set. + */ + @java.lang.Override + public boolean hasMaxMeters() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * A hard limit constraining the distance to be at most max_meters. The limit
+   * must be nonnegative.
+   * 
+ * + * optional int64 max_meters = 1; + * + * @return The maxMeters. + */ + @java.lang.Override + public long getMaxMeters() { + return maxMeters_; + } + + public static final int SOFT_MAX_METERS_FIELD_NUMBER = 2; + private long softMaxMeters_ = 0L; + /** + * + * + *
+   * A soft limit not enforcing a maximum distance limit, but when violated
+   * results in a cost which adds up to other costs defined in the model,
+   * with the same unit.
+   *
+   * If defined soft_max_meters must be less than max_meters and must be
+   * nonnegative.
+   * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return Whether the softMaxMeters field is set. + */ + @java.lang.Override + public boolean hasSoftMaxMeters() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * A soft limit not enforcing a maximum distance limit, but when violated
+   * results in a cost which adds up to other costs defined in the model,
+   * with the same unit.
+   *
+   * If defined soft_max_meters must be less than max_meters and must be
+   * nonnegative.
+   * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return The softMaxMeters. + */ + @java.lang.Override + public long getSoftMaxMeters() { + return softMaxMeters_; + } + + public static final int COST_PER_KILOMETER_ABOVE_SOFT_MAX_FIELD_NUMBER = 3; + private double costPerKilometerAboveSoftMax_ = 0D; + /** + * + * + *
+   * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+   * The additional cost is 0 if the distance is under the limit, otherwise the
+   * formula used to compute the cost is the following:
+   * ```
+   *   (distance_meters - soft_max_meters) / 1000.0 *
+   *   cost_per_kilometer_above_soft_max.
+   * ```
+   * The cost must be nonnegative.
+   * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return Whether the costPerKilometerAboveSoftMax field is set. + */ + @java.lang.Override + public boolean hasCostPerKilometerAboveSoftMax() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+   * The additional cost is 0 if the distance is under the limit, otherwise the
+   * formula used to compute the cost is the following:
+   * ```
+   *   (distance_meters - soft_max_meters) / 1000.0 *
+   *   cost_per_kilometer_above_soft_max.
+   * ```
+   * The cost must be nonnegative.
+   * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return The costPerKilometerAboveSoftMax. + */ + @java.lang.Override + public double getCostPerKilometerAboveSoftMax() { + return costPerKilometerAboveSoftMax_; + } + + 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.writeInt64(1, maxMeters_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(2, softMaxMeters_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(3, costPerKilometerAboveSoftMax_); + } + 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.computeInt64Size(1, maxMeters_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, softMaxMeters_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize(3, costPerKilometerAboveSoftMax_); + } + 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.DistanceLimit)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.DistanceLimit other = + (com.google.maps.routeoptimization.v1.DistanceLimit) obj; + + if (hasMaxMeters() != other.hasMaxMeters()) return false; + if (hasMaxMeters()) { + if (getMaxMeters() != other.getMaxMeters()) return false; + } + if (hasSoftMaxMeters() != other.hasSoftMaxMeters()) return false; + if (hasSoftMaxMeters()) { + if (getSoftMaxMeters() != other.getSoftMaxMeters()) return false; + } + if (hasCostPerKilometerAboveSoftMax() != other.hasCostPerKilometerAboveSoftMax()) return false; + if (hasCostPerKilometerAboveSoftMax()) { + if (java.lang.Double.doubleToLongBits(getCostPerKilometerAboveSoftMax()) + != java.lang.Double.doubleToLongBits(other.getCostPerKilometerAboveSoftMax())) + 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 (hasMaxMeters()) { + hash = (37 * hash) + MAX_METERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxMeters()); + } + if (hasSoftMaxMeters()) { + hash = (37 * hash) + SOFT_MAX_METERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSoftMaxMeters()); + } + if (hasCostPerKilometerAboveSoftMax()) { + hash = (37 * hash) + COST_PER_KILOMETER_ABOVE_SOFT_MAX_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerKilometerAboveSoftMax())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit 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.DistanceLimit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit 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.DistanceLimit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit 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.DistanceLimit parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit 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.DistanceLimit parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit 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.DistanceLimit 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.DistanceLimit 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.DistanceLimit 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 limit defining a maximum distance which can be traveled. It can be either
+   * hard or soft.
+   *
+   * If a soft limit is defined, both `soft_max_meters` and
+   * `cost_per_kilometer_above_soft_max` must be defined and be nonnegative.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.DistanceLimit} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.DistanceLimit) + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_DistanceLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_DistanceLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.DistanceLimit.class, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.DistanceLimit.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxMeters_ = 0L; + softMaxMeters_ = 0L; + costPerKilometerAboveSoftMax_ = 0D; + 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_DistanceLimit_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimit getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimit build() { + com.google.maps.routeoptimization.v1.DistanceLimit result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimit buildPartial() { + com.google.maps.routeoptimization.v1.DistanceLimit result = + new com.google.maps.routeoptimization.v1.DistanceLimit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.DistanceLimit result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxMeters_ = maxMeters_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.softMaxMeters_ = softMaxMeters_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.costPerKilometerAboveSoftMax_ = costPerKilometerAboveSoftMax_; + 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.DistanceLimit) { + return mergeFrom((com.google.maps.routeoptimization.v1.DistanceLimit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.DistanceLimit other) { + if (other == com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance()) + return this; + if (other.hasMaxMeters()) { + setMaxMeters(other.getMaxMeters()); + } + if (other.hasSoftMaxMeters()) { + setSoftMaxMeters(other.getSoftMaxMeters()); + } + if (other.hasCostPerKilometerAboveSoftMax()) { + setCostPerKilometerAboveSoftMax(other.getCostPerKilometerAboveSoftMax()); + } + 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: + { + maxMeters_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + softMaxMeters_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 25: + { + costPerKilometerAboveSoftMax_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long maxMeters_; + /** + * + * + *
+     * A hard limit constraining the distance to be at most max_meters. The limit
+     * must be nonnegative.
+     * 
+ * + * optional int64 max_meters = 1; + * + * @return Whether the maxMeters field is set. + */ + @java.lang.Override + public boolean hasMaxMeters() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * A hard limit constraining the distance to be at most max_meters. The limit
+     * must be nonnegative.
+     * 
+ * + * optional int64 max_meters = 1; + * + * @return The maxMeters. + */ + @java.lang.Override + public long getMaxMeters() { + return maxMeters_; + } + /** + * + * + *
+     * A hard limit constraining the distance to be at most max_meters. The limit
+     * must be nonnegative.
+     * 
+ * + * optional int64 max_meters = 1; + * + * @param value The maxMeters to set. + * @return This builder for chaining. + */ + public Builder setMaxMeters(long value) { + + maxMeters_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A hard limit constraining the distance to be at most max_meters. The limit
+     * must be nonnegative.
+     * 
+ * + * optional int64 max_meters = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaxMeters() { + bitField0_ = (bitField0_ & ~0x00000001); + maxMeters_ = 0L; + onChanged(); + return this; + } + + private long softMaxMeters_; + /** + * + * + *
+     * A soft limit not enforcing a maximum distance limit, but when violated
+     * results in a cost which adds up to other costs defined in the model,
+     * with the same unit.
+     *
+     * If defined soft_max_meters must be less than max_meters and must be
+     * nonnegative.
+     * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return Whether the softMaxMeters field is set. + */ + @java.lang.Override + public boolean hasSoftMaxMeters() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * A soft limit not enforcing a maximum distance limit, but when violated
+     * results in a cost which adds up to other costs defined in the model,
+     * with the same unit.
+     *
+     * If defined soft_max_meters must be less than max_meters and must be
+     * nonnegative.
+     * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return The softMaxMeters. + */ + @java.lang.Override + public long getSoftMaxMeters() { + return softMaxMeters_; + } + /** + * + * + *
+     * A soft limit not enforcing a maximum distance limit, but when violated
+     * results in a cost which adds up to other costs defined in the model,
+     * with the same unit.
+     *
+     * If defined soft_max_meters must be less than max_meters and must be
+     * nonnegative.
+     * 
+ * + * optional int64 soft_max_meters = 2; + * + * @param value The softMaxMeters to set. + * @return This builder for chaining. + */ + public Builder setSoftMaxMeters(long value) { + + softMaxMeters_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A soft limit not enforcing a maximum distance limit, but when violated
+     * results in a cost which adds up to other costs defined in the model,
+     * with the same unit.
+     *
+     * If defined soft_max_meters must be less than max_meters and must be
+     * nonnegative.
+     * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return This builder for chaining. + */ + public Builder clearSoftMaxMeters() { + bitField0_ = (bitField0_ & ~0x00000002); + softMaxMeters_ = 0L; + onChanged(); + return this; + } + + private double costPerKilometerAboveSoftMax_; + /** + * + * + *
+     * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+     * The additional cost is 0 if the distance is under the limit, otherwise the
+     * formula used to compute the cost is the following:
+     * ```
+     *   (distance_meters - soft_max_meters) / 1000.0 *
+     *   cost_per_kilometer_above_soft_max.
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return Whether the costPerKilometerAboveSoftMax field is set. + */ + @java.lang.Override + public boolean hasCostPerKilometerAboveSoftMax() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+     * The additional cost is 0 if the distance is under the limit, otherwise the
+     * formula used to compute the cost is the following:
+     * ```
+     *   (distance_meters - soft_max_meters) / 1000.0 *
+     *   cost_per_kilometer_above_soft_max.
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return The costPerKilometerAboveSoftMax. + */ + @java.lang.Override + public double getCostPerKilometerAboveSoftMax() { + return costPerKilometerAboveSoftMax_; + } + /** + * + * + *
+     * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+     * The additional cost is 0 if the distance is under the limit, otherwise the
+     * formula used to compute the cost is the following:
+     * ```
+     *   (distance_meters - soft_max_meters) / 1000.0 *
+     *   cost_per_kilometer_above_soft_max.
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @param value The costPerKilometerAboveSoftMax to set. + * @return This builder for chaining. + */ + public Builder setCostPerKilometerAboveSoftMax(double value) { + + costPerKilometerAboveSoftMax_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+     * The additional cost is 0 if the distance is under the limit, otherwise the
+     * formula used to compute the cost is the following:
+     * ```
+     *   (distance_meters - soft_max_meters) / 1000.0 *
+     *   cost_per_kilometer_above_soft_max.
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return This builder for chaining. + */ + public Builder clearCostPerKilometerAboveSoftMax() { + bitField0_ = (bitField0_ & ~0x00000004); + costPerKilometerAboveSoftMax_ = 0D; + 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.DistanceLimit) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.DistanceLimit) + private static final com.google.maps.routeoptimization.v1.DistanceLimit DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.DistanceLimit(); + } + + public static com.google.maps.routeoptimization.v1.DistanceLimit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistanceLimit 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.DistanceLimit getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DistanceLimitOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DistanceLimitOrBuilder.java new file mode 100644 index 000000000000..edf023761c47 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/DistanceLimitOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface DistanceLimitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.DistanceLimit) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A hard limit constraining the distance to be at most max_meters. The limit
+   * must be nonnegative.
+   * 
+ * + * optional int64 max_meters = 1; + * + * @return Whether the maxMeters field is set. + */ + boolean hasMaxMeters(); + /** + * + * + *
+   * A hard limit constraining the distance to be at most max_meters. The limit
+   * must be nonnegative.
+   * 
+ * + * optional int64 max_meters = 1; + * + * @return The maxMeters. + */ + long getMaxMeters(); + + /** + * + * + *
+   * A soft limit not enforcing a maximum distance limit, but when violated
+   * results in a cost which adds up to other costs defined in the model,
+   * with the same unit.
+   *
+   * If defined soft_max_meters must be less than max_meters and must be
+   * nonnegative.
+   * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return Whether the softMaxMeters field is set. + */ + boolean hasSoftMaxMeters(); + /** + * + * + *
+   * A soft limit not enforcing a maximum distance limit, but when violated
+   * results in a cost which adds up to other costs defined in the model,
+   * with the same unit.
+   *
+   * If defined soft_max_meters must be less than max_meters and must be
+   * nonnegative.
+   * 
+ * + * optional int64 soft_max_meters = 2; + * + * @return The softMaxMeters. + */ + long getSoftMaxMeters(); + + /** + * + * + *
+   * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+   * The additional cost is 0 if the distance is under the limit, otherwise the
+   * formula used to compute the cost is the following:
+   * ```
+   *   (distance_meters - soft_max_meters) / 1000.0 *
+   *   cost_per_kilometer_above_soft_max.
+   * ```
+   * The cost must be nonnegative.
+   * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return Whether the costPerKilometerAboveSoftMax field is set. + */ + boolean hasCostPerKilometerAboveSoftMax(); + /** + * + * + *
+   * Cost per kilometer incurred if distance is above `soft_max_meters` limit.
+   * The additional cost is 0 if the distance is under the limit, otherwise the
+   * formula used to compute the cost is the following:
+   * ```
+   *   (distance_meters - soft_max_meters) / 1000.0 *
+   *   cost_per_kilometer_above_soft_max.
+   * ```
+   * The cost must be nonnegative.
+   * 
+ * + * optional double cost_per_kilometer_above_soft_max = 3; + * + * @return The costPerKilometerAboveSoftMax. + */ + double getCostPerKilometerAboveSoftMax(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsDestination.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsDestination.java new file mode 100644 index 000000000000..d6fee8e1035e --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsDestination.java @@ -0,0 +1,627 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * The Google Cloud Storage location where the output file(s) will be written
+ * to.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.GcsDestination} + */ +public final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.GcsDestination) + GcsDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsDestination() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.GcsDestination.class, + com.google.maps.routeoptimization.v1.GcsDestination.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+   * Required. Google Cloud Storage URI.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Google Cloud Storage URI.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + 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.GcsDestination)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.GcsDestination other = + (com.google.maps.routeoptimization.v1.GcsDestination) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.GcsDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.GcsDestination 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.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.GcsDestination 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.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.GcsDestination 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.GcsDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.GcsDestination 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.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.GcsDestination 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.GcsDestination 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.GcsDestination 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.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location where the output file(s) will be written
+   * to.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.GcsDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.GcsDestination) + com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.GcsDestination.class, + com.google.maps.routeoptimization.v1.GcsDestination.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.GcsDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + 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_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestination getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestination build() { + com.google.maps.routeoptimization.v1.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestination buildPartial() { + com.google.maps.routeoptimization.v1.GcsDestination result = + new com.google.maps.routeoptimization.v1.GcsDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.GcsDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + } + + @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.GcsDestination) { + return mergeFrom((com.google.maps.routeoptimization.v1.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.GcsDestination other) { + if (other == com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance()) + return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + 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: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Required. Google Cloud Storage URI.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URI.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URI.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + 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.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.GcsDestination) + private static final com.google.maps.routeoptimization.v1.GcsDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.GcsDestination(); + } + + public static com.google.maps.routeoptimization.v1.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination 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.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsDestinationOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsDestinationOrBuilder.java new file mode 100644 index 000000000000..53cc29ed64f1 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsDestinationOrBuilder.java @@ -0,0 +1,51 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage URI.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Required. Google Cloud Storage URI.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsSource.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsSource.java new file mode 100644 index 000000000000..240bbaf49fdd --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsSource.java @@ -0,0 +1,631 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * The Google Cloud Storage location where the input file will be read from.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.GcsSource.class, + com.google.maps.routeoptimization.v1.GcsSource.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+   * Required. URI of a Google Cloud Storage object with the format
+   * `gs://bucket/path/to/object`.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URI of a Google Cloud Storage object with the format
+   * `gs://bucket/path/to/object`.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + 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.GcsSource)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.GcsSource other = + (com.google.maps.routeoptimization.v1.GcsSource) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.GcsSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.GcsSource 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.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.GcsSource 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.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.GcsSource 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.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.GcsSource 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.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.GcsSource 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.GcsSource 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.GcsSource 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.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location where the input file will be read from.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.GcsSource) + com.google.maps.routeoptimization.v1.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.GcsSource.class, + com.google.maps.routeoptimization.v1.GcsSource.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.GcsSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + 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_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSource getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSource build() { + com.google.maps.routeoptimization.v1.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSource buildPartial() { + com.google.maps.routeoptimization.v1.GcsSource result = + new com.google.maps.routeoptimization.v1.GcsSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.GcsSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + } + + @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.GcsSource) { + return mergeFrom((com.google.maps.routeoptimization.v1.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.GcsSource other) { + if (other == com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + 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: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Required. URI of a Google Cloud Storage object with the format
+     * `gs://bucket/path/to/object`.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URI of a Google Cloud Storage object with the format
+     * `gs://bucket/path/to/object`.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URI of a Google Cloud Storage object with the format
+     * `gs://bucket/path/to/object`.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI of a Google Cloud Storage object with the format
+     * `gs://bucket/path/to/object`.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI of a Google Cloud Storage object with the format
+     * `gs://bucket/path/to/object`.
+     * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + 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.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.GcsSource) + private static final com.google.maps.routeoptimization.v1.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.GcsSource(); + } + + public static com.google.maps.routeoptimization.v1.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource 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.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsSourceOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..b9a78232d8d7 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/GcsSourceOrBuilder.java @@ -0,0 +1,53 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. URI of a Google Cloud Storage object with the format
+   * `gs://bucket/path/to/object`.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Required. URI of a Google Cloud Storage object with the format
+   * `gs://bucket/path/to/object`.
+   * 
+ * + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InjectedSolutionConstraint.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InjectedSolutionConstraint.java new file mode 100644 index 000000000000..4489d282cbf7 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InjectedSolutionConstraint.java @@ -0,0 +1,5296 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Solution injected in the request including information about which visits
+ * must be constrained and how they must be constrained.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.InjectedSolutionConstraint} + */ +public final class InjectedSolutionConstraint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.InjectedSolutionConstraint) + InjectedSolutionConstraintOrBuilder { + private static final long serialVersionUID = 0L; + // Use InjectedSolutionConstraint.newBuilder() to construct. + private InjectedSolutionConstraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InjectedSolutionConstraint() { + routes_ = java.util.Collections.emptyList(); + skippedShipments_ = java.util.Collections.emptyList(); + constraintRelaxations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InjectedSolutionConstraint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.class, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder.class); + } + + public interface ConstraintRelaxationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation> + getRelaxationsList(); + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + getRelaxations(int index); + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + int getRelaxationsCount(); + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + java.util.List< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder> + getRelaxationsOrBuilderList(); + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder + getRelaxationsOrBuilder(int index); + + /** + * + * + *
+     * Specifies the vehicle indices to which the visit constraint
+     * `relaxations` apply. If empty, this is considered the default and the
+     * `relaxations` apply to all vehicles that are not specified in other
+     * `constraint_relaxations`. There can be at most one default, i.e., at
+     * most one constraint relaxation field is allowed empty
+     * `vehicle_indices`. A vehicle index can only be listed once, even within
+     * several `constraint_relaxations`.
+     *
+     * A vehicle index is mapped the same as
+     * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+     * if `interpret_injected_solutions_using_labels` is true (see `fields`
+     * comment).
+     * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return A list containing the vehicleIndices. + */ + java.util.List getVehicleIndicesList(); + /** + * + * + *
+     * Specifies the vehicle indices to which the visit constraint
+     * `relaxations` apply. If empty, this is considered the default and the
+     * `relaxations` apply to all vehicles that are not specified in other
+     * `constraint_relaxations`. There can be at most one default, i.e., at
+     * most one constraint relaxation field is allowed empty
+     * `vehicle_indices`. A vehicle index can only be listed once, even within
+     * several `constraint_relaxations`.
+     *
+     * A vehicle index is mapped the same as
+     * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+     * if `interpret_injected_solutions_using_labels` is true (see `fields`
+     * comment).
+     * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return The count of vehicleIndices. + */ + int getVehicleIndicesCount(); + /** + * + * + *
+     * Specifies the vehicle indices to which the visit constraint
+     * `relaxations` apply. If empty, this is considered the default and the
+     * `relaxations` apply to all vehicles that are not specified in other
+     * `constraint_relaxations`. There can be at most one default, i.e., at
+     * most one constraint relaxation field is allowed empty
+     * `vehicle_indices`. A vehicle index can only be listed once, even within
+     * several `constraint_relaxations`.
+     *
+     * A vehicle index is mapped the same as
+     * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+     * if `interpret_injected_solutions_using_labels` is true (see `fields`
+     * comment).
+     * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @param index The index of the element to return. + * @return The vehicleIndices at the given index. + */ + int getVehicleIndices(int index); + } + /** + * + * + *
+   * For a group of vehicles, specifies at what threshold(s) constraints on
+   * visits will be relaxed and to which level. Shipments listed in
+   * the `skipped_shipment` field are constrained to be skipped; i.e., they
+   * cannot be performed.
+   * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} + */ + public static final class ConstraintRelaxation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + ConstraintRelaxationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConstraintRelaxation.newBuilder() to construct. + private ConstraintRelaxation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConstraintRelaxation() { + relaxations_ = java.util.Collections.emptyList(); + vehicleIndices_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConstraintRelaxation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .class, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder.class); + } + + public interface RelaxationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The constraint relaxation level that applies when the conditions
+       * at or after `threshold_time` AND at least `threshold_visit_count` are
+       * satisfied.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return The enum numeric value on the wire for level. + */ + int getLevelValue(); + /** + * + * + *
+       * The constraint relaxation level that applies when the conditions
+       * at or after `threshold_time` AND at least `threshold_visit_count` are
+       * satisfied.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return The level. + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level + getLevel(); + + /** + * + * + *
+       * The time at or after which the relaxation `level` may be applied.
+       * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + * + * @return Whether the thresholdTime field is set. + */ + boolean hasThresholdTime(); + /** + * + * + *
+       * The time at or after which the relaxation `level` may be applied.
+       * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + * + * @return The thresholdTime. + */ + com.google.protobuf.Timestamp getThresholdTime(); + /** + * + * + *
+       * The time at or after which the relaxation `level` may be applied.
+       * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getThresholdTimeOrBuilder(); + + /** + * + * + *
+       * The number of visits at or after which the relaxation `level` may be
+       * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be
+       * applied directly at the vehicle start.
+       *
+       * If it is `route.visits_size() + 1`, the `level` may only be applied to
+       * the vehicle end. If it is more than `route.visits_size() + 1`,
+       * `level` is not applied at all for that route.
+       * 
+ * + * int32 threshold_visit_count = 3; + * + * @return The thresholdVisitCount. + */ + int getThresholdVisitCount(); + } + /** + * + * + *
+     * If `relaxations` is empty, the start time and sequence of all visits
+     * on `routes` are fully constrained and no new visits may be inserted or
+     * added to those routes. Also, a vehicle's start and end time in
+     * `routes` is fully constrained, unless the vehicle is empty (i.e., has no
+     * visits and has `used_if_route_is_empty` set to false in the model).
+     *
+     * `relaxations(i).level` specifies the constraint relaxation level applied
+     * to a visit #j that satisfies:
+     *
+     *   * `route.visits(j).start_time >= relaxations(i).threshold_time` AND
+     *   * `j + 1 >= relaxations(i).threshold_visit_count`
+     *
+     * Similarly, the vehicle start is relaxed to `relaxations(i).level` if it
+     * satisfies:
+     *
+     *   * `vehicle_start_time >= relaxations(i).threshold_time` AND
+     *   * `relaxations(i).threshold_visit_count == 0`
+     * and the vehicle end is relaxed to `relaxations(i).level` if it satisfies:
+     *   * `vehicle_end_time >= relaxations(i).threshold_time` AND
+     *   * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count`
+     *
+     * To apply a relaxation level if a visit meets the `threshold_visit_count`
+     * OR the `threshold_time` add two `relaxations` with the same `level`:
+     * one with only `threshold_visit_count` set and the other with only
+     * `threshold_time` set. If a visit satisfies the conditions of multiple
+     * `relaxations`, the most relaxed level applies. As a result, from the
+     * vehicle start through the route visits in order to the vehicle end, the
+     * relaxation level becomes more relaxed: i.e., the relaxation level is
+     * non-decreasing as the route progresses.
+     *
+     * The timing and sequence of route visits that do not satisfy the
+     * threshold conditions of any `relaxations` are fully constrained
+     * and no visits may be inserted into these sequences. Also, if a
+     * vehicle start or end does not satisfy the conditions of any
+     * relaxation the time is fixed, unless the vehicle is empty.
+     * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} + */ + public static final class Relaxation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation) + RelaxationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Relaxation.newBuilder() to construct. + private Relaxation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Relaxation() { + level_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Relaxation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.class, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder.class); + } + + /** + * + * + *
+       * Expresses the different constraint relaxation levels, which are
+       * applied for a visit and those that follow when it satisfies the
+       * threshold conditions.
+       *
+       * The enumeration below is in order of increasing relaxation.
+       * 
+ * + * Protobuf enum {@code + * google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level} + */ + public enum Level implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Implicit default relaxation level: no constraints are relaxed,
+         * i.e., all visits are fully constrained.
+         *
+         * This value must not be explicitly used in `level`.
+         * 
+ * + * LEVEL_UNSPECIFIED = 0; + */ + LEVEL_UNSPECIFIED(0), + /** + * + * + *
+         * Visit start times and vehicle start/end times will be relaxed, but
+         * each visit remains bound to the same vehicle and the visit sequence
+         * must be observed: no visit can be inserted between them or before
+         * them.
+         * 
+ * + * RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + */ + RELAX_VISIT_TIMES_AFTER_THRESHOLD(1), + /** + * + * + *
+         * Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence
+         * is also relaxed: visits remain simply bound to their vehicle.
+         * 
+ * + * RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + */ + RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD(2), + /** + * + * + *
+         * Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the
+         * vehicle is also relaxed: visits are completely free at or after the
+         * threshold time and can potentially become unperformed.
+         * 
+ * + * RELAX_ALL_AFTER_THRESHOLD = 3; + */ + RELAX_ALL_AFTER_THRESHOLD(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Implicit default relaxation level: no constraints are relaxed,
+         * i.e., all visits are fully constrained.
+         *
+         * This value must not be explicitly used in `level`.
+         * 
+ * + * LEVEL_UNSPECIFIED = 0; + */ + public static final int LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * Visit start times and vehicle start/end times will be relaxed, but
+         * each visit remains bound to the same vehicle and the visit sequence
+         * must be observed: no visit can be inserted between them or before
+         * them.
+         * 
+ * + * RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + */ + public static final int RELAX_VISIT_TIMES_AFTER_THRESHOLD_VALUE = 1; + /** + * + * + *
+         * Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence
+         * is also relaxed: visits remain simply bound to their vehicle.
+         * 
+ * + * RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + */ + public static final int RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD_VALUE = 2; + /** + * + * + *
+         * Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the
+         * vehicle is also relaxed: visits are completely free at or after the
+         * threshold time and can potentially become unperformed.
+         * 
+ * + * RELAX_ALL_AFTER_THRESHOLD = 3; + */ + public static final int RELAX_ALL_AFTER_THRESHOLD_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Level valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Level forNumber(int value) { + switch (value) { + case 0: + return LEVEL_UNSPECIFIED; + case 1: + return RELAX_VISIT_TIMES_AFTER_THRESHOLD; + case 2: + return RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD; + case 3: + return RELAX_ALL_AFTER_THRESHOLD; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Level findValueByNumber(int number) { + return Level.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Level[] VALUES = values(); + + public static Level valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Level(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level) + } + + private int bitField0_; + public static final int LEVEL_FIELD_NUMBER = 1; + private int level_ = 0; + /** + * + * + *
+       * The constraint relaxation level that applies when the conditions
+       * at or after `threshold_time` AND at least `threshold_visit_count` are
+       * satisfied.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return The enum numeric value on the wire for level. + */ + @java.lang.Override + public int getLevelValue() { + return level_; + } + /** + * + * + *
+       * The constraint relaxation level that applies when the conditions
+       * at or after `threshold_time` AND at least `threshold_visit_count` are
+       * satisfied.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return The level. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level + getLevel() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level + result = + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level.forNumber(level_); + return result == null + ? com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level.UNRECOGNIZED + : result; + } + + public static final int THRESHOLD_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp thresholdTime_; + /** + * + * + *
+       * The time at or after which the relaxation `level` may be applied.
+       * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + * + * @return Whether the thresholdTime field is set. + */ + @java.lang.Override + public boolean hasThresholdTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The time at or after which the relaxation `level` may be applied.
+       * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + * + * @return The thresholdTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getThresholdTime() { + return thresholdTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : thresholdTime_; + } + /** + * + * + *
+       * The time at or after which the relaxation `level` may be applied.
+       * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getThresholdTimeOrBuilder() { + return thresholdTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : thresholdTime_; + } + + public static final int THRESHOLD_VISIT_COUNT_FIELD_NUMBER = 3; + private int thresholdVisitCount_ = 0; + /** + * + * + *
+       * The number of visits at or after which the relaxation `level` may be
+       * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be
+       * applied directly at the vehicle start.
+       *
+       * If it is `route.visits_size() + 1`, the `level` may only be applied to
+       * the vehicle end. If it is more than `route.visits_size() + 1`,
+       * `level` is not applied at all for that route.
+       * 
+ * + * int32 threshold_visit_count = 3; + * + * @return The thresholdVisitCount. + */ + @java.lang.Override + public int getThresholdVisitCount() { + return thresholdVisitCount_; + } + + 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 (level_ + != com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level.LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, level_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getThresholdTime()); + } + if (thresholdVisitCount_ != 0) { + output.writeInt32(3, thresholdVisitCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (level_ + != com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level.LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, level_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getThresholdTime()); + } + if (thresholdVisitCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, thresholdVisitCount_); + } + 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.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + other = + (com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation) + obj; + + if (level_ != other.level_) return false; + if (hasThresholdTime() != other.hasThresholdTime()) return false; + if (hasThresholdTime()) { + if (!getThresholdTime().equals(other.getThresholdTime())) return false; + } + if (getThresholdVisitCount() != other.getThresholdVisitCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + level_; + if (hasThresholdTime()) { + hash = (37 * hash) + THRESHOLD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getThresholdTime().hashCode(); + } + hash = (37 * hash) + THRESHOLD_VISIT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getThresholdVisitCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + 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.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + 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; + } + /** + * + * + *
+       * If `relaxations` is empty, the start time and sequence of all visits
+       * on `routes` are fully constrained and no new visits may be inserted or
+       * added to those routes. Also, a vehicle's start and end time in
+       * `routes` is fully constrained, unless the vehicle is empty (i.e., has no
+       * visits and has `used_if_route_is_empty` set to false in the model).
+       *
+       * `relaxations(i).level` specifies the constraint relaxation level applied
+       * to a visit #j that satisfies:
+       *
+       *   * `route.visits(j).start_time >= relaxations(i).threshold_time` AND
+       *   * `j + 1 >= relaxations(i).threshold_visit_count`
+       *
+       * Similarly, the vehicle start is relaxed to `relaxations(i).level` if it
+       * satisfies:
+       *
+       *   * `vehicle_start_time >= relaxations(i).threshold_time` AND
+       *   * `relaxations(i).threshold_visit_count == 0`
+       * and the vehicle end is relaxed to `relaxations(i).level` if it satisfies:
+       *   * `vehicle_end_time >= relaxations(i).threshold_time` AND
+       *   * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count`
+       *
+       * To apply a relaxation level if a visit meets the `threshold_visit_count`
+       * OR the `threshold_time` add two `relaxations` with the same `level`:
+       * one with only `threshold_visit_count` set and the other with only
+       * `threshold_time` set. If a visit satisfies the conditions of multiple
+       * `relaxations`, the most relaxed level applies. As a result, from the
+       * vehicle start through the route visits in order to the vehicle end, the
+       * relaxation level becomes more relaxed: i.e., the relaxation level is
+       * non-decreasing as the route progresses.
+       *
+       * The timing and sequence of route visits that do not satisfy the
+       * threshold conditions of any `relaxations` are fully constrained
+       * and no visits may be inserted into these sequences. Also, if a
+       * vehicle start or end does not satisfy the conditions of any
+       * relaxation the time is fixed, unless the vehicle is empty.
+       * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation) + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.class, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getThresholdTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + level_ = 0; + thresholdTime_ = null; + if (thresholdTimeBuilder_ != null) { + thresholdTimeBuilder_.dispose(); + thresholdTimeBuilder_ = null; + } + thresholdVisitCount_ = 0; + 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_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + build() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + buildPartial() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + result = + new com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.level_ = level_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.thresholdTime_ = + thresholdTimeBuilder_ == null ? thresholdTime_ : thresholdTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.thresholdVisitCount_ = thresholdVisitCount_; + } + 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.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + other) { + if (other + == com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.getDefaultInstance()) return this; + if (other.level_ != 0) { + setLevelValue(other.getLevelValue()); + } + if (other.hasThresholdTime()) { + mergeThresholdTime(other.getThresholdTime()); + } + if (other.getThresholdVisitCount() != 0) { + setThresholdVisitCount(other.getThresholdVisitCount()); + } + 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: + { + level_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getThresholdTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + thresholdVisitCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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 level_ = 0; + /** + * + * + *
+         * The constraint relaxation level that applies when the conditions
+         * at or after `threshold_time` AND at least `threshold_visit_count` are
+         * satisfied.
+         * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return The enum numeric value on the wire for level. + */ + @java.lang.Override + public int getLevelValue() { + return level_; + } + /** + * + * + *
+         * The constraint relaxation level that applies when the conditions
+         * at or after `threshold_time` AND at least `threshold_visit_count` are
+         * satisfied.
+         * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @param value The enum numeric value on the wire for level to set. + * @return This builder for chaining. + */ + public Builder setLevelValue(int value) { + level_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The constraint relaxation level that applies when the conditions
+         * at or after `threshold_time` AND at least `threshold_visit_count` are
+         * satisfied.
+         * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return The level. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level + getLevel() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level + result = + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.Level.forNumber(level_); + return result == null + ? com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * The constraint relaxation level that applies when the conditions
+         * at or after `threshold_time` AND at least `threshold_visit_count` are
+         * satisfied.
+         * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Level + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + level_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * The constraint relaxation level that applies when the conditions
+         * at or after `threshold_time` AND at least `threshold_visit_count` are
+         * satisfied.
+         * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + level_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp thresholdTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + thresholdTimeBuilder_; + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + * + * @return Whether the thresholdTime field is set. + */ + public boolean hasThresholdTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + * + * @return The thresholdTime. + */ + public com.google.protobuf.Timestamp getThresholdTime() { + if (thresholdTimeBuilder_ == null) { + return thresholdTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : thresholdTime_; + } else { + return thresholdTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + public Builder setThresholdTime(com.google.protobuf.Timestamp value) { + if (thresholdTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + thresholdTime_ = value; + } else { + thresholdTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + public Builder setThresholdTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (thresholdTimeBuilder_ == null) { + thresholdTime_ = builderForValue.build(); + } else { + thresholdTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + public Builder mergeThresholdTime(com.google.protobuf.Timestamp value) { + if (thresholdTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && thresholdTime_ != null + && thresholdTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getThresholdTimeBuilder().mergeFrom(value); + } else { + thresholdTime_ = value; + } + } else { + thresholdTimeBuilder_.mergeFrom(value); + } + if (thresholdTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + public Builder clearThresholdTime() { + bitField0_ = (bitField0_ & ~0x00000002); + thresholdTime_ = null; + if (thresholdTimeBuilder_ != null) { + thresholdTimeBuilder_.dispose(); + thresholdTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getThresholdTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getThresholdTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getThresholdTimeOrBuilder() { + if (thresholdTimeBuilder_ != null) { + return thresholdTimeBuilder_.getMessageOrBuilder(); + } else { + return thresholdTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : thresholdTime_; + } + } + /** + * + * + *
+         * The time at or after which the relaxation `level` may be applied.
+         * 
+ * + * .google.protobuf.Timestamp threshold_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getThresholdTimeFieldBuilder() { + if (thresholdTimeBuilder_ == null) { + thresholdTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getThresholdTime(), getParentForChildren(), isClean()); + thresholdTime_ = null; + } + return thresholdTimeBuilder_; + } + + private int thresholdVisitCount_; + /** + * + * + *
+         * The number of visits at or after which the relaxation `level` may be
+         * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be
+         * applied directly at the vehicle start.
+         *
+         * If it is `route.visits_size() + 1`, the `level` may only be applied to
+         * the vehicle end. If it is more than `route.visits_size() + 1`,
+         * `level` is not applied at all for that route.
+         * 
+ * + * int32 threshold_visit_count = 3; + * + * @return The thresholdVisitCount. + */ + @java.lang.Override + public int getThresholdVisitCount() { + return thresholdVisitCount_; + } + /** + * + * + *
+         * The number of visits at or after which the relaxation `level` may be
+         * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be
+         * applied directly at the vehicle start.
+         *
+         * If it is `route.visits_size() + 1`, the `level` may only be applied to
+         * the vehicle end. If it is more than `route.visits_size() + 1`,
+         * `level` is not applied at all for that route.
+         * 
+ * + * int32 threshold_visit_count = 3; + * + * @param value The thresholdVisitCount to set. + * @return This builder for chaining. + */ + public Builder setThresholdVisitCount(int value) { + + thresholdVisitCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * The number of visits at or after which the relaxation `level` may be
+         * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be
+         * applied directly at the vehicle start.
+         *
+         * If it is `route.visits_size() + 1`, the `level` may only be applied to
+         * the vehicle end. If it is more than `route.visits_size() + 1`,
+         * `level` is not applied at all for that route.
+         * 
+ * + * int32 threshold_visit_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearThresholdVisitCount() { + bitField0_ = (bitField0_ & ~0x00000004); + thresholdVisitCount_ = 0; + 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.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation) + private static final com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation(); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Relaxation 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.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RELAXATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation> + relaxations_; + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation> + getRelaxationsList() { + return relaxations_; + } + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder> + getRelaxationsOrBuilderList() { + return relaxations_; + } + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + @java.lang.Override + public int getRelaxationsCount() { + return relaxations_.size(); + } + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + getRelaxations(int index) { + return relaxations_.get(index); + } + /** + * + * + *
+     * All the visit constraint relaxations that will apply to visits on
+     * routes with vehicles in `vehicle_indices`.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder + getRelaxationsOrBuilder(int index) { + return relaxations_.get(index); + } + + public static final int VEHICLE_INDICES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList vehicleIndices_ = emptyIntList(); + /** + * + * + *
+     * Specifies the vehicle indices to which the visit constraint
+     * `relaxations` apply. If empty, this is considered the default and the
+     * `relaxations` apply to all vehicles that are not specified in other
+     * `constraint_relaxations`. There can be at most one default, i.e., at
+     * most one constraint relaxation field is allowed empty
+     * `vehicle_indices`. A vehicle index can only be listed once, even within
+     * several `constraint_relaxations`.
+     *
+     * A vehicle index is mapped the same as
+     * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+     * if `interpret_injected_solutions_using_labels` is true (see `fields`
+     * comment).
+     * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return A list containing the vehicleIndices. + */ + @java.lang.Override + public java.util.List getVehicleIndicesList() { + return vehicleIndices_; + } + /** + * + * + *
+     * Specifies the vehicle indices to which the visit constraint
+     * `relaxations` apply. If empty, this is considered the default and the
+     * `relaxations` apply to all vehicles that are not specified in other
+     * `constraint_relaxations`. There can be at most one default, i.e., at
+     * most one constraint relaxation field is allowed empty
+     * `vehicle_indices`. A vehicle index can only be listed once, even within
+     * several `constraint_relaxations`.
+     *
+     * A vehicle index is mapped the same as
+     * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+     * if `interpret_injected_solutions_using_labels` is true (see `fields`
+     * comment).
+     * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return The count of vehicleIndices. + */ + public int getVehicleIndicesCount() { + return vehicleIndices_.size(); + } + /** + * + * + *
+     * Specifies the vehicle indices to which the visit constraint
+     * `relaxations` apply. If empty, this is considered the default and the
+     * `relaxations` apply to all vehicles that are not specified in other
+     * `constraint_relaxations`. There can be at most one default, i.e., at
+     * most one constraint relaxation field is allowed empty
+     * `vehicle_indices`. A vehicle index can only be listed once, even within
+     * several `constraint_relaxations`.
+     *
+     * A vehicle index is mapped the same as
+     * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+     * if `interpret_injected_solutions_using_labels` is true (see `fields`
+     * comment).
+     * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @param index The index of the element to return. + * @return The vehicleIndices at the given index. + */ + public int getVehicleIndices(int index) { + return vehicleIndices_.getInt(index); + } + + private int vehicleIndicesMemoizedSerializedSize = -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 < relaxations_.size(); i++) { + output.writeMessage(1, relaxations_.get(i)); + } + if (getVehicleIndicesList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(vehicleIndicesMemoizedSerializedSize); + } + for (int i = 0; i < vehicleIndices_.size(); i++) { + output.writeInt32NoTag(vehicleIndices_.getInt(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 < relaxations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, relaxations_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < vehicleIndices_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( + vehicleIndices_.getInt(i)); + } + size += dataSize; + if (!getVehicleIndicesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + vehicleIndicesMemoizedSerializedSize = 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.InjectedSolutionConstraint.ConstraintRelaxation)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation other = + (com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + obj; + + if (!getRelaxationsList().equals(other.getRelaxationsList())) return false; + if (!getVehicleIndicesList().equals(other.getVehicleIndicesList())) 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 (getRelaxationsCount() > 0) { + hash = (37 * hash) + RELAXATIONS_FIELD_NUMBER; + hash = (53 * hash) + getRelaxationsList().hashCode(); + } + if (getVehicleIndicesCount() > 0) { + hash = (37 * hash) + VEHICLE_INDICES_FIELD_NUMBER; + hash = (53 * hash) + getVehicleIndicesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint + .ConstraintRelaxation + 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.InjectedSolutionConstraint.ConstraintRelaxation + 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; + } + /** + * + * + *
+     * For a group of vehicles, specifies at what threshold(s) constraints on
+     * visits will be relaxed and to which level. Shipments listed in
+     * the `skipped_shipment` field are constrained to be skipped; i.e., they
+     * cannot be performed.
+     * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .class, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (relaxationsBuilder_ == null) { + relaxations_ = java.util.Collections.emptyList(); + } else { + relaxations_ = null; + relaxationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + vehicleIndices_ = emptyIntList(); + 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_InjectedSolutionConstraint_ConstraintRelaxation_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + build() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + buildPartial() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + result = + new com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + result) { + if (relaxationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + relaxations_ = java.util.Collections.unmodifiableList(relaxations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.relaxations_ = relaxations_; + } else { + result.relaxations_ = relaxationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + vehicleIndices_.makeImmutable(); + result.vehicleIndices_ = vehicleIndices_; + } + } + + @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.InjectedSolutionConstraint.ConstraintRelaxation) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + other) { + if (other + == com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .getDefaultInstance()) return this; + if (relaxationsBuilder_ == null) { + if (!other.relaxations_.isEmpty()) { + if (relaxations_.isEmpty()) { + relaxations_ = other.relaxations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRelaxationsIsMutable(); + relaxations_.addAll(other.relaxations_); + } + onChanged(); + } + } else { + if (!other.relaxations_.isEmpty()) { + if (relaxationsBuilder_.isEmpty()) { + relaxationsBuilder_.dispose(); + relaxationsBuilder_ = null; + relaxations_ = other.relaxations_; + bitField0_ = (bitField0_ & ~0x00000001); + relaxationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRelaxationsFieldBuilder() + : null; + } else { + relaxationsBuilder_.addAllMessages(other.relaxations_); + } + } + } + if (!other.vehicleIndices_.isEmpty()) { + if (vehicleIndices_.isEmpty()) { + vehicleIndices_ = other.vehicleIndices_; + vehicleIndices_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureVehicleIndicesIsMutable(); + vehicleIndices_.addAll(other.vehicleIndices_); + } + 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.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation + m = + input.readMessage( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.parser(), + extensionRegistry); + if (relaxationsBuilder_ == null) { + ensureRelaxationsIsMutable(); + relaxations_.add(m); + } else { + relaxationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + int v = input.readInt32(); + ensureVehicleIndicesIsMutable(); + vehicleIndices_.addInt(v); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureVehicleIndicesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + vehicleIndices_.addInt(input.readInt32()); + } + 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< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation> + relaxations_ = java.util.Collections.emptyList(); + + private void ensureRelaxationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + relaxations_ = + new java.util.ArrayList< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation>(relaxations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder> + relaxationsBuilder_; + + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation> + getRelaxationsList() { + if (relaxationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(relaxations_); + } else { + return relaxationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public int getRelaxationsCount() { + if (relaxationsBuilder_ == null) { + return relaxations_.size(); + } else { + return relaxationsBuilder_.getCount(); + } + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + getRelaxations(int index) { + if (relaxationsBuilder_ == null) { + return relaxations_.get(index); + } else { + return relaxationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder setRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + value) { + if (relaxationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelaxationsIsMutable(); + relaxations_.set(index, value); + onChanged(); + } else { + relaxationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder setRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder + builderForValue) { + if (relaxationsBuilder_ == null) { + ensureRelaxationsIsMutable(); + relaxations_.set(index, builderForValue.build()); + onChanged(); + } else { + relaxationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder addRelaxations( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + value) { + if (relaxationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelaxationsIsMutable(); + relaxations_.add(value); + onChanged(); + } else { + relaxationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder addRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation + value) { + if (relaxationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelaxationsIsMutable(); + relaxations_.add(index, value); + onChanged(); + } else { + relaxationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder addRelaxations( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder + builderForValue) { + if (relaxationsBuilder_ == null) { + ensureRelaxationsIsMutable(); + relaxations_.add(builderForValue.build()); + onChanged(); + } else { + relaxationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder addRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder + builderForValue) { + if (relaxationsBuilder_ == null) { + ensureRelaxationsIsMutable(); + relaxations_.add(index, builderForValue.build()); + onChanged(); + } else { + relaxationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder addAllRelaxations( + java.lang.Iterable< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation> + values) { + if (relaxationsBuilder_ == null) { + ensureRelaxationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, relaxations_); + onChanged(); + } else { + relaxationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder clearRelaxations() { + if (relaxationsBuilder_ == null) { + relaxations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + relaxationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public Builder removeRelaxations(int index) { + if (relaxationsBuilder_ == null) { + ensureRelaxationsIsMutable(); + relaxations_.remove(index); + onChanged(); + } else { + relaxationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder + getRelaxationsBuilder(int index) { + return getRelaxationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder + getRelaxationsOrBuilder(int index) { + if (relaxationsBuilder_ == null) { + return relaxations_.get(index); + } else { + return relaxationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.RelaxationOrBuilder> + getRelaxationsOrBuilderList() { + if (relaxationsBuilder_ != null) { + return relaxationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(relaxations_); + } + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder + addRelaxationsBuilder() { + return getRelaxationsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.getDefaultInstance()); + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder + addRelaxationsBuilder(int index) { + return getRelaxationsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.getDefaultInstance()); + } + /** + * + * + *
+       * All the visit constraint relaxations that will apply to visits on
+       * routes with vehicles in `vehicle_indices`.
+       * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder> + getRelaxationsBuilderList() { + return getRelaxationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Relaxation.Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .RelaxationOrBuilder> + getRelaxationsFieldBuilder() { + if (relaxationsBuilder_ == null) { + relaxationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.Relaxation.Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.RelaxationOrBuilder>( + relaxations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + relaxations_ = null; + } + return relaxationsBuilder_; + } + + private com.google.protobuf.Internal.IntList vehicleIndices_ = emptyIntList(); + + private void ensureVehicleIndicesIsMutable() { + if (!vehicleIndices_.isModifiable()) { + vehicleIndices_ = makeMutableCopy(vehicleIndices_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return A list containing the vehicleIndices. + */ + public java.util.List getVehicleIndicesList() { + vehicleIndices_.makeImmutable(); + return vehicleIndices_; + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return The count of vehicleIndices. + */ + public int getVehicleIndicesCount() { + return vehicleIndices_.size(); + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @param index The index of the element to return. + * @return The vehicleIndices at the given index. + */ + public int getVehicleIndices(int index) { + return vehicleIndices_.getInt(index); + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @param index The index to set the value at. + * @param value The vehicleIndices to set. + * @return This builder for chaining. + */ + public Builder setVehicleIndices(int index, int value) { + + ensureVehicleIndicesIsMutable(); + vehicleIndices_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @param value The vehicleIndices to add. + * @return This builder for chaining. + */ + public Builder addVehicleIndices(int value) { + + ensureVehicleIndicesIsMutable(); + vehicleIndices_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @param values The vehicleIndices to add. + * @return This builder for chaining. + */ + public Builder addAllVehicleIndices(java.lang.Iterable values) { + ensureVehicleIndicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vehicleIndices_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the vehicle indices to which the visit constraint
+       * `relaxations` apply. If empty, this is considered the default and the
+       * `relaxations` apply to all vehicles that are not specified in other
+       * `constraint_relaxations`. There can be at most one default, i.e., at
+       * most one constraint relaxation field is allowed empty
+       * `vehicle_indices`. A vehicle index can only be listed once, even within
+       * several `constraint_relaxations`.
+       *
+       * A vehicle index is mapped the same as
+       * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index],
+       * if `interpret_injected_solutions_using_labels` is true (see `fields`
+       * comment).
+       * 
+ * + * repeated int32 vehicle_indices = 2; + * + * @return This builder for chaining. + */ + public Builder clearVehicleIndices() { + vehicleIndices_ = emptyIntList(); + 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.InjectedSolutionConstraint.ConstraintRelaxation) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + private static final com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation(); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConstraintRelaxation 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.InjectedSolutionConstraint.ConstraintRelaxation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ROUTES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List routes_; + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public java.util.List getRoutesList() { + return routes_; + } + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public java.util.List + getRoutesOrBuilderList() { + return routes_; + } + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public int getRoutesCount() { + return routes_.size(); + } + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute getRoutes(int index) { + return routes_.get(index); + } + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder(int index) { + return routes_.get(index); + } + + public static final int SKIPPED_SHIPMENTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List skippedShipments_; + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + @java.lang.Override + public java.util.List + getSkippedShipmentsList() { + return skippedShipments_; + } + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + @java.lang.Override + public java.util.List + getSkippedShipmentsOrBuilderList() { + return skippedShipments_; + } + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + @java.lang.Override + public int getSkippedShipmentsCount() { + return skippedShipments_.size(); + } + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment getSkippedShipments(int index) { + return skippedShipments_.get(index); + } + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder getSkippedShipmentsOrBuilder( + int index) { + return skippedShipments_.get(index); + } + + public static final int CONSTRAINT_RELAXATIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation> + constraintRelaxations_; + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + @java.lang.Override + public java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation> + getConstraintRelaxationsList() { + return constraintRelaxations_; + } + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder> + getConstraintRelaxationsOrBuilderList() { + return constraintRelaxations_; + } + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + @java.lang.Override + public int getConstraintRelaxationsCount() { + return constraintRelaxations_.size(); + } + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + getConstraintRelaxations(int index) { + return constraintRelaxations_.get(index); + } + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder + getConstraintRelaxationsOrBuilder(int index) { + return constraintRelaxations_.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 < routes_.size(); i++) { + output.writeMessage(1, routes_.get(i)); + } + for (int i = 0; i < skippedShipments_.size(); i++) { + output.writeMessage(2, skippedShipments_.get(i)); + } + for (int i = 0; i < constraintRelaxations_.size(); i++) { + output.writeMessage(3, constraintRelaxations_.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 < routes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, routes_.get(i)); + } + for (int i = 0; i < skippedShipments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, skippedShipments_.get(i)); + } + for (int i = 0; i < constraintRelaxations_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, constraintRelaxations_.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.InjectedSolutionConstraint)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint other = + (com.google.maps.routeoptimization.v1.InjectedSolutionConstraint) obj; + + if (!getRoutesList().equals(other.getRoutesList())) return false; + if (!getSkippedShipmentsList().equals(other.getSkippedShipmentsList())) return false; + if (!getConstraintRelaxationsList().equals(other.getConstraintRelaxationsList())) 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 (getRoutesCount() > 0) { + hash = (37 * hash) + ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getRoutesList().hashCode(); + } + if (getSkippedShipmentsCount() > 0) { + hash = (37 * hash) + SKIPPED_SHIPMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSkippedShipmentsList().hashCode(); + } + if (getConstraintRelaxationsCount() > 0) { + hash = (37 * hash) + CONSTRAINT_RELAXATIONS_FIELD_NUMBER; + hash = (53 * hash) + getConstraintRelaxationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint 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.InjectedSolutionConstraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint 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.InjectedSolutionConstraint parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint 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.InjectedSolutionConstraint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint 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.InjectedSolutionConstraint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint 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.InjectedSolutionConstraint 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.InjectedSolutionConstraint 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.InjectedSolutionConstraint 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; + } + /** + * + * + *
+   * Solution injected in the request including information about which visits
+   * must be constrained and how they must be constrained.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.InjectedSolutionConstraint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.InjectedSolutionConstraint) + com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.class, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (routesBuilder_ == null) { + routes_ = java.util.Collections.emptyList(); + } else { + routes_ = null; + routesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (skippedShipmentsBuilder_ == null) { + skippedShipments_ = java.util.Collections.emptyList(); + } else { + skippedShipments_ = null; + skippedShipmentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (constraintRelaxationsBuilder_ == null) { + constraintRelaxations_ = java.util.Collections.emptyList(); + } else { + constraintRelaxations_ = null; + constraintRelaxationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + 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_InjectedSolutionConstraint_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint build() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint buildPartial() { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint result = + new com.google.maps.routeoptimization.v1.InjectedSolutionConstraint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint result) { + if (routesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + routes_ = java.util.Collections.unmodifiableList(routes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.routes_ = routes_; + } else { + result.routes_ = routesBuilder_.build(); + } + if (skippedShipmentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + skippedShipments_ = java.util.Collections.unmodifiableList(skippedShipments_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.skippedShipments_ = skippedShipments_; + } else { + result.skippedShipments_ = skippedShipmentsBuilder_.build(); + } + if (constraintRelaxationsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + constraintRelaxations_ = java.util.Collections.unmodifiableList(constraintRelaxations_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.constraintRelaxations_ = constraintRelaxations_; + } else { + result.constraintRelaxations_ = constraintRelaxationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint result) { + int from_bitField0_ = 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.InjectedSolutionConstraint) { + return mergeFrom((com.google.maps.routeoptimization.v1.InjectedSolutionConstraint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint other) { + if (other + == com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.getDefaultInstance()) + return this; + if (routesBuilder_ == null) { + if (!other.routes_.isEmpty()) { + if (routes_.isEmpty()) { + routes_ = other.routes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoutesIsMutable(); + routes_.addAll(other.routes_); + } + onChanged(); + } + } else { + if (!other.routes_.isEmpty()) { + if (routesBuilder_.isEmpty()) { + routesBuilder_.dispose(); + routesBuilder_ = null; + routes_ = other.routes_; + bitField0_ = (bitField0_ & ~0x00000001); + routesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRoutesFieldBuilder() + : null; + } else { + routesBuilder_.addAllMessages(other.routes_); + } + } + } + if (skippedShipmentsBuilder_ == null) { + if (!other.skippedShipments_.isEmpty()) { + if (skippedShipments_.isEmpty()) { + skippedShipments_ = other.skippedShipments_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.addAll(other.skippedShipments_); + } + onChanged(); + } + } else { + if (!other.skippedShipments_.isEmpty()) { + if (skippedShipmentsBuilder_.isEmpty()) { + skippedShipmentsBuilder_.dispose(); + skippedShipmentsBuilder_ = null; + skippedShipments_ = other.skippedShipments_; + bitField0_ = (bitField0_ & ~0x00000002); + skippedShipmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSkippedShipmentsFieldBuilder() + : null; + } else { + skippedShipmentsBuilder_.addAllMessages(other.skippedShipments_); + } + } + } + if (constraintRelaxationsBuilder_ == null) { + if (!other.constraintRelaxations_.isEmpty()) { + if (constraintRelaxations_.isEmpty()) { + constraintRelaxations_ = other.constraintRelaxations_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.addAll(other.constraintRelaxations_); + } + onChanged(); + } + } else { + if (!other.constraintRelaxations_.isEmpty()) { + if (constraintRelaxationsBuilder_.isEmpty()) { + constraintRelaxationsBuilder_.dispose(); + constraintRelaxationsBuilder_ = null; + constraintRelaxations_ = other.constraintRelaxations_; + bitField0_ = (bitField0_ & ~0x00000004); + constraintRelaxationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConstraintRelaxationsFieldBuilder() + : null; + } else { + constraintRelaxationsBuilder_.addAllMessages(other.constraintRelaxations_); + } + } + } + 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.ShipmentRoute m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.parser(), + extensionRegistry); + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(m); + } else { + routesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.maps.routeoptimization.v1.SkippedShipment m = + input.readMessage( + com.google.maps.routeoptimization.v1.SkippedShipment.parser(), + extensionRegistry); + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(m); + } else { + skippedShipmentsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + m = + input.readMessage( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation.parser(), + extensionRegistry); + if (constraintRelaxationsBuilder_ == null) { + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.add(m); + } else { + constraintRelaxationsBuilder_.addMessage(m); + } + break; + } // case 26 + 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 routes_ = + java.util.Collections.emptyList(); + + private void ensureRoutesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + routes_ = + new java.util.ArrayList(routes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + routesBuilder_; + + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public java.util.List getRoutesList() { + if (routesBuilder_ == null) { + return java.util.Collections.unmodifiableList(routes_); + } else { + return routesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public int getRoutesCount() { + if (routesBuilder_ == null) { + return routes_.size(); + } else { + return routesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute getRoutes(int index) { + if (routesBuilder_ == null) { + return routes_.get(index); + } else { + return routesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder setRoutes(int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.set(index, value); + onChanged(); + } else { + routesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder setRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.set(index, builderForValue.build()); + onChanged(); + } else { + routesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes(com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.add(value); + onChanged(); + } else { + routesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes(int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.add(index, value); + onChanged(); + } else { + routesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes( + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(builderForValue.build()); + onChanged(); + } else { + routesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(index, builderForValue.build()); + onChanged(); + } else { + routesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addAllRoutes( + java.lang.Iterable values) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, routes_); + onChanged(); + } else { + routesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder clearRoutes() { + if (routesBuilder_ == null) { + routes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + routesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder removeRoutes(int index) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.remove(index); + onChanged(); + } else { + routesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder getRoutesBuilder(int index) { + return getRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder( + int index) { + if (routesBuilder_ == null) { + return routes_.get(index); + } else { + return routesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public java.util.List + getRoutesOrBuilderList() { + if (routesBuilder_ != null) { + return routesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(routes_); + } + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder addRoutesBuilder() { + return getRoutesFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder addRoutesBuilder(int index) { + return getRoutesFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Routes of the solution to inject. Some routes may be omitted from the
+     * original solution. The routes and skipped shipments must satisfy the basic
+     * validity assumptions listed for `injected_first_solution_routes`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public java.util.List + getRoutesBuilderList() { + return getRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + getRoutesFieldBuilder() { + if (routesBuilder_ == null) { + routesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder>( + routes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + routes_ = null; + } + return routesBuilder_; + } + + private java.util.List skippedShipments_ = + java.util.Collections.emptyList(); + + private void ensureSkippedShipmentsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + skippedShipments_ = + new java.util.ArrayList( + skippedShipments_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder, + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder> + skippedShipmentsBuilder_; + + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public java.util.List + getSkippedShipmentsList() { + if (skippedShipmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(skippedShipments_); + } else { + return skippedShipmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public int getSkippedShipmentsCount() { + if (skippedShipmentsBuilder_ == null) { + return skippedShipments_.size(); + } else { + return skippedShipmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment getSkippedShipments(int index) { + if (skippedShipmentsBuilder_ == null) { + return skippedShipments_.get(index); + } else { + return skippedShipmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder setSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment value) { + if (skippedShipmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedShipmentsIsMutable(); + skippedShipments_.set(index, value); + onChanged(); + } else { + skippedShipmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder setSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment.Builder builderForValue) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.set(index, builderForValue.build()); + onChanged(); + } else { + skippedShipmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder addSkippedShipments(com.google.maps.routeoptimization.v1.SkippedShipment value) { + if (skippedShipmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(value); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder addSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment value) { + if (skippedShipmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(index, value); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder addSkippedShipments( + com.google.maps.routeoptimization.v1.SkippedShipment.Builder builderForValue) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(builderForValue.build()); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder addSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment.Builder builderForValue) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(index, builderForValue.build()); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder addAllSkippedShipments( + java.lang.Iterable values) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, skippedShipments_); + onChanged(); + } else { + skippedShipmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder clearSkippedShipments() { + if (skippedShipmentsBuilder_ == null) { + skippedShipments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + skippedShipmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public Builder removeSkippedShipments(int index) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.remove(index); + onChanged(); + } else { + skippedShipmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Builder getSkippedShipmentsBuilder( + int index) { + return getSkippedShipmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder + getSkippedShipmentsOrBuilder(int index) { + if (skippedShipmentsBuilder_ == null) { + return skippedShipments_.get(index); + } else { + return skippedShipmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public java.util.List + getSkippedShipmentsOrBuilderList() { + if (skippedShipmentsBuilder_ != null) { + return skippedShipmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(skippedShipments_); + } + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Builder + addSkippedShipmentsBuilder() { + return getSkippedShipmentsFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.SkippedShipment.getDefaultInstance()); + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Builder addSkippedShipmentsBuilder( + int index) { + return getSkippedShipmentsFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.SkippedShipment.getDefaultInstance()); + } + /** + * + * + *
+     * Skipped shipments of the solution to inject. Some may be omitted from the
+     * original solution. See the `routes` field.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * + */ + public java.util.List + getSkippedShipmentsBuilderList() { + return getSkippedShipmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder, + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder> + getSkippedShipmentsFieldBuilder() { + if (skippedShipmentsBuilder_ == null) { + skippedShipmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder, + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder>( + skippedShipments_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + skippedShipments_ = null; + } + return skippedShipmentsBuilder_; + } + + private java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation> + constraintRelaxations_ = java.util.Collections.emptyList(); + + private void ensureConstraintRelaxationsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + constraintRelaxations_ = + new java.util.ArrayList< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation>(constraintRelaxations_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder> + constraintRelaxationsBuilder_; + + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation> + getConstraintRelaxationsList() { + if (constraintRelaxationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(constraintRelaxations_); + } else { + return constraintRelaxationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public int getConstraintRelaxationsCount() { + if (constraintRelaxationsBuilder_ == null) { + return constraintRelaxations_.size(); + } else { + return constraintRelaxationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + getConstraintRelaxations(int index) { + if (constraintRelaxationsBuilder_ == null) { + return constraintRelaxations_.get(index); + } else { + return constraintRelaxationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder setConstraintRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + value) { + if (constraintRelaxationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.set(index, value); + onChanged(); + } else { + constraintRelaxationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder setConstraintRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Builder + builderForValue) { + if (constraintRelaxationsBuilder_ == null) { + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.set(index, builderForValue.build()); + onChanged(); + } else { + constraintRelaxationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder addConstraintRelaxations( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + value) { + if (constraintRelaxationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.add(value); + onChanged(); + } else { + constraintRelaxationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder addConstraintRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + value) { + if (constraintRelaxationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.add(index, value); + onChanged(); + } else { + constraintRelaxationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder addConstraintRelaxations( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Builder + builderForValue) { + if (constraintRelaxationsBuilder_ == null) { + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.add(builderForValue.build()); + onChanged(); + } else { + constraintRelaxationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder addConstraintRelaxations( + int index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Builder + builderForValue) { + if (constraintRelaxationsBuilder_ == null) { + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.add(index, builderForValue.build()); + onChanged(); + } else { + constraintRelaxationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder addAllConstraintRelaxations( + java.lang.Iterable< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation> + values) { + if (constraintRelaxationsBuilder_ == null) { + ensureConstraintRelaxationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, constraintRelaxations_); + onChanged(); + } else { + constraintRelaxationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder clearConstraintRelaxations() { + if (constraintRelaxationsBuilder_ == null) { + constraintRelaxations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + constraintRelaxationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public Builder removeConstraintRelaxations(int index) { + if (constraintRelaxationsBuilder_ == null) { + ensureConstraintRelaxationsIsMutable(); + constraintRelaxations_.remove(index); + onChanged(); + } else { + constraintRelaxationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder + getConstraintRelaxationsBuilder(int index) { + return getConstraintRelaxationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder + getConstraintRelaxationsOrBuilder(int index) { + if (constraintRelaxationsBuilder_ == null) { + return constraintRelaxations_.get(index); + } else { + return constraintRelaxationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder> + getConstraintRelaxationsOrBuilderList() { + if (constraintRelaxationsBuilder_ != null) { + return constraintRelaxationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(constraintRelaxations_); + } + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder + addConstraintRelaxationsBuilder() { + return getConstraintRelaxationsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .getDefaultInstance()); + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder + addConstraintRelaxationsBuilder(int index) { + return getConstraintRelaxationsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .getDefaultInstance()); + } + /** + * + * + *
+     * For zero or more groups of vehicles, specifies when and how much to relax
+     * constraints. If this field is empty, all non-empty vehicle routes are
+     * fully constrained.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder> + getConstraintRelaxationsBuilderList() { + return getConstraintRelaxationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder> + getConstraintRelaxationsFieldBuilder() { + if (constraintRelaxationsBuilder_ == null) { + constraintRelaxationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxation, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + .Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder>( + constraintRelaxations_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + constraintRelaxations_ = null; + } + return constraintRelaxationsBuilder_; + } + + @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.InjectedSolutionConstraint) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.InjectedSolutionConstraint) + private static final com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.InjectedSolutionConstraint(); + } + + public static com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InjectedSolutionConstraint 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.InjectedSolutionConstraint + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InjectedSolutionConstraintOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InjectedSolutionConstraintOrBuilder.java new file mode 100644 index 000000000000..de6c3801d34a --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InjectedSolutionConstraintOrBuilder.java @@ -0,0 +1,225 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface InjectedSolutionConstraintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.InjectedSolutionConstraint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + java.util.List getRoutesList(); + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + com.google.maps.routeoptimization.v1.ShipmentRoute getRoutes(int index); + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + int getRoutesCount(); + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + java.util.List + getRoutesOrBuilderList(); + /** + * + * + *
+   * Routes of the solution to inject. Some routes may be omitted from the
+   * original solution. The routes and skipped shipments must satisfy the basic
+   * validity assumptions listed for `injected_first_solution_routes`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder(int index); + + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + java.util.List getSkippedShipmentsList(); + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + com.google.maps.routeoptimization.v1.SkippedShipment getSkippedShipments(int index); + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + int getSkippedShipmentsCount(); + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + java.util.List + getSkippedShipmentsOrBuilderList(); + /** + * + * + *
+   * Skipped shipments of the solution to inject. Some may be omitted from the
+   * original solution. See the `routes` field.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder getSkippedShipmentsOrBuilder( + int index); + + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + java.util.List< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation> + getConstraintRelaxationsList(); + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + getConstraintRelaxations(int index); + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + int getConstraintRelaxationsCount(); + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + java.util.List< + ? extends + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .ConstraintRelaxationOrBuilder> + getConstraintRelaxationsOrBuilderList(); + /** + * + * + *
+   * For zero or more groups of vehicles, specifies when and how much to relax
+   * constraints. If this field is empty, all non-empty vehicle routes are
+   * fully constrained.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxationOrBuilder + getConstraintRelaxationsOrBuilder(int index); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InputConfig.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InputConfig.java new file mode 100644 index 000000000000..196afa04e0a6 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InputConfig.java @@ -0,0 +1,984 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Specify an input for
+ * [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours].
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.InputConfig} + */ +public final class InputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.InputConfig) + InputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputConfig.newBuilder() to construct. + private InputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputConfig() { + dataFormat_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InputConfig.class, + com.google.maps.routeoptimization.v1.InputConfig.Builder.class); + } + + private int sourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_SOURCE(1), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return GCS_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * A Google Cloud Storage location. This must be a single object (file).
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * A Google Cloud Storage location. This must be a single object (file).
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSource getGcsSource() { + if (sourceCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsSource) source_; + } + return com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * A Google Cloud Storage location. This must be a single object (file).
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsSource) source_; + } + return com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } + + public static final int DATA_FORMAT_FIELD_NUMBER = 2; + private int dataFormat_ = 0; + /** + * + * + *
+   * Required. The input data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+   * Required. The input data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DataFormat getDataFormat() { + com.google.maps.routeoptimization.v1.DataFormat result = + com.google.maps.routeoptimization.v1.DataFormat.forNumber(dataFormat_); + return result == null ? com.google.maps.routeoptimization.v1.DataFormat.UNRECOGNIZED : result; + } + + 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 (sourceCase_ == 1) { + output.writeMessage(1, (com.google.maps.routeoptimization.v1.GcsSource) source_); + } + if (dataFormat_ + != com.google.maps.routeoptimization.v1.DataFormat.DATA_FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, dataFormat_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.maps.routeoptimization.v1.GcsSource) source_); + } + if (dataFormat_ + != com.google.maps.routeoptimization.v1.DataFormat.DATA_FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, dataFormat_); + } + 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.InputConfig)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.InputConfig other = + (com.google.maps.routeoptimization.v1.InputConfig) obj; + + if (dataFormat_ != other.dataFormat_) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATA_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + dataFormat_; + switch (sourceCase_) { + case 1: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.InputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InputConfig 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.InputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InputConfig 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.InputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.InputConfig 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.InputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InputConfig 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.InputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.InputConfig 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.InputConfig 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.InputConfig 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.InputConfig 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; + } + /** + * + * + *
+   * Specify an input for
+   * [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours].
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.InputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.InputConfig) + com.google.maps.routeoptimization.v1.InputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_InputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.InputConfig.class, + com.google.maps.routeoptimization.v1.InputConfig.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.InputConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.clear(); + } + dataFormat_ = 0; + sourceCase_ = 0; + source_ = 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_InputConfig_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InputConfig getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InputConfig build() { + com.google.maps.routeoptimization.v1.InputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.InputConfig buildPartial() { + com.google.maps.routeoptimization.v1.InputConfig result = + new com.google.maps.routeoptimization.v1.InputConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.InputConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataFormat_ = dataFormat_; + } + } + + private void buildPartialOneofs(com.google.maps.routeoptimization.v1.InputConfig result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 1 && gcsSourceBuilder_ != null) { + result.source_ = gcsSourceBuilder_.build(); + } + } + + @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.InputConfig) { + return mergeFrom((com.google.maps.routeoptimization.v1.InputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.InputConfig other) { + if (other == com.google.maps.routeoptimization.v1.InputConfig.getDefaultInstance()) + return this; + if (other.dataFormat_ != 0) { + setDataFormatValue(other.getDataFormatValue()); + } + switch (other.getSourceCase()) { + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 1; + break; + } // case 10 + case 16: + { + dataFormat_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.GcsSource, + com.google.maps.routeoptimization.v1.GcsSource.Builder, + com.google.maps.routeoptimization.v1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsSource) source_; + } + return com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.maps.routeoptimization.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource( + com.google.maps.routeoptimization.v1.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.maps.routeoptimization.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance()) { + source_ = + com.google.maps.routeoptimization.v1.GcsSource.newBuilder( + (com.google.maps.routeoptimization.v1.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + public com.google.maps.routeoptimization.v1.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 1) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsSource) source_; + } + return com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * A Google Cloud Storage location. This must be a single object (file).
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.GcsSource, + com.google.maps.routeoptimization.v1.GcsSource.Builder, + com.google.maps.routeoptimization.v1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.maps.routeoptimization.v1.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.GcsSource, + com.google.maps.routeoptimization.v1.GcsSource.Builder, + com.google.maps.routeoptimization.v1.GcsSourceOrBuilder>( + (com.google.maps.routeoptimization.v1.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + return gcsSourceBuilder_; + } + + private int dataFormat_ = 0; + /** + * + * + *
+     * Required. The input data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+     * Required. The input data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormatValue(int value) { + dataFormat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The input data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DataFormat getDataFormat() { + com.google.maps.routeoptimization.v1.DataFormat result = + com.google.maps.routeoptimization.v1.DataFormat.forNumber(dataFormat_); + return result == null ? com.google.maps.routeoptimization.v1.DataFormat.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. The input data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormat(com.google.maps.routeoptimization.v1.DataFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + dataFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The input data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataFormat() { + bitField0_ = (bitField0_ & ~0x00000002); + dataFormat_ = 0; + 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.InputConfig) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.InputConfig) + private static final com.google.maps.routeoptimization.v1.InputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.InputConfig(); + } + + public static com.google.maps.routeoptimization.v1.InputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputConfig 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.InputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InputConfigOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InputConfigOrBuilder.java new file mode 100644 index 000000000000..5b0025c46b98 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/InputConfigOrBuilder.java @@ -0,0 +1,92 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface InputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.InputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A Google Cloud Storage location. This must be a single object (file).
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * A Google Cloud Storage location. This must be a single object (file).
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + com.google.maps.routeoptimization.v1.GcsSource getGcsSource(); + /** + * + * + *
+   * A Google Cloud Storage location. This must be a single object (file).
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + */ + com.google.maps.routeoptimization.v1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * Required. The input data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + int getDataFormatValue(); + /** + * + * + *
+   * Required. The input data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataFormat. + */ + com.google.maps.routeoptimization.v1.DataFormat getDataFormat(); + + com.google.maps.routeoptimization.v1.InputConfig.SourceCase getSourceCase(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Location.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Location.java new file mode 100644 index 000000000000..1928760d102f --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Location.java @@ -0,0 +1,854 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Encapsulates a location (a geographic point, and an optional heading).
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Location} + */ +public final class Location extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Location) + LocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Location() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Location(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Location.class, + com.google.maps.routeoptimization.v1.Location.Builder.class); + } + + private int bitField0_; + public static final int LAT_LNG_FIELD_NUMBER = 1; + private com.google.type.LatLng latLng_; + /** + * + * + *
+   * The waypoint's geographic coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + * + * @return Whether the latLng field is set. + */ + @java.lang.Override + public boolean hasLatLng() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The waypoint's geographic coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + * + * @return The latLng. + */ + @java.lang.Override + public com.google.type.LatLng getLatLng() { + return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_; + } + /** + * + * + *
+   * The waypoint's geographic coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + @java.lang.Override + public com.google.type.LatLngOrBuilder getLatLngOrBuilder() { + return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_; + } + + public static final int HEADING_FIELD_NUMBER = 2; + private int heading_ = 0; + /** + * + * + *
+   * The compass heading associated with the direction of the flow of traffic.
+   * This value is used to specify the side of the road to use for pickup and
+   * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+   * of due North, 90 specifies a heading of due East, etc.
+   * 
+ * + * optional int32 heading = 2; + * + * @return Whether the heading field is set. + */ + @java.lang.Override + public boolean hasHeading() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The compass heading associated with the direction of the flow of traffic.
+   * This value is used to specify the side of the road to use for pickup and
+   * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+   * of due North, 90 specifies a heading of due East, etc.
+   * 
+ * + * optional int32 heading = 2; + * + * @return The heading. + */ + @java.lang.Override + public int getHeading() { + return heading_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getLatLng()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, heading_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLatLng()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, heading_); + } + 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.Location)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Location other = + (com.google.maps.routeoptimization.v1.Location) obj; + + if (hasLatLng() != other.hasLatLng()) return false; + if (hasLatLng()) { + if (!getLatLng().equals(other.getLatLng())) return false; + } + if (hasHeading() != other.hasHeading()) return false; + if (hasHeading()) { + if (getHeading() != other.getHeading()) 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 (hasLatLng()) { + hash = (37 * hash) + LAT_LNG_FIELD_NUMBER; + hash = (53 * hash) + getLatLng().hashCode(); + } + if (hasHeading()) { + hash = (37 * hash) + HEADING_FIELD_NUMBER; + hash = (53 * hash) + getHeading(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Location parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Location 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.Location parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Location 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.Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Location 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.Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Location 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.Location parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Location 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.Location 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.Location 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.Location 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; + } + /** + * + * + *
+   * Encapsulates a location (a geographic point, and an optional heading).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Location} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Location) + com.google.maps.routeoptimization.v1.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Location.class, + com.google.maps.routeoptimization.v1.Location.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Location.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLatLngFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + latLng_ = null; + if (latLngBuilder_ != null) { + latLngBuilder_.dispose(); + latLngBuilder_ = null; + } + heading_ = 0; + 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_Location_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Location getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Location build() { + com.google.maps.routeoptimization.v1.Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Location buildPartial() { + com.google.maps.routeoptimization.v1.Location result = + new com.google.maps.routeoptimization.v1.Location(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.Location result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.latLng_ = latLngBuilder_ == null ? latLng_ : latLngBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.heading_ = heading_; + to_bitField0_ |= 0x00000002; + } + 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.Location) { + return mergeFrom((com.google.maps.routeoptimization.v1.Location) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Location other) { + if (other == com.google.maps.routeoptimization.v1.Location.getDefaultInstance()) return this; + if (other.hasLatLng()) { + mergeLatLng(other.getLatLng()); + } + if (other.hasHeading()) { + setHeading(other.getHeading()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getLatLngFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + heading_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.type.LatLng latLng_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + latLngBuilder_; + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + * + * @return Whether the latLng field is set. + */ + public boolean hasLatLng() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + * + * @return The latLng. + */ + public com.google.type.LatLng getLatLng() { + if (latLngBuilder_ == null) { + return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_; + } else { + return latLngBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder setLatLng(com.google.type.LatLng value) { + if (latLngBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latLng_ = value; + } else { + latLngBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder setLatLng(com.google.type.LatLng.Builder builderForValue) { + if (latLngBuilder_ == null) { + latLng_ = builderForValue.build(); + } else { + latLngBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder mergeLatLng(com.google.type.LatLng value) { + if (latLngBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && latLng_ != null + && latLng_ != com.google.type.LatLng.getDefaultInstance()) { + getLatLngBuilder().mergeFrom(value); + } else { + latLng_ = value; + } + } else { + latLngBuilder_.mergeFrom(value); + } + if (latLng_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder clearLatLng() { + bitField0_ = (bitField0_ & ~0x00000001); + latLng_ = null; + if (latLngBuilder_ != null) { + latLngBuilder_.dispose(); + latLngBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLng.Builder getLatLngBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getLatLngFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLngOrBuilder getLatLngOrBuilder() { + if (latLngBuilder_ != null) { + return latLngBuilder_.getMessageOrBuilder(); + } else { + return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_; + } + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getLatLngFieldBuilder() { + if (latLngBuilder_ == null) { + latLngBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>(getLatLng(), getParentForChildren(), isClean()); + latLng_ = null; + } + return latLngBuilder_; + } + + private int heading_; + /** + * + * + *
+     * The compass heading associated with the direction of the flow of traffic.
+     * This value is used to specify the side of the road to use for pickup and
+     * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+     * of due North, 90 specifies a heading of due East, etc.
+     * 
+ * + * optional int32 heading = 2; + * + * @return Whether the heading field is set. + */ + @java.lang.Override + public boolean hasHeading() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The compass heading associated with the direction of the flow of traffic.
+     * This value is used to specify the side of the road to use for pickup and
+     * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+     * of due North, 90 specifies a heading of due East, etc.
+     * 
+ * + * optional int32 heading = 2; + * + * @return The heading. + */ + @java.lang.Override + public int getHeading() { + return heading_; + } + /** + * + * + *
+     * The compass heading associated with the direction of the flow of traffic.
+     * This value is used to specify the side of the road to use for pickup and
+     * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+     * of due North, 90 specifies a heading of due East, etc.
+     * 
+ * + * optional int32 heading = 2; + * + * @param value The heading to set. + * @return This builder for chaining. + */ + public Builder setHeading(int value) { + + heading_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The compass heading associated with the direction of the flow of traffic.
+     * This value is used to specify the side of the road to use for pickup and
+     * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+     * of due North, 90 specifies a heading of due East, etc.
+     * 
+ * + * optional int32 heading = 2; + * + * @return This builder for chaining. + */ + public Builder clearHeading() { + bitField0_ = (bitField0_ & ~0x00000002); + heading_ = 0; + 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.Location) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Location) + private static final com.google.maps.routeoptimization.v1.Location DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Location(); + } + + public static com.google.maps.routeoptimization.v1.Location getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Location 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.Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/LocationOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/LocationOrBuilder.java new file mode 100644 index 000000000000..bd25f511ef20 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/LocationOrBuilder.java @@ -0,0 +1,92 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface LocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Location) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The waypoint's geographic coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + * + * @return Whether the latLng field is set. + */ + boolean hasLatLng(); + /** + * + * + *
+   * The waypoint's geographic coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + * + * @return The latLng. + */ + com.google.type.LatLng getLatLng(); + /** + * + * + *
+   * The waypoint's geographic coordinates.
+   * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + com.google.type.LatLngOrBuilder getLatLngOrBuilder(); + + /** + * + * + *
+   * The compass heading associated with the direction of the flow of traffic.
+   * This value is used to specify the side of the road to use for pickup and
+   * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+   * of due North, 90 specifies a heading of due East, etc.
+   * 
+ * + * optional int32 heading = 2; + * + * @return Whether the heading field is set. + */ + boolean hasHeading(); + /** + * + * + *
+   * The compass heading associated with the direction of the flow of traffic.
+   * This value is used to specify the side of the road to use for pickup and
+   * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
+   * of due North, 90 specifies a heading of due East, etc.
+   * 
+ * + * optional int32 heading = 2; + * + * @return The heading. + */ + int getHeading(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursRequest.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursRequest.java new file mode 100644 index 000000000000..2b7bf55ae915 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursRequest.java @@ -0,0 +1,5820 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Request to be given to a tour optimization solver which defines the
+ * shipment model to solve as well as optimization parameters.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursRequest} + */ +public final class OptimizeToursRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.OptimizeToursRequest) + OptimizeToursRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use OptimizeToursRequest.newBuilder() to construct. + private OptimizeToursRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OptimizeToursRequest() { + parent_ = ""; + solvingMode_ = 0; + searchMode_ = 0; + injectedFirstSolutionRoutes_ = java.util.Collections.emptyList(); + refreshDetailsRoutes_ = java.util.Collections.emptyList(); + label_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OptimizeToursRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursRequest.class, + com.google.maps.routeoptimization.v1.OptimizeToursRequest.Builder.class); + } + + /** + * + * + *
+   * Defines how the solver should handle the request. In all modes but
+   * `VALIDATE_ONLY`, if the request is invalid, you will receive an
+   * `INVALID_REQUEST` error. See
+   * [max_validation_errors][google.maps.routeoptimization.v1.OptimizeToursRequest.max_validation_errors]
+   * to cap the number of errors returned.
+   * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode} + */ + public enum SolvingMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Solve the model.
+     * 
+ * + * DEFAULT_SOLVE = 0; + */ + DEFAULT_SOLVE(0), + /** + * + * + *
+     * Only validates the model without solving it: populates as many
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * as possible.
+     * 
+ * + * VALIDATE_ONLY = 1; + */ + VALIDATE_ONLY(1), + /** + * + * + *
+     * Only populates
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * or
+     * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments],
+     * and doesn't actually solve the rest of the request (`status` and `routes`
+     * are unset in the response).
+     * If infeasibilities in `injected_solution_constraint` routes are detected
+     * they are populated in the
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * field and
+     * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments]
+     * is left empty.
+     *
+     * *IMPORTANT*: not all infeasible shipments are returned here, but only the
+     * ones that are detected as infeasible during preprocessing.
+     * 
+ * + * DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + */ + DETECT_SOME_INFEASIBLE_SHIPMENTS(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Solve the model.
+     * 
+ * + * DEFAULT_SOLVE = 0; + */ + public static final int DEFAULT_SOLVE_VALUE = 0; + /** + * + * + *
+     * Only validates the model without solving it: populates as many
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * as possible.
+     * 
+ * + * VALIDATE_ONLY = 1; + */ + public static final int VALIDATE_ONLY_VALUE = 1; + /** + * + * + *
+     * Only populates
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * or
+     * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments],
+     * and doesn't actually solve the rest of the request (`status` and `routes`
+     * are unset in the response).
+     * If infeasibilities in `injected_solution_constraint` routes are detected
+     * they are populated in the
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * field and
+     * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments]
+     * is left empty.
+     *
+     * *IMPORTANT*: not all infeasible shipments are returned here, but only the
+     * ones that are detected as infeasible during preprocessing.
+     * 
+ * + * DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + */ + public static final int DETECT_SOME_INFEASIBLE_SHIPMENTS_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SolvingMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SolvingMode forNumber(int value) { + switch (value) { + case 0: + return DEFAULT_SOLVE; + case 1: + return VALIDATE_ONLY; + case 2: + return DETECT_SOME_INFEASIBLE_SHIPMENTS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SolvingMode findValueByNumber(int number) { + return SolvingMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.OptimizeToursRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SolvingMode[] VALUES = values(); + + public static SolvingMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SolvingMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode) + } + + /** + * + * + *
+   * Mode defining the behavior of the search, trading off latency versus
+   * solution quality. In all modes, the global request deadline is enforced.
+   * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode} + */ + public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified search mode, equivalent to `RETURN_FAST`.
+     * 
+ * + * SEARCH_MODE_UNSPECIFIED = 0; + */ + SEARCH_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Stop the search after finding the first good solution.
+     * 
+ * + * RETURN_FAST = 1; + */ + RETURN_FAST(1), + /** + * + * + *
+     * Spend all the available time to search for better solutions.
+     * 
+ * + * CONSUME_ALL_AVAILABLE_TIME = 2; + */ + CONSUME_ALL_AVAILABLE_TIME(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified search mode, equivalent to `RETURN_FAST`.
+     * 
+ * + * SEARCH_MODE_UNSPECIFIED = 0; + */ + public static final int SEARCH_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stop the search after finding the first good solution.
+     * 
+ * + * RETURN_FAST = 1; + */ + public static final int RETURN_FAST_VALUE = 1; + /** + * + * + *
+     * Spend all the available time to search for better solutions.
+     * 
+ * + * CONSUME_ALL_AVAILABLE_TIME = 2; + */ + public static final int CONSUME_ALL_AVAILABLE_TIME_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SearchMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SearchMode forNumber(int value) { + switch (value) { + case 0: + return SEARCH_MODE_UNSPECIFIED; + case 1: + return RETURN_FAST; + case 2: + return CONSUME_ALL_AVAILABLE_TIME; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SearchMode findValueByNumber(int number) { + return SearchMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.OptimizeToursRequest.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final SearchMode[] VALUES = values(); + + public static SearchMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SearchMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode) + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Target project or location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Target project or location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMEOUT_FIELD_NUMBER = 2; + private com.google.protobuf.Duration timeout_; + /** + * + * + *
+   * If this timeout is set, the server returns a response before the timeout
+   * period has elapsed or the server deadline for synchronous requests is
+   * reached, whichever is sooner.
+   *
+   * For asynchronous requests, the server will generate a solution (if
+   * possible) before the timeout has elapsed.
+   * 
+ * + * .google.protobuf.Duration timeout = 2; + * + * @return Whether the timeout field is set. + */ + @java.lang.Override + public boolean hasTimeout() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * If this timeout is set, the server returns a response before the timeout
+   * period has elapsed or the server deadline for synchronous requests is
+   * reached, whichever is sooner.
+   *
+   * For asynchronous requests, the server will generate a solution (if
+   * possible) before the timeout has elapsed.
+   * 
+ * + * .google.protobuf.Duration timeout = 2; + * + * @return The timeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getTimeout() { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + /** + * + * + *
+   * If this timeout is set, the server returns a response before the timeout
+   * period has elapsed or the server deadline for synchronous requests is
+   * reached, whichever is sooner.
+   *
+   * For asynchronous requests, the server will generate a solution (if
+   * possible) before the timeout has elapsed.
+   * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + + public static final int MODEL_FIELD_NUMBER = 3; + private com.google.maps.routeoptimization.v1.ShipmentModel model_; + /** + * + * + *
+   * Shipment model to solve.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * + * @return Whether the model field is set. + */ + @java.lang.Override + public boolean hasModel() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Shipment model to solve.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * + * @return The model. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentModel getModel() { + return model_ == null + ? com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance() + : model_; + } + /** + * + * + *
+   * Shipment model to solve.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder getModelOrBuilder() { + return model_ == null + ? com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance() + : model_; + } + + public static final int SOLVING_MODE_FIELD_NUMBER = 4; + private int solvingMode_ = 0; + /** + * + * + *
+   * By default, the solving mode is `DEFAULT_SOLVE` (0).
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return The enum numeric value on the wire for solvingMode. + */ + @java.lang.Override + public int getSolvingModeValue() { + return solvingMode_; + } + /** + * + * + *
+   * By default, the solving mode is `DEFAULT_SOLVE` (0).
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return The solvingMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode getSolvingMode() { + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode result = + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode.forNumber( + solvingMode_); + return result == null + ? com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode.UNRECOGNIZED + : result; + } + + public static final int SEARCH_MODE_FIELD_NUMBER = 6; + private int searchMode_ = 0; + /** + * + * + *
+   * Search mode used to solve the request.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * @return The enum numeric value on the wire for searchMode. + */ + @java.lang.Override + public int getSearchModeValue() { + return searchMode_; + } + /** + * + * + *
+   * Search mode used to solve the request.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * @return The searchMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode getSearchMode() { + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode result = + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode.forNumber(searchMode_); + return result == null + ? com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode.UNRECOGNIZED + : result; + } + + public static final int INJECTED_FIRST_SOLUTION_ROUTES_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List + injectedFirstSolutionRoutes_; + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + @java.lang.Override + public java.util.List + getInjectedFirstSolutionRoutesList() { + return injectedFirstSolutionRoutes_; + } + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + @java.lang.Override + public java.util.List + getInjectedFirstSolutionRoutesOrBuilderList() { + return injectedFirstSolutionRoutes_; + } + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + @java.lang.Override + public int getInjectedFirstSolutionRoutesCount() { + return injectedFirstSolutionRoutes_.size(); + } + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute getInjectedFirstSolutionRoutes( + int index) { + return injectedFirstSolutionRoutes_.get(index); + } + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder + getInjectedFirstSolutionRoutesOrBuilder(int index) { + return injectedFirstSolutionRoutes_.get(index); + } + + public static final int INJECTED_SOLUTION_CONSTRAINT_FIELD_NUMBER = 8; + private com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + injectedSolutionConstraint_; + /** + * + * + *
+   * Constrain the optimization algorithm to find a final solution that is
+   * similar to a previous solution. For example, this may be used to freeze
+   * portions of routes which have already been completed or which are to be
+   * completed but must not be modified.
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + * + * @return Whether the injectedSolutionConstraint field is set. + */ + @java.lang.Override + public boolean hasInjectedSolutionConstraint() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Constrain the optimization algorithm to find a final solution that is
+   * similar to a previous solution. For example, this may be used to freeze
+   * portions of routes which have already been completed or which are to be
+   * completed but must not be modified.
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + * + * @return The injectedSolutionConstraint. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + getInjectedSolutionConstraint() { + return injectedSolutionConstraint_ == null + ? com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.getDefaultInstance() + : injectedSolutionConstraint_; + } + /** + * + * + *
+   * Constrain the optimization algorithm to find a final solution that is
+   * similar to a previous solution. For example, this may be used to freeze
+   * portions of routes which have already been completed or which are to be
+   * completed but must not be modified.
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder + getInjectedSolutionConstraintOrBuilder() { + return injectedSolutionConstraint_ == null + ? com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.getDefaultInstance() + : injectedSolutionConstraint_; + } + + public static final int REFRESH_DETAILS_ROUTES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List refreshDetailsRoutes_; + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + @java.lang.Override + public java.util.List + getRefreshDetailsRoutesList() { + return refreshDetailsRoutes_; + } + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + @java.lang.Override + public java.util.List + getRefreshDetailsRoutesOrBuilderList() { + return refreshDetailsRoutes_; + } + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + @java.lang.Override + public int getRefreshDetailsRoutesCount() { + return refreshDetailsRoutes_.size(); + } + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute getRefreshDetailsRoutes(int index) { + return refreshDetailsRoutes_.get(index); + } + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder + getRefreshDetailsRoutesOrBuilder(int index) { + return refreshDetailsRoutes_.get(index); + } + + public static final int INTERPRET_INJECTED_SOLUTIONS_USING_LABELS_FIELD_NUMBER = 10; + private boolean interpretInjectedSolutionsUsingLabels_ = false; + /** + * + * + *
+   * If true:
+   *
+   *   * uses
+   *   [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label]
+   *   instead of `vehicle_index` to
+   *     match routes in an injected solution with vehicles in the request;
+   *     reuses the mapping of original
+   *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+   *     to new
+   *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+   *     to update
+   *     [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices]
+   *     if non-empty, but the mapping must be unambiguous (i.e., multiple
+   *     `ShipmentRoute`s must not share the same original `vehicle_index`).
+   *   * uses
+   *   [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label]
+   *   instead of `shipment_index`
+   *     to match visits in an injected solution with shipments in the request;
+   *   * uses
+   *   [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+   *   instead of
+   *   [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index]
+   *   to
+   *     match skipped shipments in the injected solution with request
+   *     shipments.
+   *
+   * This interpretation applies to the `injected_first_solution_routes`,
+   * `injected_solution_constraint`, and `refresh_details_routes` fields.
+   * It can be used when shipment or vehicle indices in the request have
+   * changed since the solution was created, perhaps because shipments or
+   * vehicles have been removed from or added to the request.
+   *
+   * If true, labels in the following categories must appear at most once in
+   * their category:
+   *
+   *   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the
+   *   request;
+   *   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in
+   *   the request;
+   *   * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution;
+   *   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in
+   *     the injected solution (except pickup/delivery visit pairs, whose
+   *     `shipment_label` must appear twice).
+   *
+   * If a `vehicle_label` in the injected solution does not correspond to a
+   * request vehicle, the corresponding route is removed from the solution
+   * along with its visits. If a `shipment_label` in the injected solution does
+   * not correspond to a request shipment, the corresponding visit is removed
+   * from the solution. If a
+   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+   * in the injected solution does not correspond to a request shipment, the
+   * `SkippedShipment` is removed from the solution.
+   *
+   * Removing route visits or entire routes from an injected solution may
+   * have an effect on the implied constraints, which may lead to change in
+   * solution, validation errors, or infeasibility.
+   *
+   * NOTE: The caller must ensure that each
+   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp.
+   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely
+   * identifies a vehicle (resp. shipment) entity used across the two relevant
+   * requests: the past request that produced the `OptimizeToursResponse` used
+   * in the injected solution and the current request that includes the injected
+   * solution. The uniqueness checks described above are not enough to guarantee
+   * this requirement.
+   * 
+ * + * bool interpret_injected_solutions_using_labels = 10; + * + * @return The interpretInjectedSolutionsUsingLabels. + */ + @java.lang.Override + public boolean getInterpretInjectedSolutionsUsingLabels() { + return interpretInjectedSolutionsUsingLabels_; + } + + public static final int CONSIDER_ROAD_TRAFFIC_FIELD_NUMBER = 11; + private boolean considerRoadTraffic_ = false; + /** + * + * + *
+   * Consider traffic estimation in calculating `ShipmentRoute` fields
+   * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration],
+   * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time],
+   * and `vehicle_end_time`; in setting the
+   * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities]
+   * field, and in calculating the
+   * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost]
+   * field.
+   * 
+ * + * bool consider_road_traffic = 11; + * + * @return The considerRoadTraffic. + */ + @java.lang.Override + public boolean getConsiderRoadTraffic() { + return considerRoadTraffic_; + } + + public static final int POPULATE_POLYLINES_FIELD_NUMBER = 12; + private boolean populatePolylines_ = false; + /** + * + * + *
+   * If true, polylines will be populated in response `ShipmentRoute`s.
+   * 
+ * + * bool populate_polylines = 12; + * + * @return The populatePolylines. + */ + @java.lang.Override + public boolean getPopulatePolylines() { + return populatePolylines_; + } + + public static final int POPULATE_TRANSITION_POLYLINES_FIELD_NUMBER = 13; + private boolean populateTransitionPolylines_ = false; + /** + * + * + *
+   * If true, polylines will be populated in response
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions].
+   * 
+ * + * bool populate_transition_polylines = 13; + * + * @return The populateTransitionPolylines. + */ + @java.lang.Override + public boolean getPopulateTransitionPolylines() { + return populateTransitionPolylines_; + } + + public static final int ALLOW_LARGE_DEADLINE_DESPITE_INTERRUPTION_RISK_FIELD_NUMBER = 14; + private boolean allowLargeDeadlineDespiteInterruptionRisk_ = false; + /** + * + * + *
+   * If this is set, then the request can have a deadline
+   * (see https://grpc.io/blog/deadlines) of up to 60 minutes.
+   * Otherwise, the maximum deadline is only 30 minutes.
+   * Note that long-lived requests have a significantly larger (but still small)
+   * risk of interruption.
+   * 
+ * + * bool allow_large_deadline_despite_interruption_risk = 14; + * + * @return The allowLargeDeadlineDespiteInterruptionRisk. + */ + @java.lang.Override + public boolean getAllowLargeDeadlineDespiteInterruptionRisk() { + return allowLargeDeadlineDespiteInterruptionRisk_; + } + + public static final int USE_GEODESIC_DISTANCES_FIELD_NUMBER = 15; + private boolean useGeodesicDistances_ = false; + /** + * + * + *
+   * If true, travel distances will be computed using geodesic distances instead
+   * of Google Maps distances, and travel times will be computed using geodesic
+   * distances with a speed defined by `geodesic_meters_per_second`.
+   * 
+ * + * bool use_geodesic_distances = 15; + * + * @return The useGeodesicDistances. + */ + @java.lang.Override + public boolean getUseGeodesicDistances() { + return useGeodesicDistances_; + } + + public static final int GEODESIC_METERS_PER_SECOND_FIELD_NUMBER = 16; + private double geodesicMetersPerSecond_ = 0D; + /** + * + * + *
+   * When `use_geodesic_distances` is true, this field must be set and defines
+   * the speed applied to compute travel times. Its value must be at least 1.0
+   * meters/seconds.
+   * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return Whether the geodesicMetersPerSecond field is set. + */ + @java.lang.Override + public boolean hasGeodesicMetersPerSecond() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * When `use_geodesic_distances` is true, this field must be set and defines
+   * the speed applied to compute travel times. Its value must be at least 1.0
+   * meters/seconds.
+   * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return The geodesicMetersPerSecond. + */ + @java.lang.Override + public double getGeodesicMetersPerSecond() { + return geodesicMetersPerSecond_; + } + + public static final int MAX_VALIDATION_ERRORS_FIELD_NUMBER = 5; + private int maxValidationErrors_ = 0; + /** + * + * + *
+   * Truncates the number of validation errors returned. These errors are
+   * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+   * error detail (https://cloud.google.com/apis/design/errors#error_details),
+   * unless solving_mode=VALIDATE_ONLY: see the
+   * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+   * field.
+   * This defaults to 100 and is capped at 10,000.
+   * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return Whether the maxValidationErrors field is set. + */ + @java.lang.Override + public boolean hasMaxValidationErrors() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Truncates the number of validation errors returned. These errors are
+   * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+   * error detail (https://cloud.google.com/apis/design/errors#error_details),
+   * unless solving_mode=VALIDATE_ONLY: see the
+   * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+   * field.
+   * This defaults to 100 and is capped at 10,000.
+   * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return The maxValidationErrors. + */ + @java.lang.Override + public int getMaxValidationErrors() { + return maxValidationErrors_; + } + + public static final int LABEL_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object label_ = ""; + /** + * + * + *
+   * Label that may be used to identify this request, reported back in the
+   * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+   * 
+ * + * string label = 17; + * + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + * + * + *
+   * Label that may be used to identify this request, reported back in the
+   * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+   * 
+ * + * string label = 17; + * + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTimeout()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getModel()); + } + if (solvingMode_ + != com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode.DEFAULT_SOLVE + .getNumber()) { + output.writeEnum(4, solvingMode_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeInt32(5, maxValidationErrors_); + } + if (searchMode_ + != com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode + .SEARCH_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, searchMode_); + } + for (int i = 0; i < injectedFirstSolutionRoutes_.size(); i++) { + output.writeMessage(7, injectedFirstSolutionRoutes_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getInjectedSolutionConstraint()); + } + for (int i = 0; i < refreshDetailsRoutes_.size(); i++) { + output.writeMessage(9, refreshDetailsRoutes_.get(i)); + } + if (interpretInjectedSolutionsUsingLabels_ != false) { + output.writeBool(10, interpretInjectedSolutionsUsingLabels_); + } + if (considerRoadTraffic_ != false) { + output.writeBool(11, considerRoadTraffic_); + } + if (populatePolylines_ != false) { + output.writeBool(12, populatePolylines_); + } + if (populateTransitionPolylines_ != false) { + output.writeBool(13, populateTransitionPolylines_); + } + if (allowLargeDeadlineDespiteInterruptionRisk_ != false) { + output.writeBool(14, allowLargeDeadlineDespiteInterruptionRisk_); + } + if (useGeodesicDistances_ != false) { + output.writeBool(15, useGeodesicDistances_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(16, geodesicMetersPerSecond_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, label_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTimeout()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getModel()); + } + if (solvingMode_ + != com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode.DEFAULT_SOLVE + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, solvingMode_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxValidationErrors_); + } + if (searchMode_ + != com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode + .SEARCH_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, searchMode_); + } + for (int i = 0; i < injectedFirstSolutionRoutes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, injectedFirstSolutionRoutes_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, getInjectedSolutionConstraint()); + } + for (int i = 0; i < refreshDetailsRoutes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, refreshDetailsRoutes_.get(i)); + } + if (interpretInjectedSolutionsUsingLabels_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 10, interpretInjectedSolutionsUsingLabels_); + } + if (considerRoadTraffic_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, considerRoadTraffic_); + } + if (populatePolylines_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, populatePolylines_); + } + if (populateTransitionPolylines_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(13, populateTransitionPolylines_); + } + if (allowLargeDeadlineDespiteInterruptionRisk_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 14, allowLargeDeadlineDespiteInterruptionRisk_); + } + if (useGeodesicDistances_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, useGeodesicDistances_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(16, geodesicMetersPerSecond_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, label_); + } + 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.OptimizeToursRequest)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.OptimizeToursRequest other = + (com.google.maps.routeoptimization.v1.OptimizeToursRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasTimeout() != other.hasTimeout()) return false; + if (hasTimeout()) { + if (!getTimeout().equals(other.getTimeout())) return false; + } + if (hasModel() != other.hasModel()) return false; + if (hasModel()) { + if (!getModel().equals(other.getModel())) return false; + } + if (solvingMode_ != other.solvingMode_) return false; + if (searchMode_ != other.searchMode_) return false; + if (!getInjectedFirstSolutionRoutesList().equals(other.getInjectedFirstSolutionRoutesList())) + return false; + if (hasInjectedSolutionConstraint() != other.hasInjectedSolutionConstraint()) return false; + if (hasInjectedSolutionConstraint()) { + if (!getInjectedSolutionConstraint().equals(other.getInjectedSolutionConstraint())) + return false; + } + if (!getRefreshDetailsRoutesList().equals(other.getRefreshDetailsRoutesList())) return false; + if (getInterpretInjectedSolutionsUsingLabels() + != other.getInterpretInjectedSolutionsUsingLabels()) return false; + if (getConsiderRoadTraffic() != other.getConsiderRoadTraffic()) return false; + if (getPopulatePolylines() != other.getPopulatePolylines()) return false; + if (getPopulateTransitionPolylines() != other.getPopulateTransitionPolylines()) return false; + if (getAllowLargeDeadlineDespiteInterruptionRisk() + != other.getAllowLargeDeadlineDespiteInterruptionRisk()) return false; + if (getUseGeodesicDistances() != other.getUseGeodesicDistances()) return false; + if (hasGeodesicMetersPerSecond() != other.hasGeodesicMetersPerSecond()) return false; + if (hasGeodesicMetersPerSecond()) { + if (java.lang.Double.doubleToLongBits(getGeodesicMetersPerSecond()) + != java.lang.Double.doubleToLongBits(other.getGeodesicMetersPerSecond())) return false; + } + if (hasMaxValidationErrors() != other.hasMaxValidationErrors()) return false; + if (hasMaxValidationErrors()) { + if (getMaxValidationErrors() != other.getMaxValidationErrors()) return false; + } + if (!getLabel().equals(other.getLabel())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasTimeout()) { + hash = (37 * hash) + TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getTimeout().hashCode(); + } + if (hasModel()) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + } + hash = (37 * hash) + SOLVING_MODE_FIELD_NUMBER; + hash = (53 * hash) + solvingMode_; + hash = (37 * hash) + SEARCH_MODE_FIELD_NUMBER; + hash = (53 * hash) + searchMode_; + if (getInjectedFirstSolutionRoutesCount() > 0) { + hash = (37 * hash) + INJECTED_FIRST_SOLUTION_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getInjectedFirstSolutionRoutesList().hashCode(); + } + if (hasInjectedSolutionConstraint()) { + hash = (37 * hash) + INJECTED_SOLUTION_CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getInjectedSolutionConstraint().hashCode(); + } + if (getRefreshDetailsRoutesCount() > 0) { + hash = (37 * hash) + REFRESH_DETAILS_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getRefreshDetailsRoutesList().hashCode(); + } + hash = (37 * hash) + INTERPRET_INJECTED_SOLUTIONS_USING_LABELS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getInterpretInjectedSolutionsUsingLabels()); + hash = (37 * hash) + CONSIDER_ROAD_TRAFFIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getConsiderRoadTraffic()); + hash = (37 * hash) + POPULATE_POLYLINES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPopulatePolylines()); + hash = (37 * hash) + POPULATE_TRANSITION_POLYLINES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPopulateTransitionPolylines()); + hash = (37 * hash) + ALLOW_LARGE_DEADLINE_DESPITE_INTERRUPTION_RISK_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean( + getAllowLargeDeadlineDespiteInterruptionRisk()); + hash = (37 * hash) + USE_GEODESIC_DISTANCES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseGeodesicDistances()); + if (hasGeodesicMetersPerSecond()) { + hash = (37 * hash) + GEODESIC_METERS_PER_SECOND_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getGeodesicMetersPerSecond())); + } + if (hasMaxValidationErrors()) { + hash = (37 * hash) + MAX_VALIDATION_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getMaxValidationErrors(); + } + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest 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.OptimizeToursRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest 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.OptimizeToursRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest 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.OptimizeToursRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest 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.OptimizeToursRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest 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.OptimizeToursRequest 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.OptimizeToursRequest 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.OptimizeToursRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request to be given to a tour optimization solver which defines the
+   * shipment model to solve as well as optimization parameters.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.OptimizeToursRequest) + com.google.maps.routeoptimization.v1.OptimizeToursRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursRequest.class, + com.google.maps.routeoptimization.v1.OptimizeToursRequest.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.OptimizeToursRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTimeoutFieldBuilder(); + getModelFieldBuilder(); + getInjectedFirstSolutionRoutesFieldBuilder(); + getInjectedSolutionConstraintFieldBuilder(); + getRefreshDetailsRoutesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + timeout_ = null; + if (timeoutBuilder_ != null) { + timeoutBuilder_.dispose(); + timeoutBuilder_ = null; + } + model_ = null; + if (modelBuilder_ != null) { + modelBuilder_.dispose(); + modelBuilder_ = null; + } + solvingMode_ = 0; + searchMode_ = 0; + if (injectedFirstSolutionRoutesBuilder_ == null) { + injectedFirstSolutionRoutes_ = java.util.Collections.emptyList(); + } else { + injectedFirstSolutionRoutes_ = null; + injectedFirstSolutionRoutesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + injectedSolutionConstraint_ = null; + if (injectedSolutionConstraintBuilder_ != null) { + injectedSolutionConstraintBuilder_.dispose(); + injectedSolutionConstraintBuilder_ = null; + } + if (refreshDetailsRoutesBuilder_ == null) { + refreshDetailsRoutes_ = java.util.Collections.emptyList(); + } else { + refreshDetailsRoutes_ = null; + refreshDetailsRoutesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + interpretInjectedSolutionsUsingLabels_ = false; + considerRoadTraffic_ = false; + populatePolylines_ = false; + populateTransitionPolylines_ = false; + allowLargeDeadlineDespiteInterruptionRisk_ = false; + useGeodesicDistances_ = false; + geodesicMetersPerSecond_ = 0D; + maxValidationErrors_ = 0; + label_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.OptimizeToursRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest build() { + com.google.maps.routeoptimization.v1.OptimizeToursRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest buildPartial() { + com.google.maps.routeoptimization.v1.OptimizeToursRequest result = + new com.google.maps.routeoptimization.v1.OptimizeToursRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.OptimizeToursRequest result) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + injectedFirstSolutionRoutes_ = + java.util.Collections.unmodifiableList(injectedFirstSolutionRoutes_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.injectedFirstSolutionRoutes_ = injectedFirstSolutionRoutes_; + } else { + result.injectedFirstSolutionRoutes_ = injectedFirstSolutionRoutesBuilder_.build(); + } + if (refreshDetailsRoutesBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + refreshDetailsRoutes_ = java.util.Collections.unmodifiableList(refreshDetailsRoutes_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.refreshDetailsRoutes_ = refreshDetailsRoutes_; + } else { + result.refreshDetailsRoutes_ = refreshDetailsRoutesBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.OptimizeToursRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timeout_ = timeoutBuilder_ == null ? timeout_ : timeoutBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.model_ = modelBuilder_ == null ? model_ : modelBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.solvingMode_ = solvingMode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.searchMode_ = searchMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.injectedSolutionConstraint_ = + injectedSolutionConstraintBuilder_ == null + ? injectedSolutionConstraint_ + : injectedSolutionConstraintBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.interpretInjectedSolutionsUsingLabels_ = interpretInjectedSolutionsUsingLabels_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.considerRoadTraffic_ = considerRoadTraffic_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.populatePolylines_ = populatePolylines_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.populateTransitionPolylines_ = populateTransitionPolylines_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.allowLargeDeadlineDespiteInterruptionRisk_ = + allowLargeDeadlineDespiteInterruptionRisk_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.useGeodesicDistances_ = useGeodesicDistances_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.geodesicMetersPerSecond_ = geodesicMetersPerSecond_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.maxValidationErrors_ = maxValidationErrors_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.label_ = label_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.maps.routeoptimization.v1.OptimizeToursRequest) { + return mergeFrom((com.google.maps.routeoptimization.v1.OptimizeToursRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.OptimizeToursRequest other) { + if (other == com.google.maps.routeoptimization.v1.OptimizeToursRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTimeout()) { + mergeTimeout(other.getTimeout()); + } + if (other.hasModel()) { + mergeModel(other.getModel()); + } + if (other.solvingMode_ != 0) { + setSolvingModeValue(other.getSolvingModeValue()); + } + if (other.searchMode_ != 0) { + setSearchModeValue(other.getSearchModeValue()); + } + if (injectedFirstSolutionRoutesBuilder_ == null) { + if (!other.injectedFirstSolutionRoutes_.isEmpty()) { + if (injectedFirstSolutionRoutes_.isEmpty()) { + injectedFirstSolutionRoutes_ = other.injectedFirstSolutionRoutes_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.addAll(other.injectedFirstSolutionRoutes_); + } + onChanged(); + } + } else { + if (!other.injectedFirstSolutionRoutes_.isEmpty()) { + if (injectedFirstSolutionRoutesBuilder_.isEmpty()) { + injectedFirstSolutionRoutesBuilder_.dispose(); + injectedFirstSolutionRoutesBuilder_ = null; + injectedFirstSolutionRoutes_ = other.injectedFirstSolutionRoutes_; + bitField0_ = (bitField0_ & ~0x00000020); + injectedFirstSolutionRoutesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInjectedFirstSolutionRoutesFieldBuilder() + : null; + } else { + injectedFirstSolutionRoutesBuilder_.addAllMessages(other.injectedFirstSolutionRoutes_); + } + } + } + if (other.hasInjectedSolutionConstraint()) { + mergeInjectedSolutionConstraint(other.getInjectedSolutionConstraint()); + } + if (refreshDetailsRoutesBuilder_ == null) { + if (!other.refreshDetailsRoutes_.isEmpty()) { + if (refreshDetailsRoutes_.isEmpty()) { + refreshDetailsRoutes_ = other.refreshDetailsRoutes_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.addAll(other.refreshDetailsRoutes_); + } + onChanged(); + } + } else { + if (!other.refreshDetailsRoutes_.isEmpty()) { + if (refreshDetailsRoutesBuilder_.isEmpty()) { + refreshDetailsRoutesBuilder_.dispose(); + refreshDetailsRoutesBuilder_ = null; + refreshDetailsRoutes_ = other.refreshDetailsRoutes_; + bitField0_ = (bitField0_ & ~0x00000080); + refreshDetailsRoutesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRefreshDetailsRoutesFieldBuilder() + : null; + } else { + refreshDetailsRoutesBuilder_.addAllMessages(other.refreshDetailsRoutes_); + } + } + } + if (other.getInterpretInjectedSolutionsUsingLabels() != false) { + setInterpretInjectedSolutionsUsingLabels(other.getInterpretInjectedSolutionsUsingLabels()); + } + if (other.getConsiderRoadTraffic() != false) { + setConsiderRoadTraffic(other.getConsiderRoadTraffic()); + } + if (other.getPopulatePolylines() != false) { + setPopulatePolylines(other.getPopulatePolylines()); + } + if (other.getPopulateTransitionPolylines() != false) { + setPopulateTransitionPolylines(other.getPopulateTransitionPolylines()); + } + if (other.getAllowLargeDeadlineDespiteInterruptionRisk() != false) { + setAllowLargeDeadlineDespiteInterruptionRisk( + other.getAllowLargeDeadlineDespiteInterruptionRisk()); + } + if (other.getUseGeodesicDistances() != false) { + setUseGeodesicDistances(other.getUseGeodesicDistances()); + } + if (other.hasGeodesicMetersPerSecond()) { + setGeodesicMetersPerSecond(other.getGeodesicMetersPerSecond()); + } + if (other.hasMaxValidationErrors()) { + setMaxValidationErrors(other.getMaxValidationErrors()); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + bitField0_ |= 0x00010000; + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getModelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + solvingMode_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + maxValidationErrors_ = input.readInt32(); + bitField0_ |= 0x00008000; + break; + } // case 40 + case 48: + { + searchMode_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 58: + { + com.google.maps.routeoptimization.v1.ShipmentRoute m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.parser(), + extensionRegistry); + if (injectedFirstSolutionRoutesBuilder_ == null) { + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.add(m); + } else { + injectedFirstSolutionRoutesBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + input.readMessage( + getInjectedSolutionConstraintFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + case 74: + { + com.google.maps.routeoptimization.v1.ShipmentRoute m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.parser(), + extensionRegistry); + if (refreshDetailsRoutesBuilder_ == null) { + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.add(m); + } else { + refreshDetailsRoutesBuilder_.addMessage(m); + } + break; + } // case 74 + case 80: + { + interpretInjectedSolutionsUsingLabels_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 88: + { + considerRoadTraffic_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 96: + { + populatePolylines_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 96 + case 104: + { + populateTransitionPolylines_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 104 + case 112: + { + allowLargeDeadlineDespiteInterruptionRisk_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 112 + case 120: + { + useGeodesicDistances_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 120 + case 129: + { + geodesicMetersPerSecond_ = input.readDouble(); + bitField0_ |= 0x00004000; + break; + } // case 129 + case 138: + { + label_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 138 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Target project or location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Target project or location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Target project or location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target project or location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target project or location to make a call.
+     *
+     * Format:
+     * * `projects/{project-id}`
+     * * `projects/{project-id}/locations/{location-id}`
+     *
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Duration timeout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + timeoutBuilder_; + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + * + * @return Whether the timeout field is set. + */ + public boolean hasTimeout() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + * + * @return The timeout. + */ + public com.google.protobuf.Duration getTimeout() { + if (timeoutBuilder_ == null) { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } else { + return timeoutBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + public Builder setTimeout(com.google.protobuf.Duration value) { + if (timeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeout_ = value; + } else { + timeoutBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (timeoutBuilder_ == null) { + timeout_ = builderForValue.build(); + } else { + timeoutBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + public Builder mergeTimeout(com.google.protobuf.Duration value) { + if (timeoutBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && timeout_ != null + && timeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTimeoutBuilder().mergeFrom(value); + } else { + timeout_ = value; + } + } else { + timeoutBuilder_.mergeFrom(value); + } + if (timeout_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + public Builder clearTimeout() { + bitField0_ = (bitField0_ & ~0x00000002); + timeout_ = null; + if (timeoutBuilder_ != null) { + timeoutBuilder_.dispose(); + timeoutBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + public com.google.protobuf.Duration.Builder getTimeoutBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTimeoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { + if (timeoutBuilder_ != null) { + return timeoutBuilder_.getMessageOrBuilder(); + } else { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + } + /** + * + * + *
+     * If this timeout is set, the server returns a response before the timeout
+     * period has elapsed or the server deadline for synchronous requests is
+     * reached, whichever is sooner.
+     *
+     * For asynchronous requests, the server will generate a solution (if
+     * possible) before the timeout has elapsed.
+     * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTimeoutFieldBuilder() { + if (timeoutBuilder_ == null) { + timeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTimeout(), getParentForChildren(), isClean()); + timeout_ = null; + } + return timeoutBuilder_; + } + + private com.google.maps.routeoptimization.v1.ShipmentModel model_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentModel, + com.google.maps.routeoptimization.v1.ShipmentModel.Builder, + com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder> + modelBuilder_; + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * + * @return Whether the model field is set. + */ + public boolean hasModel() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * + * @return The model. + */ + public com.google.maps.routeoptimization.v1.ShipmentModel getModel() { + if (modelBuilder_ == null) { + return model_ == null + ? com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance() + : model_; + } else { + return modelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + public Builder setModel(com.google.maps.routeoptimization.v1.ShipmentModel value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + } else { + modelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + public Builder setModel( + com.google.maps.routeoptimization.v1.ShipmentModel.Builder builderForValue) { + if (modelBuilder_ == null) { + model_ = builderForValue.build(); + } else { + modelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + public Builder mergeModel(com.google.maps.routeoptimization.v1.ShipmentModel value) { + if (modelBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && model_ != null + && model_ != com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance()) { + getModelBuilder().mergeFrom(value); + } else { + model_ = value; + } + } else { + modelBuilder_.mergeFrom(value); + } + if (model_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + public Builder clearModel() { + bitField0_ = (bitField0_ & ~0x00000004); + model_ = null; + if (modelBuilder_ != null) { + modelBuilder_.dispose(); + modelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + public com.google.maps.routeoptimization.v1.ShipmentModel.Builder getModelBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + public com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder getModelOrBuilder() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilder(); + } else { + return model_ == null + ? com.google.maps.routeoptimization.v1.ShipmentModel.getDefaultInstance() + : model_; + } + } + /** + * + * + *
+     * Shipment model to solve.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentModel, + com.google.maps.routeoptimization.v1.ShipmentModel.Builder, + com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentModel, + com.google.maps.routeoptimization.v1.ShipmentModel.Builder, + com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder>( + getModel(), getParentForChildren(), isClean()); + model_ = null; + } + return modelBuilder_; + } + + private int solvingMode_ = 0; + /** + * + * + *
+     * By default, the solving mode is `DEFAULT_SOLVE` (0).
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return The enum numeric value on the wire for solvingMode. + */ + @java.lang.Override + public int getSolvingModeValue() { + return solvingMode_; + } + /** + * + * + *
+     * By default, the solving mode is `DEFAULT_SOLVE` (0).
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @param value The enum numeric value on the wire for solvingMode to set. + * @return This builder for chaining. + */ + public Builder setSolvingModeValue(int value) { + solvingMode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * By default, the solving mode is `DEFAULT_SOLVE` (0).
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return The solvingMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode getSolvingMode() { + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode result = + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode.forNumber( + solvingMode_); + return result == null + ? com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * By default, the solving mode is `DEFAULT_SOLVE` (0).
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @param value The solvingMode to set. + * @return This builder for chaining. + */ + public Builder setSolvingMode( + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + solvingMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * By default, the solving mode is `DEFAULT_SOLVE` (0).
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearSolvingMode() { + bitField0_ = (bitField0_ & ~0x00000008); + solvingMode_ = 0; + onChanged(); + return this; + } + + private int searchMode_ = 0; + /** + * + * + *
+     * Search mode used to solve the request.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * + * @return The enum numeric value on the wire for searchMode. + */ + @java.lang.Override + public int getSearchModeValue() { + return searchMode_; + } + /** + * + * + *
+     * Search mode used to solve the request.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * + * @param value The enum numeric value on the wire for searchMode to set. + * @return This builder for chaining. + */ + public Builder setSearchModeValue(int value) { + searchMode_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Search mode used to solve the request.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * + * @return The searchMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode getSearchMode() { + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode result = + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode.forNumber( + searchMode_); + return result == null + ? com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Search mode used to solve the request.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * + * @param value The searchMode to set. + * @return This builder for chaining. + */ + public Builder setSearchMode( + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + searchMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Search mode used to solve the request.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearSearchMode() { + bitField0_ = (bitField0_ & ~0x00000010); + searchMode_ = 0; + onChanged(); + return this; + } + + private java.util.List + injectedFirstSolutionRoutes_ = java.util.Collections.emptyList(); + + private void ensureInjectedFirstSolutionRoutesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + injectedFirstSolutionRoutes_ = + new java.util.ArrayList( + injectedFirstSolutionRoutes_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + injectedFirstSolutionRoutesBuilder_; + + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public java.util.List + getInjectedFirstSolutionRoutesList() { + if (injectedFirstSolutionRoutesBuilder_ == null) { + return java.util.Collections.unmodifiableList(injectedFirstSolutionRoutes_); + } else { + return injectedFirstSolutionRoutesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public int getInjectedFirstSolutionRoutesCount() { + if (injectedFirstSolutionRoutesBuilder_ == null) { + return injectedFirstSolutionRoutes_.size(); + } else { + return injectedFirstSolutionRoutesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute getInjectedFirstSolutionRoutes( + int index) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + return injectedFirstSolutionRoutes_.get(index); + } else { + return injectedFirstSolutionRoutesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder setInjectedFirstSolutionRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.set(index, value); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder setInjectedFirstSolutionRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.set(index, builderForValue.build()); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder addInjectedFirstSolutionRoutes( + com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.add(value); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder addInjectedFirstSolutionRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.add(index, value); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder addInjectedFirstSolutionRoutes( + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.add(builderForValue.build()); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder addInjectedFirstSolutionRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.add(index, builderForValue.build()); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder addAllInjectedFirstSolutionRoutes( + java.lang.Iterable values) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + ensureInjectedFirstSolutionRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, injectedFirstSolutionRoutes_); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder clearInjectedFirstSolutionRoutes() { + if (injectedFirstSolutionRoutesBuilder_ == null) { + injectedFirstSolutionRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public Builder removeInjectedFirstSolutionRoutes(int index) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + ensureInjectedFirstSolutionRoutesIsMutable(); + injectedFirstSolutionRoutes_.remove(index); + onChanged(); + } else { + injectedFirstSolutionRoutesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder + getInjectedFirstSolutionRoutesBuilder(int index) { + return getInjectedFirstSolutionRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder + getInjectedFirstSolutionRoutesOrBuilder(int index) { + if (injectedFirstSolutionRoutesBuilder_ == null) { + return injectedFirstSolutionRoutes_.get(index); + } else { + return injectedFirstSolutionRoutesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public java.util.List + getInjectedFirstSolutionRoutesOrBuilderList() { + if (injectedFirstSolutionRoutesBuilder_ != null) { + return injectedFirstSolutionRoutesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(injectedFirstSolutionRoutes_); + } + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder + addInjectedFirstSolutionRoutesBuilder() { + return getInjectedFirstSolutionRoutesFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder + addInjectedFirstSolutionRoutesBuilder(int index) { + return getInjectedFirstSolutionRoutesFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Guide the optimization algorithm in finding a first solution that is
+     * similar to a previous solution.
+     *
+     * The model is constrained when the first solution is built.
+     * Any shipments not performed on a route are implicitly skipped in the first
+     * solution, but they may be performed in successive solutions.
+     *
+     * The solution must satisfy some basic validity assumptions:
+     *
+     *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+     *   * for all visits, `shipment_index` and `visit_request_index` must be
+     *     in range.
+     *   * a shipment may only be referenced on one route.
+     *   * the pickup of a pickup-delivery shipment must be performed before
+     *     the delivery.
+     *   * no more than one pickup alternative or delivery alternative of
+     *     a shipment may be performed.
+     *   * for all routes, times are increasing (i.e., `vehicle_start_time
+     *     <= visits[0].start_time <= visits[1].start_time ...
+     *     <= vehicle_end_time`).
+     *   * a shipment may only be performed on a vehicle that is allowed. A
+     *     vehicle is allowed if
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+     *     is empty or its `vehicle_index` is included in
+     *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + public java.util.List + getInjectedFirstSolutionRoutesBuilderList() { + return getInjectedFirstSolutionRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + getInjectedFirstSolutionRoutesFieldBuilder() { + if (injectedFirstSolutionRoutesBuilder_ == null) { + injectedFirstSolutionRoutesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder>( + injectedFirstSolutionRoutes_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + injectedFirstSolutionRoutes_ = null; + } + return injectedFirstSolutionRoutesBuilder_; + } + + private com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + injectedSolutionConstraint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder> + injectedSolutionConstraintBuilder_; + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + * + * @return Whether the injectedSolutionConstraint field is set. + */ + public boolean hasInjectedSolutionConstraint() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + * + * @return The injectedSolutionConstraint. + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + getInjectedSolutionConstraint() { + if (injectedSolutionConstraintBuilder_ == null) { + return injectedSolutionConstraint_ == null + ? com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.getDefaultInstance() + : injectedSolutionConstraint_; + } else { + return injectedSolutionConstraintBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + public Builder setInjectedSolutionConstraint( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint value) { + if (injectedSolutionConstraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + injectedSolutionConstraint_ = value; + } else { + injectedSolutionConstraintBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + public Builder setInjectedSolutionConstraint( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder builderForValue) { + if (injectedSolutionConstraintBuilder_ == null) { + injectedSolutionConstraint_ = builderForValue.build(); + } else { + injectedSolutionConstraintBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + public Builder mergeInjectedSolutionConstraint( + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint value) { + if (injectedSolutionConstraintBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && injectedSolutionConstraint_ != null + && injectedSolutionConstraint_ + != com.google.maps.routeoptimization.v1.InjectedSolutionConstraint + .getDefaultInstance()) { + getInjectedSolutionConstraintBuilder().mergeFrom(value); + } else { + injectedSolutionConstraint_ = value; + } + } else { + injectedSolutionConstraintBuilder_.mergeFrom(value); + } + if (injectedSolutionConstraint_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + public Builder clearInjectedSolutionConstraint() { + bitField0_ = (bitField0_ & ~0x00000040); + injectedSolutionConstraint_ = null; + if (injectedSolutionConstraintBuilder_ != null) { + injectedSolutionConstraintBuilder_.dispose(); + injectedSolutionConstraintBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder + getInjectedSolutionConstraintBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getInjectedSolutionConstraintFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + public com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder + getInjectedSolutionConstraintOrBuilder() { + if (injectedSolutionConstraintBuilder_ != null) { + return injectedSolutionConstraintBuilder_.getMessageOrBuilder(); + } else { + return injectedSolutionConstraint_ == null + ? com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.getDefaultInstance() + : injectedSolutionConstraint_; + } + } + /** + * + * + *
+     * Constrain the optimization algorithm to find a final solution that is
+     * similar to a previous solution. For example, this may be used to freeze
+     * portions of routes which have already been completed or which are to be
+     * completed but must not be modified.
+     *
+     * If the injected solution is not feasible, a validation error is not
+     * necessarily returned and an error indicating infeasibility may be returned
+     * instead.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder> + getInjectedSolutionConstraintFieldBuilder() { + if (injectedSolutionConstraintBuilder_ == null) { + injectedSolutionConstraintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint.Builder, + com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder>( + getInjectedSolutionConstraint(), getParentForChildren(), isClean()); + injectedSolutionConstraint_ = null; + } + return injectedSolutionConstraintBuilder_; + } + + private java.util.List + refreshDetailsRoutes_ = java.util.Collections.emptyList(); + + private void ensureRefreshDetailsRoutesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + refreshDetailsRoutes_ = + new java.util.ArrayList( + refreshDetailsRoutes_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + refreshDetailsRoutesBuilder_; + + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public java.util.List + getRefreshDetailsRoutesList() { + if (refreshDetailsRoutesBuilder_ == null) { + return java.util.Collections.unmodifiableList(refreshDetailsRoutes_); + } else { + return refreshDetailsRoutesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public int getRefreshDetailsRoutesCount() { + if (refreshDetailsRoutesBuilder_ == null) { + return refreshDetailsRoutes_.size(); + } else { + return refreshDetailsRoutesBuilder_.getCount(); + } + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute getRefreshDetailsRoutes(int index) { + if (refreshDetailsRoutesBuilder_ == null) { + return refreshDetailsRoutes_.get(index); + } else { + return refreshDetailsRoutesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder setRefreshDetailsRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (refreshDetailsRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.set(index, value); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder setRefreshDetailsRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (refreshDetailsRoutesBuilder_ == null) { + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.set(index, builderForValue.build()); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder addRefreshDetailsRoutes( + com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (refreshDetailsRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.add(value); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder addRefreshDetailsRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (refreshDetailsRoutesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.add(index, value); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder addRefreshDetailsRoutes( + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (refreshDetailsRoutesBuilder_ == null) { + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.add(builderForValue.build()); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder addRefreshDetailsRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (refreshDetailsRoutesBuilder_ == null) { + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.add(index, builderForValue.build()); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder addAllRefreshDetailsRoutes( + java.lang.Iterable values) { + if (refreshDetailsRoutesBuilder_ == null) { + ensureRefreshDetailsRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, refreshDetailsRoutes_); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder clearRefreshDetailsRoutes() { + if (refreshDetailsRoutesBuilder_ == null) { + refreshDetailsRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public Builder removeRefreshDetailsRoutes(int index) { + if (refreshDetailsRoutesBuilder_ == null) { + ensureRefreshDetailsRoutesIsMutable(); + refreshDetailsRoutes_.remove(index); + onChanged(); + } else { + refreshDetailsRoutesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder + getRefreshDetailsRoutesBuilder(int index) { + return getRefreshDetailsRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder + getRefreshDetailsRoutesOrBuilder(int index) { + if (refreshDetailsRoutesBuilder_ == null) { + return refreshDetailsRoutes_.get(index); + } else { + return refreshDetailsRoutesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public java.util.List + getRefreshDetailsRoutesOrBuilderList() { + if (refreshDetailsRoutesBuilder_ != null) { + return refreshDetailsRoutesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(refreshDetailsRoutes_); + } + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder + addRefreshDetailsRoutesBuilder() { + return getRefreshDetailsRoutesFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder + addRefreshDetailsRoutesBuilder(int index) { + return getRefreshDetailsRoutesFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * If non-empty, the given routes will be refreshed, without modifying their
+     * underlying sequence of visits or travel times: only other details will be
+     * updated. This does not solve the model.
+     *
+     * As of 2020/11, this only populates the polylines of non-empty routes and
+     * requires that `populate_polylines` is true.
+     *
+     * The `route_polyline` fields of the passed-in routes may be inconsistent
+     * with route `transitions`.
+     *
+     * This field must not be used together with `injected_first_solution_routes`
+     * or `injected_solution_constraint`.
+     *
+     * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+     * Polylines are still populated between all visits in all non-empty routes
+     * regardless of whether the related shipments or vehicles are ignored.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + public java.util.List + getRefreshDetailsRoutesBuilderList() { + return getRefreshDetailsRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + getRefreshDetailsRoutesFieldBuilder() { + if (refreshDetailsRoutesBuilder_ == null) { + refreshDetailsRoutesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder>( + refreshDetailsRoutes_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + refreshDetailsRoutes_ = null; + } + return refreshDetailsRoutesBuilder_; + } + + private boolean interpretInjectedSolutionsUsingLabels_; + /** + * + * + *
+     * If true:
+     *
+     *   * uses
+     *   [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label]
+     *   instead of `vehicle_index` to
+     *     match routes in an injected solution with vehicles in the request;
+     *     reuses the mapping of original
+     *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+     *     to new
+     *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+     *     to update
+     *     [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices]
+     *     if non-empty, but the mapping must be unambiguous (i.e., multiple
+     *     `ShipmentRoute`s must not share the same original `vehicle_index`).
+     *   * uses
+     *   [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label]
+     *   instead of `shipment_index`
+     *     to match visits in an injected solution with shipments in the request;
+     *   * uses
+     *   [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+     *   instead of
+     *   [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index]
+     *   to
+     *     match skipped shipments in the injected solution with request
+     *     shipments.
+     *
+     * This interpretation applies to the `injected_first_solution_routes`,
+     * `injected_solution_constraint`, and `refresh_details_routes` fields.
+     * It can be used when shipment or vehicle indices in the request have
+     * changed since the solution was created, perhaps because shipments or
+     * vehicles have been removed from or added to the request.
+     *
+     * If true, labels in the following categories must appear at most once in
+     * their category:
+     *
+     *   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the
+     *   request;
+     *   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in
+     *   the request;
+     *   * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution;
+     *   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in
+     *     the injected solution (except pickup/delivery visit pairs, whose
+     *     `shipment_label` must appear twice).
+     *
+     * If a `vehicle_label` in the injected solution does not correspond to a
+     * request vehicle, the corresponding route is removed from the solution
+     * along with its visits. If a `shipment_label` in the injected solution does
+     * not correspond to a request shipment, the corresponding visit is removed
+     * from the solution. If a
+     * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+     * in the injected solution does not correspond to a request shipment, the
+     * `SkippedShipment` is removed from the solution.
+     *
+     * Removing route visits or entire routes from an injected solution may
+     * have an effect on the implied constraints, which may lead to change in
+     * solution, validation errors, or infeasibility.
+     *
+     * NOTE: The caller must ensure that each
+     * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp.
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely
+     * identifies a vehicle (resp. shipment) entity used across the two relevant
+     * requests: the past request that produced the `OptimizeToursResponse` used
+     * in the injected solution and the current request that includes the injected
+     * solution. The uniqueness checks described above are not enough to guarantee
+     * this requirement.
+     * 
+ * + * bool interpret_injected_solutions_using_labels = 10; + * + * @return The interpretInjectedSolutionsUsingLabels. + */ + @java.lang.Override + public boolean getInterpretInjectedSolutionsUsingLabels() { + return interpretInjectedSolutionsUsingLabels_; + } + /** + * + * + *
+     * If true:
+     *
+     *   * uses
+     *   [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label]
+     *   instead of `vehicle_index` to
+     *     match routes in an injected solution with vehicles in the request;
+     *     reuses the mapping of original
+     *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+     *     to new
+     *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+     *     to update
+     *     [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices]
+     *     if non-empty, but the mapping must be unambiguous (i.e., multiple
+     *     `ShipmentRoute`s must not share the same original `vehicle_index`).
+     *   * uses
+     *   [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label]
+     *   instead of `shipment_index`
+     *     to match visits in an injected solution with shipments in the request;
+     *   * uses
+     *   [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+     *   instead of
+     *   [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index]
+     *   to
+     *     match skipped shipments in the injected solution with request
+     *     shipments.
+     *
+     * This interpretation applies to the `injected_first_solution_routes`,
+     * `injected_solution_constraint`, and `refresh_details_routes` fields.
+     * It can be used when shipment or vehicle indices in the request have
+     * changed since the solution was created, perhaps because shipments or
+     * vehicles have been removed from or added to the request.
+     *
+     * If true, labels in the following categories must appear at most once in
+     * their category:
+     *
+     *   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the
+     *   request;
+     *   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in
+     *   the request;
+     *   * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution;
+     *   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in
+     *     the injected solution (except pickup/delivery visit pairs, whose
+     *     `shipment_label` must appear twice).
+     *
+     * If a `vehicle_label` in the injected solution does not correspond to a
+     * request vehicle, the corresponding route is removed from the solution
+     * along with its visits. If a `shipment_label` in the injected solution does
+     * not correspond to a request shipment, the corresponding visit is removed
+     * from the solution. If a
+     * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+     * in the injected solution does not correspond to a request shipment, the
+     * `SkippedShipment` is removed from the solution.
+     *
+     * Removing route visits or entire routes from an injected solution may
+     * have an effect on the implied constraints, which may lead to change in
+     * solution, validation errors, or infeasibility.
+     *
+     * NOTE: The caller must ensure that each
+     * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp.
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely
+     * identifies a vehicle (resp. shipment) entity used across the two relevant
+     * requests: the past request that produced the `OptimizeToursResponse` used
+     * in the injected solution and the current request that includes the injected
+     * solution. The uniqueness checks described above are not enough to guarantee
+     * this requirement.
+     * 
+ * + * bool interpret_injected_solutions_using_labels = 10; + * + * @param value The interpretInjectedSolutionsUsingLabels to set. + * @return This builder for chaining. + */ + public Builder setInterpretInjectedSolutionsUsingLabels(boolean value) { + + interpretInjectedSolutionsUsingLabels_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * If true:
+     *
+     *   * uses
+     *   [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label]
+     *   instead of `vehicle_index` to
+     *     match routes in an injected solution with vehicles in the request;
+     *     reuses the mapping of original
+     *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+     *     to new
+     *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+     *     to update
+     *     [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices]
+     *     if non-empty, but the mapping must be unambiguous (i.e., multiple
+     *     `ShipmentRoute`s must not share the same original `vehicle_index`).
+     *   * uses
+     *   [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label]
+     *   instead of `shipment_index`
+     *     to match visits in an injected solution with shipments in the request;
+     *   * uses
+     *   [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+     *   instead of
+     *   [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index]
+     *   to
+     *     match skipped shipments in the injected solution with request
+     *     shipments.
+     *
+     * This interpretation applies to the `injected_first_solution_routes`,
+     * `injected_solution_constraint`, and `refresh_details_routes` fields.
+     * It can be used when shipment or vehicle indices in the request have
+     * changed since the solution was created, perhaps because shipments or
+     * vehicles have been removed from or added to the request.
+     *
+     * If true, labels in the following categories must appear at most once in
+     * their category:
+     *
+     *   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the
+     *   request;
+     *   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in
+     *   the request;
+     *   * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution;
+     *   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in
+     *     the injected solution (except pickup/delivery visit pairs, whose
+     *     `shipment_label` must appear twice).
+     *
+     * If a `vehicle_label` in the injected solution does not correspond to a
+     * request vehicle, the corresponding route is removed from the solution
+     * along with its visits. If a `shipment_label` in the injected solution does
+     * not correspond to a request shipment, the corresponding visit is removed
+     * from the solution. If a
+     * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+     * in the injected solution does not correspond to a request shipment, the
+     * `SkippedShipment` is removed from the solution.
+     *
+     * Removing route visits or entire routes from an injected solution may
+     * have an effect on the implied constraints, which may lead to change in
+     * solution, validation errors, or infeasibility.
+     *
+     * NOTE: The caller must ensure that each
+     * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp.
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely
+     * identifies a vehicle (resp. shipment) entity used across the two relevant
+     * requests: the past request that produced the `OptimizeToursResponse` used
+     * in the injected solution and the current request that includes the injected
+     * solution. The uniqueness checks described above are not enough to guarantee
+     * this requirement.
+     * 
+ * + * bool interpret_injected_solutions_using_labels = 10; + * + * @return This builder for chaining. + */ + public Builder clearInterpretInjectedSolutionsUsingLabels() { + bitField0_ = (bitField0_ & ~0x00000100); + interpretInjectedSolutionsUsingLabels_ = false; + onChanged(); + return this; + } + + private boolean considerRoadTraffic_; + /** + * + * + *
+     * Consider traffic estimation in calculating `ShipmentRoute` fields
+     * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration],
+     * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time],
+     * and `vehicle_end_time`; in setting the
+     * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities]
+     * field, and in calculating the
+     * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost]
+     * field.
+     * 
+ * + * bool consider_road_traffic = 11; + * + * @return The considerRoadTraffic. + */ + @java.lang.Override + public boolean getConsiderRoadTraffic() { + return considerRoadTraffic_; + } + /** + * + * + *
+     * Consider traffic estimation in calculating `ShipmentRoute` fields
+     * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration],
+     * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time],
+     * and `vehicle_end_time`; in setting the
+     * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities]
+     * field, and in calculating the
+     * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost]
+     * field.
+     * 
+ * + * bool consider_road_traffic = 11; + * + * @param value The considerRoadTraffic to set. + * @return This builder for chaining. + */ + public Builder setConsiderRoadTraffic(boolean value) { + + considerRoadTraffic_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Consider traffic estimation in calculating `ShipmentRoute` fields
+     * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration],
+     * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time],
+     * and `vehicle_end_time`; in setting the
+     * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities]
+     * field, and in calculating the
+     * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost]
+     * field.
+     * 
+ * + * bool consider_road_traffic = 11; + * + * @return This builder for chaining. + */ + public Builder clearConsiderRoadTraffic() { + bitField0_ = (bitField0_ & ~0x00000200); + considerRoadTraffic_ = false; + onChanged(); + return this; + } + + private boolean populatePolylines_; + /** + * + * + *
+     * If true, polylines will be populated in response `ShipmentRoute`s.
+     * 
+ * + * bool populate_polylines = 12; + * + * @return The populatePolylines. + */ + @java.lang.Override + public boolean getPopulatePolylines() { + return populatePolylines_; + } + /** + * + * + *
+     * If true, polylines will be populated in response `ShipmentRoute`s.
+     * 
+ * + * bool populate_polylines = 12; + * + * @param value The populatePolylines to set. + * @return This builder for chaining. + */ + public Builder setPopulatePolylines(boolean value) { + + populatePolylines_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, polylines will be populated in response `ShipmentRoute`s.
+     * 
+ * + * bool populate_polylines = 12; + * + * @return This builder for chaining. + */ + public Builder clearPopulatePolylines() { + bitField0_ = (bitField0_ & ~0x00000400); + populatePolylines_ = false; + onChanged(); + return this; + } + + private boolean populateTransitionPolylines_; + /** + * + * + *
+     * If true, polylines will be populated in response
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions].
+     * 
+ * + * bool populate_transition_polylines = 13; + * + * @return The populateTransitionPolylines. + */ + @java.lang.Override + public boolean getPopulateTransitionPolylines() { + return populateTransitionPolylines_; + } + /** + * + * + *
+     * If true, polylines will be populated in response
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions].
+     * 
+ * + * bool populate_transition_polylines = 13; + * + * @param value The populateTransitionPolylines to set. + * @return This builder for chaining. + */ + public Builder setPopulateTransitionPolylines(boolean value) { + + populateTransitionPolylines_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, polylines will be populated in response
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions].
+     * 
+ * + * bool populate_transition_polylines = 13; + * + * @return This builder for chaining. + */ + public Builder clearPopulateTransitionPolylines() { + bitField0_ = (bitField0_ & ~0x00000800); + populateTransitionPolylines_ = false; + onChanged(); + return this; + } + + private boolean allowLargeDeadlineDespiteInterruptionRisk_; + /** + * + * + *
+     * If this is set, then the request can have a deadline
+     * (see https://grpc.io/blog/deadlines) of up to 60 minutes.
+     * Otherwise, the maximum deadline is only 30 minutes.
+     * Note that long-lived requests have a significantly larger (but still small)
+     * risk of interruption.
+     * 
+ * + * bool allow_large_deadline_despite_interruption_risk = 14; + * + * @return The allowLargeDeadlineDespiteInterruptionRisk. + */ + @java.lang.Override + public boolean getAllowLargeDeadlineDespiteInterruptionRisk() { + return allowLargeDeadlineDespiteInterruptionRisk_; + } + /** + * + * + *
+     * If this is set, then the request can have a deadline
+     * (see https://grpc.io/blog/deadlines) of up to 60 minutes.
+     * Otherwise, the maximum deadline is only 30 minutes.
+     * Note that long-lived requests have a significantly larger (but still small)
+     * risk of interruption.
+     * 
+ * + * bool allow_large_deadline_despite_interruption_risk = 14; + * + * @param value The allowLargeDeadlineDespiteInterruptionRisk to set. + * @return This builder for chaining. + */ + public Builder setAllowLargeDeadlineDespiteInterruptionRisk(boolean value) { + + allowLargeDeadlineDespiteInterruptionRisk_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * If this is set, then the request can have a deadline
+     * (see https://grpc.io/blog/deadlines) of up to 60 minutes.
+     * Otherwise, the maximum deadline is only 30 minutes.
+     * Note that long-lived requests have a significantly larger (but still small)
+     * risk of interruption.
+     * 
+ * + * bool allow_large_deadline_despite_interruption_risk = 14; + * + * @return This builder for chaining. + */ + public Builder clearAllowLargeDeadlineDespiteInterruptionRisk() { + bitField0_ = (bitField0_ & ~0x00001000); + allowLargeDeadlineDespiteInterruptionRisk_ = false; + onChanged(); + return this; + } + + private boolean useGeodesicDistances_; + /** + * + * + *
+     * If true, travel distances will be computed using geodesic distances instead
+     * of Google Maps distances, and travel times will be computed using geodesic
+     * distances with a speed defined by `geodesic_meters_per_second`.
+     * 
+ * + * bool use_geodesic_distances = 15; + * + * @return The useGeodesicDistances. + */ + @java.lang.Override + public boolean getUseGeodesicDistances() { + return useGeodesicDistances_; + } + /** + * + * + *
+     * If true, travel distances will be computed using geodesic distances instead
+     * of Google Maps distances, and travel times will be computed using geodesic
+     * distances with a speed defined by `geodesic_meters_per_second`.
+     * 
+ * + * bool use_geodesic_distances = 15; + * + * @param value The useGeodesicDistances to set. + * @return This builder for chaining. + */ + public Builder setUseGeodesicDistances(boolean value) { + + useGeodesicDistances_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, travel distances will be computed using geodesic distances instead
+     * of Google Maps distances, and travel times will be computed using geodesic
+     * distances with a speed defined by `geodesic_meters_per_second`.
+     * 
+ * + * bool use_geodesic_distances = 15; + * + * @return This builder for chaining. + */ + public Builder clearUseGeodesicDistances() { + bitField0_ = (bitField0_ & ~0x00002000); + useGeodesicDistances_ = false; + onChanged(); + return this; + } + + private double geodesicMetersPerSecond_; + /** + * + * + *
+     * When `use_geodesic_distances` is true, this field must be set and defines
+     * the speed applied to compute travel times. Its value must be at least 1.0
+     * meters/seconds.
+     * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return Whether the geodesicMetersPerSecond field is set. + */ + @java.lang.Override + public boolean hasGeodesicMetersPerSecond() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * When `use_geodesic_distances` is true, this field must be set and defines
+     * the speed applied to compute travel times. Its value must be at least 1.0
+     * meters/seconds.
+     * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return The geodesicMetersPerSecond. + */ + @java.lang.Override + public double getGeodesicMetersPerSecond() { + return geodesicMetersPerSecond_; + } + /** + * + * + *
+     * When `use_geodesic_distances` is true, this field must be set and defines
+     * the speed applied to compute travel times. Its value must be at least 1.0
+     * meters/seconds.
+     * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @param value The geodesicMetersPerSecond to set. + * @return This builder for chaining. + */ + public Builder setGeodesicMetersPerSecond(double value) { + + geodesicMetersPerSecond_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * When `use_geodesic_distances` is true, this field must be set and defines
+     * the speed applied to compute travel times. Its value must be at least 1.0
+     * meters/seconds.
+     * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return This builder for chaining. + */ + public Builder clearGeodesicMetersPerSecond() { + bitField0_ = (bitField0_ & ~0x00004000); + geodesicMetersPerSecond_ = 0D; + onChanged(); + return this; + } + + private int maxValidationErrors_; + /** + * + * + *
+     * Truncates the number of validation errors returned. These errors are
+     * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+     * error detail (https://cloud.google.com/apis/design/errors#error_details),
+     * unless solving_mode=VALIDATE_ONLY: see the
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * field.
+     * This defaults to 100 and is capped at 10,000.
+     * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return Whether the maxValidationErrors field is set. + */ + @java.lang.Override + public boolean hasMaxValidationErrors() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Truncates the number of validation errors returned. These errors are
+     * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+     * error detail (https://cloud.google.com/apis/design/errors#error_details),
+     * unless solving_mode=VALIDATE_ONLY: see the
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * field.
+     * This defaults to 100 and is capped at 10,000.
+     * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return The maxValidationErrors. + */ + @java.lang.Override + public int getMaxValidationErrors() { + return maxValidationErrors_; + } + /** + * + * + *
+     * Truncates the number of validation errors returned. These errors are
+     * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+     * error detail (https://cloud.google.com/apis/design/errors#error_details),
+     * unless solving_mode=VALIDATE_ONLY: see the
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * field.
+     * This defaults to 100 and is capped at 10,000.
+     * 
+ * + * optional int32 max_validation_errors = 5; + * + * @param value The maxValidationErrors to set. + * @return This builder for chaining. + */ + public Builder setMaxValidationErrors(int value) { + + maxValidationErrors_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Truncates the number of validation errors returned. These errors are
+     * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+     * error detail (https://cloud.google.com/apis/design/errors#error_details),
+     * unless solving_mode=VALIDATE_ONLY: see the
+     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+     * field.
+     * This defaults to 100 and is capped at 10,000.
+     * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxValidationErrors() { + bitField0_ = (bitField0_ & ~0x00008000); + maxValidationErrors_ = 0; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+     * Label that may be used to identify this request, reported back in the
+     * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+     * 
+ * + * string label = 17; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Label that may be used to identify this request, reported back in the
+     * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+     * 
+ * + * string label = 17; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Label that may be used to identify this request, reported back in the
+     * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+     * 
+ * + * string label = 17; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + label_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Label that may be used to identify this request, reported back in the
+     * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+     * 
+ * + * string label = 17; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + label_ = getDefaultInstance().getLabel(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + /** + * + * + *
+     * Label that may be used to identify this request, reported back in the
+     * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+     * 
+ * + * string label = 17; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + label_ = value; + bitField0_ |= 0x00010000; + 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.OptimizeToursRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.OptimizeToursRequest) + private static final com.google.maps.routeoptimization.v1.OptimizeToursRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.OptimizeToursRequest(); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizeToursRequest 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.OptimizeToursRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursRequestOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursRequestOrBuilder.java new file mode 100644 index 000000000000..41dc0ebf10f8 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursRequestOrBuilder.java @@ -0,0 +1,849 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface OptimizeToursRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.OptimizeToursRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Target project or location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Target project or location to make a call.
+   *
+   * Format:
+   * * `projects/{project-id}`
+   * * `projects/{project-id}/locations/{location-id}`
+   *
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * If this timeout is set, the server returns a response before the timeout
+   * period has elapsed or the server deadline for synchronous requests is
+   * reached, whichever is sooner.
+   *
+   * For asynchronous requests, the server will generate a solution (if
+   * possible) before the timeout has elapsed.
+   * 
+ * + * .google.protobuf.Duration timeout = 2; + * + * @return Whether the timeout field is set. + */ + boolean hasTimeout(); + /** + * + * + *
+   * If this timeout is set, the server returns a response before the timeout
+   * period has elapsed or the server deadline for synchronous requests is
+   * reached, whichever is sooner.
+   *
+   * For asynchronous requests, the server will generate a solution (if
+   * possible) before the timeout has elapsed.
+   * 
+ * + * .google.protobuf.Duration timeout = 2; + * + * @return The timeout. + */ + com.google.protobuf.Duration getTimeout(); + /** + * + * + *
+   * If this timeout is set, the server returns a response before the timeout
+   * period has elapsed or the server deadline for synchronous requests is
+   * reached, whichever is sooner.
+   *
+   * For asynchronous requests, the server will generate a solution (if
+   * possible) before the timeout has elapsed.
+   * 
+ * + * .google.protobuf.Duration timeout = 2; + */ + com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder(); + + /** + * + * + *
+   * Shipment model to solve.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * + * @return Whether the model field is set. + */ + boolean hasModel(); + /** + * + * + *
+   * Shipment model to solve.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * + * @return The model. + */ + com.google.maps.routeoptimization.v1.ShipmentModel getModel(); + /** + * + * + *
+   * Shipment model to solve.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + com.google.maps.routeoptimization.v1.ShipmentModelOrBuilder getModelOrBuilder(); + + /** + * + * + *
+   * By default, the solving mode is `DEFAULT_SOLVE` (0).
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return The enum numeric value on the wire for solvingMode. + */ + int getSolvingModeValue(); + /** + * + * + *
+   * By default, the solving mode is `DEFAULT_SOLVE` (0).
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * + * + * @return The solvingMode. + */ + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode getSolvingMode(); + + /** + * + * + *
+   * Search mode used to solve the request.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * @return The enum numeric value on the wire for searchMode. + */ + int getSearchModeValue(); + /** + * + * + *
+   * Search mode used to solve the request.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * + * @return The searchMode. + */ + com.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode getSearchMode(); + + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + java.util.List + getInjectedFirstSolutionRoutesList(); + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute getInjectedFirstSolutionRoutes(int index); + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + int getInjectedFirstSolutionRoutesCount(); + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + java.util.List + getInjectedFirstSolutionRoutesOrBuilderList(); + /** + * + * + *
+   * Guide the optimization algorithm in finding a first solution that is
+   * similar to a previous solution.
+   *
+   * The model is constrained when the first solution is built.
+   * Any shipments not performed on a route are implicitly skipped in the first
+   * solution, but they may be performed in successive solutions.
+   *
+   * The solution must satisfy some basic validity assumptions:
+   *
+   *   * for all routes, `vehicle_index` must be in range and not be duplicated.
+   *   * for all visits, `shipment_index` and `visit_request_index` must be
+   *     in range.
+   *   * a shipment may only be referenced on one route.
+   *   * the pickup of a pickup-delivery shipment must be performed before
+   *     the delivery.
+   *   * no more than one pickup alternative or delivery alternative of
+   *     a shipment may be performed.
+   *   * for all routes, times are increasing (i.e., `vehicle_start_time
+   *     <= visits[0].start_time <= visits[1].start_time ...
+   *     <= vehicle_end_time`).
+   *   * a shipment may only be performed on a vehicle that is allowed. A
+   *     vehicle is allowed if
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]
+   *     is empty or its `vehicle_index` is included in
+   *     [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices].
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder + getInjectedFirstSolutionRoutesOrBuilder(int index); + + /** + * + * + *
+   * Constrain the optimization algorithm to find a final solution that is
+   * similar to a previous solution. For example, this may be used to freeze
+   * portions of routes which have already been completed or which are to be
+   * completed but must not be modified.
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + * + * @return Whether the injectedSolutionConstraint field is set. + */ + boolean hasInjectedSolutionConstraint(); + /** + * + * + *
+   * Constrain the optimization algorithm to find a final solution that is
+   * similar to a previous solution. For example, this may be used to freeze
+   * portions of routes which have already been completed or which are to be
+   * completed but must not be modified.
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + * + * @return The injectedSolutionConstraint. + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraint getInjectedSolutionConstraint(); + /** + * + * + *
+   * Constrain the optimization algorithm to find a final solution that is
+   * similar to a previous solution. For example, this may be used to freeze
+   * portions of routes which have already been completed or which are to be
+   * completed but must not be modified.
+   *
+   * If the injected solution is not feasible, a validation error is not
+   * necessarily returned and an error indicating infeasibility may be returned
+   * instead.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * + */ + com.google.maps.routeoptimization.v1.InjectedSolutionConstraintOrBuilder + getInjectedSolutionConstraintOrBuilder(); + + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + java.util.List getRefreshDetailsRoutesList(); + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute getRefreshDetailsRoutes(int index); + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + int getRefreshDetailsRoutesCount(); + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + java.util.List + getRefreshDetailsRoutesOrBuilderList(); + /** + * + * + *
+   * If non-empty, the given routes will be refreshed, without modifying their
+   * underlying sequence of visits or travel times: only other details will be
+   * updated. This does not solve the model.
+   *
+   * As of 2020/11, this only populates the polylines of non-empty routes and
+   * requires that `populate_polylines` is true.
+   *
+   * The `route_polyline` fields of the passed-in routes may be inconsistent
+   * with route `transitions`.
+   *
+   * This field must not be used together with `injected_first_solution_routes`
+   * or `injected_solution_constraint`.
+   *
+   * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
+   * Polylines are still populated between all visits in all non-empty routes
+   * regardless of whether the related shipments or vehicles are ignored.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRefreshDetailsRoutesOrBuilder( + int index); + + /** + * + * + *
+   * If true:
+   *
+   *   * uses
+   *   [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label]
+   *   instead of `vehicle_index` to
+   *     match routes in an injected solution with vehicles in the request;
+   *     reuses the mapping of original
+   *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+   *     to new
+   *     [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index]
+   *     to update
+   *     [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices]
+   *     if non-empty, but the mapping must be unambiguous (i.e., multiple
+   *     `ShipmentRoute`s must not share the same original `vehicle_index`).
+   *   * uses
+   *   [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label]
+   *   instead of `shipment_index`
+   *     to match visits in an injected solution with shipments in the request;
+   *   * uses
+   *   [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+   *   instead of
+   *   [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index]
+   *   to
+   *     match skipped shipments in the injected solution with request
+   *     shipments.
+   *
+   * This interpretation applies to the `injected_first_solution_routes`,
+   * `injected_solution_constraint`, and `refresh_details_routes` fields.
+   * It can be used when shipment or vehicle indices in the request have
+   * changed since the solution was created, perhaps because shipments or
+   * vehicles have been removed from or added to the request.
+   *
+   * If true, labels in the following categories must appear at most once in
+   * their category:
+   *
+   *   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the
+   *   request;
+   *   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in
+   *   the request;
+   *   * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution;
+   *   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in
+   *     the injected solution (except pickup/delivery visit pairs, whose
+   *     `shipment_label` must appear twice).
+   *
+   * If a `vehicle_label` in the injected solution does not correspond to a
+   * request vehicle, the corresponding route is removed from the solution
+   * along with its visits. If a `shipment_label` in the injected solution does
+   * not correspond to a request shipment, the corresponding visit is removed
+   * from the solution. If a
+   * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label]
+   * in the injected solution does not correspond to a request shipment, the
+   * `SkippedShipment` is removed from the solution.
+   *
+   * Removing route visits or entire routes from an injected solution may
+   * have an effect on the implied constraints, which may lead to change in
+   * solution, validation errors, or infeasibility.
+   *
+   * NOTE: The caller must ensure that each
+   * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp.
+   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely
+   * identifies a vehicle (resp. shipment) entity used across the two relevant
+   * requests: the past request that produced the `OptimizeToursResponse` used
+   * in the injected solution and the current request that includes the injected
+   * solution. The uniqueness checks described above are not enough to guarantee
+   * this requirement.
+   * 
+ * + * bool interpret_injected_solutions_using_labels = 10; + * + * @return The interpretInjectedSolutionsUsingLabels. + */ + boolean getInterpretInjectedSolutionsUsingLabels(); + + /** + * + * + *
+   * Consider traffic estimation in calculating `ShipmentRoute` fields
+   * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration],
+   * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time],
+   * and `vehicle_end_time`; in setting the
+   * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities]
+   * field, and in calculating the
+   * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost]
+   * field.
+   * 
+ * + * bool consider_road_traffic = 11; + * + * @return The considerRoadTraffic. + */ + boolean getConsiderRoadTraffic(); + + /** + * + * + *
+   * If true, polylines will be populated in response `ShipmentRoute`s.
+   * 
+ * + * bool populate_polylines = 12; + * + * @return The populatePolylines. + */ + boolean getPopulatePolylines(); + + /** + * + * + *
+   * If true, polylines will be populated in response
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions].
+   * 
+ * + * bool populate_transition_polylines = 13; + * + * @return The populateTransitionPolylines. + */ + boolean getPopulateTransitionPolylines(); + + /** + * + * + *
+   * If this is set, then the request can have a deadline
+   * (see https://grpc.io/blog/deadlines) of up to 60 minutes.
+   * Otherwise, the maximum deadline is only 30 minutes.
+   * Note that long-lived requests have a significantly larger (but still small)
+   * risk of interruption.
+   * 
+ * + * bool allow_large_deadline_despite_interruption_risk = 14; + * + * @return The allowLargeDeadlineDespiteInterruptionRisk. + */ + boolean getAllowLargeDeadlineDespiteInterruptionRisk(); + + /** + * + * + *
+   * If true, travel distances will be computed using geodesic distances instead
+   * of Google Maps distances, and travel times will be computed using geodesic
+   * distances with a speed defined by `geodesic_meters_per_second`.
+   * 
+ * + * bool use_geodesic_distances = 15; + * + * @return The useGeodesicDistances. + */ + boolean getUseGeodesicDistances(); + + /** + * + * + *
+   * When `use_geodesic_distances` is true, this field must be set and defines
+   * the speed applied to compute travel times. Its value must be at least 1.0
+   * meters/seconds.
+   * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return Whether the geodesicMetersPerSecond field is set. + */ + boolean hasGeodesicMetersPerSecond(); + /** + * + * + *
+   * When `use_geodesic_distances` is true, this field must be set and defines
+   * the speed applied to compute travel times. Its value must be at least 1.0
+   * meters/seconds.
+   * 
+ * + * optional double geodesic_meters_per_second = 16; + * + * @return The geodesicMetersPerSecond. + */ + double getGeodesicMetersPerSecond(); + + /** + * + * + *
+   * Truncates the number of validation errors returned. These errors are
+   * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+   * error detail (https://cloud.google.com/apis/design/errors#error_details),
+   * unless solving_mode=VALIDATE_ONLY: see the
+   * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+   * field.
+   * This defaults to 100 and is capped at 10,000.
+   * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return Whether the maxValidationErrors field is set. + */ + boolean hasMaxValidationErrors(); + /** + * + * + *
+   * Truncates the number of validation errors returned. These errors are
+   * typically attached to an INVALID_ARGUMENT error payload as a BadRequest
+   * error detail (https://cloud.google.com/apis/design/errors#error_details),
+   * unless solving_mode=VALIDATE_ONLY: see the
+   * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
+   * field.
+   * This defaults to 100 and is capped at 10,000.
+   * 
+ * + * optional int32 max_validation_errors = 5; + * + * @return The maxValidationErrors. + */ + int getMaxValidationErrors(); + + /** + * + * + *
+   * Label that may be used to identify this request, reported back in the
+   * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+   * 
+ * + * string label = 17; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+   * Label that may be used to identify this request, reported back in the
+   * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label].
+   * 
+ * + * string label = 17; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursResponse.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursResponse.java new file mode 100644 index 000000000000..c82c7771becc --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursResponse.java @@ -0,0 +1,4973 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Response after solving a tour optimization problem containing the routes
+ * followed by each vehicle, the shipments which have been skipped and the
+ * overall cost of the solution.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursResponse} + */ +public final class OptimizeToursResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.OptimizeToursResponse) + OptimizeToursResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use OptimizeToursResponse.newBuilder() to construct. + private OptimizeToursResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OptimizeToursResponse() { + routes_ = java.util.Collections.emptyList(); + requestLabel_ = ""; + skippedShipments_ = java.util.Collections.emptyList(); + validationErrors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OptimizeToursResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.class, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Builder.class); + } + + public interface MetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Aggregated over the routes. Each metric is the sum (or max, for loads)
+     * over all
+     * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+     * fields of the same name.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + * + * @return Whether the aggregatedRouteMetrics field is set. + */ + boolean hasAggregatedRouteMetrics(); + /** + * + * + *
+     * Aggregated over the routes. Each metric is the sum (or max, for loads)
+     * over all
+     * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+     * fields of the same name.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + * + * @return The aggregatedRouteMetrics. + */ + com.google.maps.routeoptimization.v1.AggregatedMetrics getAggregatedRouteMetrics(); + /** + * + * + *
+     * Aggregated over the routes. Each metric is the sum (or max, for loads)
+     * over all
+     * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+     * fields of the same name.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder + getAggregatedRouteMetricsOrBuilder(); + + /** + * + * + *
+     * Number of mandatory shipments skipped.
+     * 
+ * + * int32 skipped_mandatory_shipment_count = 2; + * + * @return The skippedMandatoryShipmentCount. + */ + int getSkippedMandatoryShipmentCount(); + + /** + * + * + *
+     * Number of vehicles used. Note: if a vehicle route is empty and
+     * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty]
+     * is true, the vehicle is considered used.
+     * 
+ * + * int32 used_vehicle_count = 3; + * + * @return The usedVehicleCount. + */ + int getUsedVehicleCount(); + + /** + * + * + *
+     * The earliest start time for a used vehicle, computed as the minimum over
+     * all used vehicles of
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+     * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * + * @return Whether the earliestVehicleStartTime field is set. + */ + boolean hasEarliestVehicleStartTime(); + /** + * + * + *
+     * The earliest start time for a used vehicle, computed as the minimum over
+     * all used vehicles of
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+     * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * + * @return The earliestVehicleStartTime. + */ + com.google.protobuf.Timestamp getEarliestVehicleStartTime(); + /** + * + * + *
+     * The earliest start time for a used vehicle, computed as the minimum over
+     * all used vehicles of
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+     * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getEarliestVehicleStartTimeOrBuilder(); + + /** + * + * + *
+     * The latest end time for a used vehicle, computed as the maximum over all
+     * used vehicles of
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+     * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * + * @return Whether the latestVehicleEndTime field is set. + */ + boolean hasLatestVehicleEndTime(); + /** + * + * + *
+     * The latest end time for a used vehicle, computed as the maximum over all
+     * used vehicles of
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+     * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * + * @return The latestVehicleEndTime. + */ + com.google.protobuf.Timestamp getLatestVehicleEndTime(); + /** + * + * + *
+     * The latest end time for a used vehicle, computed as the maximum over all
+     * used vehicles of
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+     * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getLatestVehicleEndTimeOrBuilder(); + + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + int getCostsCount(); + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + boolean containsCosts(java.lang.String key); + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getCosts(); + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + java.util.Map getCostsMap(); + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + double getCostsOrDefault(java.lang.String key, double defaultValue); + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + double getCostsOrThrow(java.lang.String key); + + /** + * + * + *
+     * Total cost of the solution. The sum of all values in the costs map.
+     * 
+ * + * double total_cost = 6; + * + * @return The totalCost. + */ + double getTotalCost(); + } + /** + * + * + *
+   * Overall metrics, aggregated over all routes.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} + */ + public static final class Metrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) + MetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metrics.newBuilder() to construct. + private Metrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metrics(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.class, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder.class); + } + + private int bitField0_; + public static final int AGGREGATED_ROUTE_METRICS_FIELD_NUMBER = 1; + private com.google.maps.routeoptimization.v1.AggregatedMetrics aggregatedRouteMetrics_; + /** + * + * + *
+     * Aggregated over the routes. Each metric is the sum (or max, for loads)
+     * over all
+     * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+     * fields of the same name.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + * + * @return Whether the aggregatedRouteMetrics field is set. + */ + @java.lang.Override + public boolean hasAggregatedRouteMetrics() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Aggregated over the routes. Each metric is the sum (or max, for loads)
+     * over all
+     * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+     * fields of the same name.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + * + * @return The aggregatedRouteMetrics. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetrics getAggregatedRouteMetrics() { + return aggregatedRouteMetrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : aggregatedRouteMetrics_; + } + /** + * + * + *
+     * Aggregated over the routes. Each metric is the sum (or max, for loads)
+     * over all
+     * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+     * fields of the same name.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder + getAggregatedRouteMetricsOrBuilder() { + return aggregatedRouteMetrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : aggregatedRouteMetrics_; + } + + public static final int SKIPPED_MANDATORY_SHIPMENT_COUNT_FIELD_NUMBER = 2; + private int skippedMandatoryShipmentCount_ = 0; + /** + * + * + *
+     * Number of mandatory shipments skipped.
+     * 
+ * + * int32 skipped_mandatory_shipment_count = 2; + * + * @return The skippedMandatoryShipmentCount. + */ + @java.lang.Override + public int getSkippedMandatoryShipmentCount() { + return skippedMandatoryShipmentCount_; + } + + public static final int USED_VEHICLE_COUNT_FIELD_NUMBER = 3; + private int usedVehicleCount_ = 0; + /** + * + * + *
+     * Number of vehicles used. Note: if a vehicle route is empty and
+     * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty]
+     * is true, the vehicle is considered used.
+     * 
+ * + * int32 used_vehicle_count = 3; + * + * @return The usedVehicleCount. + */ + @java.lang.Override + public int getUsedVehicleCount() { + return usedVehicleCount_; + } + + public static final int EARLIEST_VEHICLE_START_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp earliestVehicleStartTime_; + /** + * + * + *
+     * The earliest start time for a used vehicle, computed as the minimum over
+     * all used vehicles of
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+     * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * + * @return Whether the earliestVehicleStartTime field is set. + */ + @java.lang.Override + public boolean hasEarliestVehicleStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The earliest start time for a used vehicle, computed as the minimum over
+     * all used vehicles of
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+     * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * + * @return The earliestVehicleStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestVehicleStartTime() { + return earliestVehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVehicleStartTime_; + } + /** + * + * + *
+     * The earliest start time for a used vehicle, computed as the minimum over
+     * all used vehicles of
+     * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+     * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestVehicleStartTimeOrBuilder() { + return earliestVehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVehicleStartTime_; + } + + public static final int LATEST_VEHICLE_END_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp latestVehicleEndTime_; + /** + * + * + *
+     * The latest end time for a used vehicle, computed as the maximum over all
+     * used vehicles of
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+     * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * + * @return Whether the latestVehicleEndTime field is set. + */ + @java.lang.Override + public boolean hasLatestVehicleEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The latest end time for a used vehicle, computed as the maximum over all
+     * used vehicles of
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+     * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * + * @return The latestVehicleEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLatestVehicleEndTime() { + return latestVehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestVehicleEndTime_; + } + /** + * + * + *
+     * The latest end time for a used vehicle, computed as the maximum over all
+     * used vehicles of
+     * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+     * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLatestVehicleEndTimeOrBuilder() { + return latestVehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestVehicleEndTime_; + } + + public static final int COSTS_FIELD_NUMBER = 10; + + private static final class CostsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_CostsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.DOUBLE, + 0D); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField costs_; + + private com.google.protobuf.MapField internalGetCosts() { + if (costs_ == null) { + return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry); + } + return costs_; + } + + public int getCostsCount() { + return internalGetCosts().getMap().size(); + } + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public boolean containsCosts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCosts().getMap().containsKey(key); + } + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCosts() { + return getCostsMap(); + } + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public java.util.Map getCostsMap() { + return internalGetCosts().getMap(); + } + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public double getCostsOrDefault(java.lang.String key, double defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Cost of the solution, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest,
+     * e.g. "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole
+     * solution. In other words, costs["model.shipments.pickups.cost"] is the
+     * sum of all pickup costs over the solution. All costs defined in the model
+     * are reported in detail here with the exception of costs related to
+     * TransitionAttributes that are only reported in an aggregated way as of
+     * 2022/01.
+     * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public double getCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TOTAL_COST_FIELD_NUMBER = 6; + private double totalCost_ = 0D; + /** + * + * + *
+     * Total cost of the solution. The sum of all values in the costs map.
+     * 
+ * + * double total_cost = 6; + * + * @return The totalCost. + */ + @java.lang.Override + public double getTotalCost() { + return totalCost_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getAggregatedRouteMetrics()); + } + if (skippedMandatoryShipmentCount_ != 0) { + output.writeInt32(2, skippedMandatoryShipmentCount_); + } + if (usedVehicleCount_ != 0) { + output.writeInt32(3, usedVehicleCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getEarliestVehicleStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getLatestVehicleEndTime()); + } + if (java.lang.Double.doubleToRawLongBits(totalCost_) != 0) { + output.writeDouble(6, totalCost_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetCosts(), CostsDefaultEntryHolder.defaultEntry, 10); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getAggregatedRouteMetrics()); + } + if (skippedMandatoryShipmentCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 2, skippedMandatoryShipmentCount_); + } + if (usedVehicleCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, usedVehicleCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getEarliestVehicleStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getLatestVehicleEndTime()); + } + if (java.lang.Double.doubleToRawLongBits(totalCost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, totalCost_); + } + for (java.util.Map.Entry entry : + internalGetCosts().getMap().entrySet()) { + com.google.protobuf.MapEntry costs__ = + CostsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, costs__); + } + 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.OptimizeToursResponse.Metrics)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics other = + (com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) obj; + + if (hasAggregatedRouteMetrics() != other.hasAggregatedRouteMetrics()) return false; + if (hasAggregatedRouteMetrics()) { + if (!getAggregatedRouteMetrics().equals(other.getAggregatedRouteMetrics())) return false; + } + if (getSkippedMandatoryShipmentCount() != other.getSkippedMandatoryShipmentCount()) + return false; + if (getUsedVehicleCount() != other.getUsedVehicleCount()) return false; + if (hasEarliestVehicleStartTime() != other.hasEarliestVehicleStartTime()) return false; + if (hasEarliestVehicleStartTime()) { + if (!getEarliestVehicleStartTime().equals(other.getEarliestVehicleStartTime())) + return false; + } + if (hasLatestVehicleEndTime() != other.hasLatestVehicleEndTime()) return false; + if (hasLatestVehicleEndTime()) { + if (!getLatestVehicleEndTime().equals(other.getLatestVehicleEndTime())) return false; + } + if (!internalGetCosts().equals(other.internalGetCosts())) return false; + if (java.lang.Double.doubleToLongBits(getTotalCost()) + != java.lang.Double.doubleToLongBits(other.getTotalCost())) 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 (hasAggregatedRouteMetrics()) { + hash = (37 * hash) + AGGREGATED_ROUTE_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getAggregatedRouteMetrics().hashCode(); + } + hash = (37 * hash) + SKIPPED_MANDATORY_SHIPMENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSkippedMandatoryShipmentCount(); + hash = (37 * hash) + USED_VEHICLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getUsedVehicleCount(); + if (hasEarliestVehicleStartTime()) { + hash = (37 * hash) + EARLIEST_VEHICLE_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestVehicleStartTime().hashCode(); + } + if (hasLatestVehicleEndTime()) { + hash = (37 * hash) + LATEST_VEHICLE_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLatestVehicleEndTime().hashCode(); + } + if (!internalGetCosts().getMap().isEmpty()) { + hash = (37 * hash) + COSTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetCosts().hashCode(); + } + hash = (37 * hash) + TOTAL_COST_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getTotalCost())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics 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.OptimizeToursResponse.Metrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics 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.OptimizeToursResponse.Metrics parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics 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.OptimizeToursResponse.Metrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics 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.OptimizeToursResponse.Metrics + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + 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.OptimizeToursResponse.Metrics 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.OptimizeToursResponse.Metrics 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.OptimizeToursResponse.Metrics 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; + } + /** + * + * + *
+     * Overall metrics, aggregated over all routes.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) + com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetMutableCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.class, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAggregatedRouteMetricsFieldBuilder(); + getEarliestVehicleStartTimeFieldBuilder(); + getLatestVehicleEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + aggregatedRouteMetrics_ = null; + if (aggregatedRouteMetricsBuilder_ != null) { + aggregatedRouteMetricsBuilder_.dispose(); + aggregatedRouteMetricsBuilder_ = null; + } + skippedMandatoryShipmentCount_ = 0; + usedVehicleCount_ = 0; + earliestVehicleStartTime_ = null; + if (earliestVehicleStartTimeBuilder_ != null) { + earliestVehicleStartTimeBuilder_.dispose(); + earliestVehicleStartTimeBuilder_ = null; + } + latestVehicleEndTime_ = null; + if (latestVehicleEndTimeBuilder_ != null) { + latestVehicleEndTimeBuilder_.dispose(); + latestVehicleEndTimeBuilder_ = null; + } + internalGetMutableCosts().clear(); + totalCost_ = 0D; + 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_OptimizeToursResponse_Metrics_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics build() { + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics buildPartial() { + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics result = + new com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.aggregatedRouteMetrics_ = + aggregatedRouteMetricsBuilder_ == null + ? aggregatedRouteMetrics_ + : aggregatedRouteMetricsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.skippedMandatoryShipmentCount_ = skippedMandatoryShipmentCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.usedVehicleCount_ = usedVehicleCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.earliestVehicleStartTime_ = + earliestVehicleStartTimeBuilder_ == null + ? earliestVehicleStartTime_ + : earliestVehicleStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.latestVehicleEndTime_ = + latestVehicleEndTimeBuilder_ == null + ? latestVehicleEndTime_ + : latestVehicleEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.costs_ = internalGetCosts(); + result.costs_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.totalCost_ = totalCost_; + } + 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.OptimizeToursResponse.Metrics) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics other) { + if (other + == com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + .getDefaultInstance()) return this; + if (other.hasAggregatedRouteMetrics()) { + mergeAggregatedRouteMetrics(other.getAggregatedRouteMetrics()); + } + if (other.getSkippedMandatoryShipmentCount() != 0) { + setSkippedMandatoryShipmentCount(other.getSkippedMandatoryShipmentCount()); + } + if (other.getUsedVehicleCount() != 0) { + setUsedVehicleCount(other.getUsedVehicleCount()); + } + if (other.hasEarliestVehicleStartTime()) { + mergeEarliestVehicleStartTime(other.getEarliestVehicleStartTime()); + } + if (other.hasLatestVehicleEndTime()) { + mergeLatestVehicleEndTime(other.getLatestVehicleEndTime()); + } + internalGetMutableCosts().mergeFrom(other.internalGetCosts()); + bitField0_ |= 0x00000020; + if (other.getTotalCost() != 0D) { + setTotalCost(other.getTotalCost()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getAggregatedRouteMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + skippedMandatoryShipmentCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + usedVehicleCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + getEarliestVehicleStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + getLatestVehicleEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 49: + { + totalCost_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 49 + case 82: + { + com.google.protobuf.MapEntry costs__ = + input.readMessage( + CostsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableCosts() + .getMutableMap() + .put(costs__.getKey(), costs__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.maps.routeoptimization.v1.AggregatedMetrics aggregatedRouteMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.AggregatedMetrics, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder, + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder> + aggregatedRouteMetricsBuilder_; + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + * + * @return Whether the aggregatedRouteMetrics field is set. + */ + public boolean hasAggregatedRouteMetrics() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + * + * @return The aggregatedRouteMetrics. + */ + public com.google.maps.routeoptimization.v1.AggregatedMetrics getAggregatedRouteMetrics() { + if (aggregatedRouteMetricsBuilder_ == null) { + return aggregatedRouteMetrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : aggregatedRouteMetrics_; + } else { + return aggregatedRouteMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + public Builder setAggregatedRouteMetrics( + com.google.maps.routeoptimization.v1.AggregatedMetrics value) { + if (aggregatedRouteMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregatedRouteMetrics_ = value; + } else { + aggregatedRouteMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + public Builder setAggregatedRouteMetrics( + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder builderForValue) { + if (aggregatedRouteMetricsBuilder_ == null) { + aggregatedRouteMetrics_ = builderForValue.build(); + } else { + aggregatedRouteMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + public Builder mergeAggregatedRouteMetrics( + com.google.maps.routeoptimization.v1.AggregatedMetrics value) { + if (aggregatedRouteMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && aggregatedRouteMetrics_ != null + && aggregatedRouteMetrics_ + != com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance()) { + getAggregatedRouteMetricsBuilder().mergeFrom(value); + } else { + aggregatedRouteMetrics_ = value; + } + } else { + aggregatedRouteMetricsBuilder_.mergeFrom(value); + } + if (aggregatedRouteMetrics_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + public Builder clearAggregatedRouteMetrics() { + bitField0_ = (bitField0_ & ~0x00000001); + aggregatedRouteMetrics_ = null; + if (aggregatedRouteMetricsBuilder_ != null) { + aggregatedRouteMetricsBuilder_.dispose(); + aggregatedRouteMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + public com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder + getAggregatedRouteMetricsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getAggregatedRouteMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + public com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder + getAggregatedRouteMetricsOrBuilder() { + if (aggregatedRouteMetricsBuilder_ != null) { + return aggregatedRouteMetricsBuilder_.getMessageOrBuilder(); + } else { + return aggregatedRouteMetrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : aggregatedRouteMetrics_; + } + } + /** + * + * + *
+       * Aggregated over the routes. Each metric is the sum (or max, for loads)
+       * over all
+       * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics]
+       * fields of the same name.
+       * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.AggregatedMetrics, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder, + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder> + getAggregatedRouteMetricsFieldBuilder() { + if (aggregatedRouteMetricsBuilder_ == null) { + aggregatedRouteMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.AggregatedMetrics, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder, + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder>( + getAggregatedRouteMetrics(), getParentForChildren(), isClean()); + aggregatedRouteMetrics_ = null; + } + return aggregatedRouteMetricsBuilder_; + } + + private int skippedMandatoryShipmentCount_; + /** + * + * + *
+       * Number of mandatory shipments skipped.
+       * 
+ * + * int32 skipped_mandatory_shipment_count = 2; + * + * @return The skippedMandatoryShipmentCount. + */ + @java.lang.Override + public int getSkippedMandatoryShipmentCount() { + return skippedMandatoryShipmentCount_; + } + /** + * + * + *
+       * Number of mandatory shipments skipped.
+       * 
+ * + * int32 skipped_mandatory_shipment_count = 2; + * + * @param value The skippedMandatoryShipmentCount to set. + * @return This builder for chaining. + */ + public Builder setSkippedMandatoryShipmentCount(int value) { + + skippedMandatoryShipmentCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of mandatory shipments skipped.
+       * 
+ * + * int32 skipped_mandatory_shipment_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearSkippedMandatoryShipmentCount() { + bitField0_ = (bitField0_ & ~0x00000002); + skippedMandatoryShipmentCount_ = 0; + onChanged(); + return this; + } + + private int usedVehicleCount_; + /** + * + * + *
+       * Number of vehicles used. Note: if a vehicle route is empty and
+       * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty]
+       * is true, the vehicle is considered used.
+       * 
+ * + * int32 used_vehicle_count = 3; + * + * @return The usedVehicleCount. + */ + @java.lang.Override + public int getUsedVehicleCount() { + return usedVehicleCount_; + } + /** + * + * + *
+       * Number of vehicles used. Note: if a vehicle route is empty and
+       * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty]
+       * is true, the vehicle is considered used.
+       * 
+ * + * int32 used_vehicle_count = 3; + * + * @param value The usedVehicleCount to set. + * @return This builder for chaining. + */ + public Builder setUsedVehicleCount(int value) { + + usedVehicleCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of vehicles used. Note: if a vehicle route is empty and
+       * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty]
+       * is true, the vehicle is considered used.
+       * 
+ * + * int32 used_vehicle_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearUsedVehicleCount() { + bitField0_ = (bitField0_ & ~0x00000004); + usedVehicleCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp earliestVehicleStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestVehicleStartTimeBuilder_; + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * + * @return Whether the earliestVehicleStartTime field is set. + */ + public boolean hasEarliestVehicleStartTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * + * @return The earliestVehicleStartTime. + */ + public com.google.protobuf.Timestamp getEarliestVehicleStartTime() { + if (earliestVehicleStartTimeBuilder_ == null) { + return earliestVehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVehicleStartTime_; + } else { + return earliestVehicleStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + public Builder setEarliestVehicleStartTime(com.google.protobuf.Timestamp value) { + if (earliestVehicleStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestVehicleStartTime_ = value; + } else { + earliestVehicleStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + public Builder setEarliestVehicleStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestVehicleStartTimeBuilder_ == null) { + earliestVehicleStartTime_ = builderForValue.build(); + } else { + earliestVehicleStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + public Builder mergeEarliestVehicleStartTime(com.google.protobuf.Timestamp value) { + if (earliestVehicleStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && earliestVehicleStartTime_ != null + && earliestVehicleStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestVehicleStartTimeBuilder().mergeFrom(value); + } else { + earliestVehicleStartTime_ = value; + } + } else { + earliestVehicleStartTimeBuilder_.mergeFrom(value); + } + if (earliestVehicleStartTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + public Builder clearEarliestVehicleStartTime() { + bitField0_ = (bitField0_ & ~0x00000008); + earliestVehicleStartTime_ = null; + if (earliestVehicleStartTimeBuilder_ != null) { + earliestVehicleStartTimeBuilder_.dispose(); + earliestVehicleStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getEarliestVehicleStartTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getEarliestVehicleStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getEarliestVehicleStartTimeOrBuilder() { + if (earliestVehicleStartTimeBuilder_ != null) { + return earliestVehicleStartTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestVehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVehicleStartTime_; + } + } + /** + * + * + *
+       * The earliest start time for a used vehicle, computed as the minimum over
+       * all used vehicles of
+       * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time].
+       * 
+ * + * .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEarliestVehicleStartTimeFieldBuilder() { + if (earliestVehicleStartTimeBuilder_ == null) { + earliestVehicleStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestVehicleStartTime(), getParentForChildren(), isClean()); + earliestVehicleStartTime_ = null; + } + return earliestVehicleStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp latestVehicleEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + latestVehicleEndTimeBuilder_; + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * + * @return Whether the latestVehicleEndTime field is set. + */ + public boolean hasLatestVehicleEndTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * + * @return The latestVehicleEndTime. + */ + public com.google.protobuf.Timestamp getLatestVehicleEndTime() { + if (latestVehicleEndTimeBuilder_ == null) { + return latestVehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestVehicleEndTime_; + } else { + return latestVehicleEndTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + public Builder setLatestVehicleEndTime(com.google.protobuf.Timestamp value) { + if (latestVehicleEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestVehicleEndTime_ = value; + } else { + latestVehicleEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + public Builder setLatestVehicleEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (latestVehicleEndTimeBuilder_ == null) { + latestVehicleEndTime_ = builderForValue.build(); + } else { + latestVehicleEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + public Builder mergeLatestVehicleEndTime(com.google.protobuf.Timestamp value) { + if (latestVehicleEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && latestVehicleEndTime_ != null + && latestVehicleEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getLatestVehicleEndTimeBuilder().mergeFrom(value); + } else { + latestVehicleEndTime_ = value; + } + } else { + latestVehicleEndTimeBuilder_.mergeFrom(value); + } + if (latestVehicleEndTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + public Builder clearLatestVehicleEndTime() { + bitField0_ = (bitField0_ & ~0x00000010); + latestVehicleEndTime_ = null; + if (latestVehicleEndTimeBuilder_ != null) { + latestVehicleEndTimeBuilder_.dispose(); + latestVehicleEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getLatestVehicleEndTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getLatestVehicleEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getLatestVehicleEndTimeOrBuilder() { + if (latestVehicleEndTimeBuilder_ != null) { + return latestVehicleEndTimeBuilder_.getMessageOrBuilder(); + } else { + return latestVehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : latestVehicleEndTime_; + } + } + /** + * + * + *
+       * The latest end time for a used vehicle, computed as the maximum over all
+       * used vehicles of
+       * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time].
+       * 
+ * + * .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getLatestVehicleEndTimeFieldBuilder() { + if (latestVehicleEndTimeBuilder_ == null) { + latestVehicleEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLatestVehicleEndTime(), getParentForChildren(), isClean()); + latestVehicleEndTime_ = null; + } + return latestVehicleEndTimeBuilder_; + } + + private com.google.protobuf.MapField costs_; + + private com.google.protobuf.MapField internalGetCosts() { + if (costs_ == null) { + return com.google.protobuf.MapField.emptyMapField(CostsDefaultEntryHolder.defaultEntry); + } + return costs_; + } + + private com.google.protobuf.MapField + internalGetMutableCosts() { + if (costs_ == null) { + costs_ = com.google.protobuf.MapField.newMapField(CostsDefaultEntryHolder.defaultEntry); + } + if (!costs_.isMutable()) { + costs_ = costs_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return costs_; + } + + public int getCostsCount() { + return internalGetCosts().getMap().size(); + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public boolean containsCosts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCosts().getMap().containsKey(key); + } + /** Use {@link #getCostsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCosts() { + return getCostsMap(); + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public java.util.Map getCostsMap() { + return internalGetCosts().getMap(); + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public double getCostsOrDefault(java.lang.String key, double defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + @java.lang.Override + public double getCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCosts() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableCosts().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + public Builder removeCosts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableCosts().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableCosts() { + bitField0_ |= 0x00000020; + return internalGetMutableCosts().getMutableMap(); + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + public Builder putCosts(java.lang.String key, double value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableCosts().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+       * Cost of the solution, broken down by cost-related request fields.
+       * The keys are proto paths, relative to the input OptimizeToursRequest,
+       * e.g. "model.shipments.pickups.cost", and the values are the total cost
+       * generated by the corresponding cost field, aggregated over the whole
+       * solution. In other words, costs["model.shipments.pickups.cost"] is the
+       * sum of all pickup costs over the solution. All costs defined in the model
+       * are reported in detail here with the exception of costs related to
+       * TransitionAttributes that are only reported in an aggregated way as of
+       * 2022/01.
+       * 
+ * + * map<string, double> costs = 10; + */ + public Builder putAllCosts(java.util.Map values) { + internalGetMutableCosts().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private double totalCost_; + /** + * + * + *
+       * Total cost of the solution. The sum of all values in the costs map.
+       * 
+ * + * double total_cost = 6; + * + * @return The totalCost. + */ + @java.lang.Override + public double getTotalCost() { + return totalCost_; + } + /** + * + * + *
+       * Total cost of the solution. The sum of all values in the costs map.
+       * 
+ * + * double total_cost = 6; + * + * @param value The totalCost to set. + * @return This builder for chaining. + */ + public Builder setTotalCost(double value) { + + totalCost_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Total cost of the solution. The sum of all values in the costs map.
+       * 
+ * + * double total_cost = 6; + * + * @return This builder for chaining. + */ + public Builder clearTotalCost() { + bitField0_ = (bitField0_ & ~0x00000040); + totalCost_ = 0D; + 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.OptimizeToursResponse.Metrics) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) + private static final com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics(); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metrics 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.OptimizeToursResponse.Metrics + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ROUTES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List routes_; + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public java.util.List getRoutesList() { + return routes_; + } + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public java.util.List + getRoutesOrBuilderList() { + return routes_; + } + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public int getRoutesCount() { + return routes_.size(); + } + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute getRoutes(int index) { + return routes_.get(index); + } + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder(int index) { + return routes_.get(index); + } + + public static final int REQUEST_LABEL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestLabel_ = ""; + /** + * + * + *
+   * Copy of the
+   * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+   * if a label was specified in the request.
+   * 
+ * + * string request_label = 3; + * + * @return The requestLabel. + */ + @java.lang.Override + public java.lang.String getRequestLabel() { + java.lang.Object ref = requestLabel_; + 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(); + requestLabel_ = s; + return s; + } + } + /** + * + * + *
+   * Copy of the
+   * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+   * if a label was specified in the request.
+   * 
+ * + * string request_label = 3; + * + * @return The bytes for requestLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestLabelBytes() { + java.lang.Object ref = requestLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SKIPPED_SHIPMENTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List skippedShipments_; + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + @java.lang.Override + public java.util.List + getSkippedShipmentsList() { + return skippedShipments_; + } + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + @java.lang.Override + public java.util.List + getSkippedShipmentsOrBuilderList() { + return skippedShipments_; + } + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + @java.lang.Override + public int getSkippedShipmentsCount() { + return skippedShipments_.size(); + } + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment getSkippedShipments(int index) { + return skippedShipments_.get(index); + } + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder getSkippedShipmentsOrBuilder( + int index) { + return skippedShipments_.get(index); + } + + public static final int VALIDATION_ERRORS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List + validationErrors_; + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + @java.lang.Override + public java.util.List + getValidationErrorsList() { + return validationErrors_; + } + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder> + getValidationErrorsOrBuilderList() { + return validationErrors_; + } + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + @java.lang.Override + public int getValidationErrorsCount() { + return validationErrors_.size(); + } + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError getValidationErrors( + int index) { + return validationErrors_.get(index); + } + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder + getValidationErrorsOrBuilder(int index) { + return validationErrors_.get(index); + } + + public static final int METRICS_FIELD_NUMBER = 6; + private com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics_; + /** + * + * + *
+   * Duration, distance and usage metrics for this solution.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * + * @return Whether the metrics field is set. + */ + @java.lang.Override + public boolean hasMetrics() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Duration, distance and usage metrics for this solution.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * + * @return The metrics. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics getMetrics() { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance() + : metrics_; + } + /** + * + * + *
+   * Duration, distance and usage metrics for this solution.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder + getMetricsOrBuilder() { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.getDefaultInstance() + : metrics_; + } + + 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 < routes_.size(); i++) { + output.writeMessage(1, routes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestLabel_); + } + for (int i = 0; i < skippedShipments_.size(); i++) { + output.writeMessage(4, skippedShipments_.get(i)); + } + for (int i = 0; i < validationErrors_.size(); i++) { + output.writeMessage(5, validationErrors_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getMetrics()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < routes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, routes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestLabel_); + } + for (int i = 0; i < skippedShipments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, skippedShipments_.get(i)); + } + for (int i = 0; i < validationErrors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, validationErrors_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMetrics()); + } + 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.OptimizeToursResponse)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.OptimizeToursResponse other = + (com.google.maps.routeoptimization.v1.OptimizeToursResponse) obj; + + if (!getRoutesList().equals(other.getRoutesList())) return false; + if (!getRequestLabel().equals(other.getRequestLabel())) return false; + if (!getSkippedShipmentsList().equals(other.getSkippedShipmentsList())) return false; + if (!getValidationErrorsList().equals(other.getValidationErrorsList())) return false; + if (hasMetrics() != other.hasMetrics()) return false; + if (hasMetrics()) { + if (!getMetrics().equals(other.getMetrics())) 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 (getRoutesCount() > 0) { + hash = (37 * hash) + ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getRoutesList().hashCode(); + } + hash = (37 * hash) + REQUEST_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getRequestLabel().hashCode(); + if (getSkippedShipmentsCount() > 0) { + hash = (37 * hash) + SKIPPED_SHIPMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSkippedShipmentsList().hashCode(); + } + if (getValidationErrorsCount() > 0) { + hash = (37 * hash) + VALIDATION_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getValidationErrorsList().hashCode(); + } + if (hasMetrics()) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetrics().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse 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.OptimizeToursResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse 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.OptimizeToursResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse 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.OptimizeToursResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse 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.OptimizeToursResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse 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.OptimizeToursResponse 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.OptimizeToursResponse 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.OptimizeToursResponse 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; + } + /** + * + * + *
+   * Response after solving a tour optimization problem containing the routes
+   * followed by each vehicle, the shipments which have been skipped and the
+   * overall cost of the solution.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.OptimizeToursResponse) + com.google.maps.routeoptimization.v1.OptimizeToursResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.class, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.OptimizeToursResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRoutesFieldBuilder(); + getSkippedShipmentsFieldBuilder(); + getValidationErrorsFieldBuilder(); + getMetricsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (routesBuilder_ == null) { + routes_ = java.util.Collections.emptyList(); + } else { + routes_ = null; + routesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + requestLabel_ = ""; + if (skippedShipmentsBuilder_ == null) { + skippedShipments_ = java.util.Collections.emptyList(); + } else { + skippedShipments_ = null; + skippedShipmentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (validationErrorsBuilder_ == null) { + validationErrors_ = java.util.Collections.emptyList(); + } else { + validationErrors_ = null; + validationErrorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + metrics_ = null; + if (metricsBuilder_ != null) { + metricsBuilder_.dispose(); + metricsBuilder_ = 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_OptimizeToursResponse_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.OptimizeToursResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse build() { + com.google.maps.routeoptimization.v1.OptimizeToursResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursResponse buildPartial() { + com.google.maps.routeoptimization.v1.OptimizeToursResponse result = + new com.google.maps.routeoptimization.v1.OptimizeToursResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.OptimizeToursResponse result) { + if (routesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + routes_ = java.util.Collections.unmodifiableList(routes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.routes_ = routes_; + } else { + result.routes_ = routesBuilder_.build(); + } + if (skippedShipmentsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + skippedShipments_ = java.util.Collections.unmodifiableList(skippedShipments_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.skippedShipments_ = skippedShipments_; + } else { + result.skippedShipments_ = skippedShipmentsBuilder_.build(); + } + if (validationErrorsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + validationErrors_ = java.util.Collections.unmodifiableList(validationErrors_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.validationErrors_ = validationErrors_; + } else { + result.validationErrors_ = validationErrorsBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.OptimizeToursResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestLabel_ = requestLabel_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.metrics_ = metricsBuilder_ == null ? metrics_ : metricsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + 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.OptimizeToursResponse) { + return mergeFrom((com.google.maps.routeoptimization.v1.OptimizeToursResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.OptimizeToursResponse other) { + if (other == com.google.maps.routeoptimization.v1.OptimizeToursResponse.getDefaultInstance()) + return this; + if (routesBuilder_ == null) { + if (!other.routes_.isEmpty()) { + if (routes_.isEmpty()) { + routes_ = other.routes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoutesIsMutable(); + routes_.addAll(other.routes_); + } + onChanged(); + } + } else { + if (!other.routes_.isEmpty()) { + if (routesBuilder_.isEmpty()) { + routesBuilder_.dispose(); + routesBuilder_ = null; + routes_ = other.routes_; + bitField0_ = (bitField0_ & ~0x00000001); + routesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRoutesFieldBuilder() + : null; + } else { + routesBuilder_.addAllMessages(other.routes_); + } + } + } + if (!other.getRequestLabel().isEmpty()) { + requestLabel_ = other.requestLabel_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (skippedShipmentsBuilder_ == null) { + if (!other.skippedShipments_.isEmpty()) { + if (skippedShipments_.isEmpty()) { + skippedShipments_ = other.skippedShipments_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.addAll(other.skippedShipments_); + } + onChanged(); + } + } else { + if (!other.skippedShipments_.isEmpty()) { + if (skippedShipmentsBuilder_.isEmpty()) { + skippedShipmentsBuilder_.dispose(); + skippedShipmentsBuilder_ = null; + skippedShipments_ = other.skippedShipments_; + bitField0_ = (bitField0_ & ~0x00000004); + skippedShipmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSkippedShipmentsFieldBuilder() + : null; + } else { + skippedShipmentsBuilder_.addAllMessages(other.skippedShipments_); + } + } + } + if (validationErrorsBuilder_ == null) { + if (!other.validationErrors_.isEmpty()) { + if (validationErrors_.isEmpty()) { + validationErrors_ = other.validationErrors_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureValidationErrorsIsMutable(); + validationErrors_.addAll(other.validationErrors_); + } + onChanged(); + } + } else { + if (!other.validationErrors_.isEmpty()) { + if (validationErrorsBuilder_.isEmpty()) { + validationErrorsBuilder_.dispose(); + validationErrorsBuilder_ = null; + validationErrors_ = other.validationErrors_; + bitField0_ = (bitField0_ & ~0x00000008); + validationErrorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValidationErrorsFieldBuilder() + : null; + } else { + validationErrorsBuilder_.addAllMessages(other.validationErrors_); + } + } + } + if (other.hasMetrics()) { + mergeMetrics(other.getMetrics()); + } + 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.ShipmentRoute m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.parser(), + extensionRegistry); + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(m); + } else { + routesBuilder_.addMessage(m); + } + break; + } // case 10 + case 26: + { + requestLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + com.google.maps.routeoptimization.v1.SkippedShipment m = + input.readMessage( + com.google.maps.routeoptimization.v1.SkippedShipment.parser(), + extensionRegistry); + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(m); + } else { + skippedShipmentsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + com.google.maps.routeoptimization.v1.OptimizeToursValidationError m = + input.readMessage( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.parser(), + extensionRegistry); + if (validationErrorsBuilder_ == null) { + ensureValidationErrorsIsMutable(); + validationErrors_.add(m); + } else { + validationErrorsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + input.readMessage(getMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + 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 routes_ = + java.util.Collections.emptyList(); + + private void ensureRoutesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + routes_ = + new java.util.ArrayList(routes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + routesBuilder_; + + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public java.util.List getRoutesList() { + if (routesBuilder_ == null) { + return java.util.Collections.unmodifiableList(routes_); + } else { + return routesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public int getRoutesCount() { + if (routesBuilder_ == null) { + return routes_.size(); + } else { + return routesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute getRoutes(int index) { + if (routesBuilder_ == null) { + return routes_.get(index); + } else { + return routesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder setRoutes(int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.set(index, value); + onChanged(); + } else { + routesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder setRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.set(index, builderForValue.build()); + onChanged(); + } else { + routesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes(com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.add(value); + onChanged(); + } else { + routesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes(int index, com.google.maps.routeoptimization.v1.ShipmentRoute value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.add(index, value); + onChanged(); + } else { + routesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes( + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(builderForValue.build()); + onChanged(); + } else { + routesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addRoutes( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(index, builderForValue.build()); + onChanged(); + } else { + routesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder addAllRoutes( + java.lang.Iterable values) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, routes_); + onChanged(); + } else { + routesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder clearRoutes() { + if (routesBuilder_ == null) { + routes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + routesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public Builder removeRoutes(int index) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.remove(index); + onChanged(); + } else { + routesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder getRoutesBuilder(int index) { + return getRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder( + int index) { + if (routesBuilder_ == null) { + return routes_.get(index); + } else { + return routesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public java.util.List + getRoutesOrBuilderList() { + if (routesBuilder_ != null) { + return routesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(routes_); + } + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder addRoutesBuilder() { + return getRoutesFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Builder addRoutesBuilder(int index) { + return getRoutesFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()); + } + /** + * + * + *
+     * Routes computed for each vehicle; the i-th route corresponds to the i-th
+     * vehicle in the model.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + public java.util.List + getRoutesBuilderList() { + return getRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder> + getRoutesFieldBuilder() { + if (routesBuilder_ == null) { + routesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder, + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder>( + routes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + routes_ = null; + } + return routesBuilder_; + } + + private java.lang.Object requestLabel_ = ""; + /** + * + * + *
+     * Copy of the
+     * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+     * if a label was specified in the request.
+     * 
+ * + * string request_label = 3; + * + * @return The requestLabel. + */ + public java.lang.String getRequestLabel() { + java.lang.Object ref = requestLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Copy of the
+     * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+     * if a label was specified in the request.
+     * 
+ * + * string request_label = 3; + * + * @return The bytes for requestLabel. + */ + public com.google.protobuf.ByteString getRequestLabelBytes() { + java.lang.Object ref = requestLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Copy of the
+     * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+     * if a label was specified in the request.
+     * 
+ * + * string request_label = 3; + * + * @param value The requestLabel to set. + * @return This builder for chaining. + */ + public Builder setRequestLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestLabel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Copy of the
+     * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+     * if a label was specified in the request.
+     * 
+ * + * string request_label = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestLabel() { + requestLabel_ = getDefaultInstance().getRequestLabel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Copy of the
+     * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+     * if a label was specified in the request.
+     * 
+ * + * string request_label = 3; + * + * @param value The bytes for requestLabel to set. + * @return This builder for chaining. + */ + public Builder setRequestLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestLabel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List skippedShipments_ = + java.util.Collections.emptyList(); + + private void ensureSkippedShipmentsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + skippedShipments_ = + new java.util.ArrayList( + skippedShipments_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder, + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder> + skippedShipmentsBuilder_; + + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public java.util.List + getSkippedShipmentsList() { + if (skippedShipmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(skippedShipments_); + } else { + return skippedShipmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public int getSkippedShipmentsCount() { + if (skippedShipmentsBuilder_ == null) { + return skippedShipments_.size(); + } else { + return skippedShipmentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment getSkippedShipments(int index) { + if (skippedShipmentsBuilder_ == null) { + return skippedShipments_.get(index); + } else { + return skippedShipmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder setSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment value) { + if (skippedShipmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedShipmentsIsMutable(); + skippedShipments_.set(index, value); + onChanged(); + } else { + skippedShipmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder setSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment.Builder builderForValue) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.set(index, builderForValue.build()); + onChanged(); + } else { + skippedShipmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder addSkippedShipments(com.google.maps.routeoptimization.v1.SkippedShipment value) { + if (skippedShipmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(value); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder addSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment value) { + if (skippedShipmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(index, value); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder addSkippedShipments( + com.google.maps.routeoptimization.v1.SkippedShipment.Builder builderForValue) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(builderForValue.build()); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder addSkippedShipments( + int index, com.google.maps.routeoptimization.v1.SkippedShipment.Builder builderForValue) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.add(index, builderForValue.build()); + onChanged(); + } else { + skippedShipmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder addAllSkippedShipments( + java.lang.Iterable values) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, skippedShipments_); + onChanged(); + } else { + skippedShipmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder clearSkippedShipments() { + if (skippedShipmentsBuilder_ == null) { + skippedShipments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + skippedShipmentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public Builder removeSkippedShipments(int index) { + if (skippedShipmentsBuilder_ == null) { + ensureSkippedShipmentsIsMutable(); + skippedShipments_.remove(index); + onChanged(); + } else { + skippedShipmentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Builder getSkippedShipmentsBuilder( + int index) { + return getSkippedShipmentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder + getSkippedShipmentsOrBuilder(int index) { + if (skippedShipmentsBuilder_ == null) { + return skippedShipments_.get(index); + } else { + return skippedShipmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public java.util.List + getSkippedShipmentsOrBuilderList() { + if (skippedShipmentsBuilder_ != null) { + return skippedShipmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(skippedShipments_); + } + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Builder + addSkippedShipmentsBuilder() { + return getSkippedShipmentsFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.SkippedShipment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Builder addSkippedShipmentsBuilder( + int index) { + return getSkippedShipmentsFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.SkippedShipment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of all shipments skipped.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * + */ + public java.util.List + getSkippedShipmentsBuilderList() { + return getSkippedShipmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder, + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder> + getSkippedShipmentsFieldBuilder() { + if (skippedShipmentsBuilder_ == null) { + skippedShipmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder, + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder>( + skippedShipments_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + skippedShipments_ = null; + } + return skippedShipmentsBuilder_; + } + + private java.util.List + validationErrors_ = java.util.Collections.emptyList(); + + private void ensureValidationErrorsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + validationErrors_ = + new java.util.ArrayList< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError>( + validationErrors_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder> + validationErrorsBuilder_; + + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public java.util.List + getValidationErrorsList() { + if (validationErrorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(validationErrors_); + } else { + return validationErrorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public int getValidationErrorsCount() { + if (validationErrorsBuilder_ == null) { + return validationErrors_.size(); + } else { + return validationErrorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError getValidationErrors( + int index) { + if (validationErrorsBuilder_ == null) { + return validationErrors_.get(index); + } else { + return validationErrorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder setValidationErrors( + int index, com.google.maps.routeoptimization.v1.OptimizeToursValidationError value) { + if (validationErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValidationErrorsIsMutable(); + validationErrors_.set(index, value); + onChanged(); + } else { + validationErrorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder setValidationErrors( + int index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder builderForValue) { + if (validationErrorsBuilder_ == null) { + ensureValidationErrorsIsMutable(); + validationErrors_.set(index, builderForValue.build()); + onChanged(); + } else { + validationErrorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder addValidationErrors( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError value) { + if (validationErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValidationErrorsIsMutable(); + validationErrors_.add(value); + onChanged(); + } else { + validationErrorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder addValidationErrors( + int index, com.google.maps.routeoptimization.v1.OptimizeToursValidationError value) { + if (validationErrorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValidationErrorsIsMutable(); + validationErrors_.add(index, value); + onChanged(); + } else { + validationErrorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder addValidationErrors( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder builderForValue) { + if (validationErrorsBuilder_ == null) { + ensureValidationErrorsIsMutable(); + validationErrors_.add(builderForValue.build()); + onChanged(); + } else { + validationErrorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder addValidationErrors( + int index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder builderForValue) { + if (validationErrorsBuilder_ == null) { + ensureValidationErrorsIsMutable(); + validationErrors_.add(index, builderForValue.build()); + onChanged(); + } else { + validationErrorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder addAllValidationErrors( + java.lang.Iterable< + ? extends com.google.maps.routeoptimization.v1.OptimizeToursValidationError> + values) { + if (validationErrorsBuilder_ == null) { + ensureValidationErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, validationErrors_); + onChanged(); + } else { + validationErrorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder clearValidationErrors() { + if (validationErrorsBuilder_ == null) { + validationErrors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + validationErrorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public Builder removeValidationErrors(int index) { + if (validationErrorsBuilder_ == null) { + ensureValidationErrorsIsMutable(); + validationErrors_.remove(index); + onChanged(); + } else { + validationErrorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder + getValidationErrorsBuilder(int index) { + return getValidationErrorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder + getValidationErrorsOrBuilder(int index) { + if (validationErrorsBuilder_ == null) { + return validationErrors_.get(index); + } else { + return validationErrorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder> + getValidationErrorsOrBuilderList() { + if (validationErrorsBuilder_ != null) { + return validationErrorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(validationErrors_); + } + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder + addValidationErrorsBuilder() { + return getValidationErrorsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .getDefaultInstance()); + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder + addValidationErrorsBuilder(int index) { + return getValidationErrorsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .getDefaultInstance()); + } + /** + * + * + *
+     * List of all the validation errors that we were able to detect
+     * independently. See the "MULTIPLE ERRORS" explanation for the
+     * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+     * message.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + public java.util.List + getValidationErrorsBuilderList() { + return getValidationErrorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder> + getValidationErrorsFieldBuilder() { + if (validationErrorsBuilder_ == null) { + validationErrorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder>( + validationErrors_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + validationErrors_ = null; + } + return validationErrorsBuilder_; + } + + private com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder> + metricsBuilder_; + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * + * @return Whether the metrics field is set. + */ + public boolean hasMetrics() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * + * @return The metrics. + */ + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics getMetrics() { + if (metricsBuilder_ == null) { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + .getDefaultInstance() + : metrics_; + } else { + return metricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + public Builder setMetrics( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + } else { + metricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + public Builder setMetrics( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder + builderForValue) { + if (metricsBuilder_ == null) { + metrics_ = builderForValue.build(); + } else { + metricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + public Builder mergeMetrics( + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics value) { + if (metricsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && metrics_ != null + && metrics_ + != com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + .getDefaultInstance()) { + getMetricsBuilder().mergeFrom(value); + } else { + metrics_ = value; + } + } else { + metricsBuilder_.mergeFrom(value); + } + if (metrics_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + public Builder clearMetrics() { + bitField0_ = (bitField0_ & ~0x00000010); + metrics_ = null; + if (metricsBuilder_ != null) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder + getMetricsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + public com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder + getMetricsOrBuilder() { + if (metricsBuilder_ != null) { + return metricsBuilder_.getMessageOrBuilder(); + } else { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + .getDefaultInstance() + : metrics_; + } + } + /** + * + * + *
+     * Duration, distance and usage metrics for this solution.
+     * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder> + getMetricsFieldBuilder() { + if (metricsBuilder_ == null) { + metricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.Builder, + com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder>( + getMetrics(), getParentForChildren(), isClean()); + metrics_ = null; + } + return metricsBuilder_; + } + + @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.OptimizeToursResponse) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.OptimizeToursResponse) + private static final com.google.maps.routeoptimization.v1.OptimizeToursResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.OptimizeToursResponse(); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizeToursResponse 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.OptimizeToursResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursResponseOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursResponseOrBuilder.java new file mode 100644 index 000000000000..3fed5b29e5d3 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursResponseOrBuilder.java @@ -0,0 +1,280 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface OptimizeToursResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.OptimizeToursResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + java.util.List getRoutesList(); + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + com.google.maps.routeoptimization.v1.ShipmentRoute getRoutes(int index); + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + int getRoutesCount(); + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + java.util.List + getRoutesOrBuilderList(); + /** + * + * + *
+   * Routes computed for each vehicle; the i-th route corresponds to the i-th
+   * vehicle in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder getRoutesOrBuilder(int index); + + /** + * + * + *
+   * Copy of the
+   * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+   * if a label was specified in the request.
+   * 
+ * + * string request_label = 3; + * + * @return The requestLabel. + */ + java.lang.String getRequestLabel(); + /** + * + * + *
+   * Copy of the
+   * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label],
+   * if a label was specified in the request.
+   * 
+ * + * string request_label = 3; + * + * @return The bytes for requestLabel. + */ + com.google.protobuf.ByteString getRequestLabelBytes(); + + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + java.util.List getSkippedShipmentsList(); + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + com.google.maps.routeoptimization.v1.SkippedShipment getSkippedShipments(int index); + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + int getSkippedShipmentsCount(); + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + java.util.List + getSkippedShipmentsOrBuilderList(); + /** + * + * + *
+   * The list of all shipments skipped.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder getSkippedShipmentsOrBuilder( + int index); + + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + java.util.List + getValidationErrorsList(); + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + com.google.maps.routeoptimization.v1.OptimizeToursValidationError getValidationErrors(int index); + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + int getValidationErrorsCount(); + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + java.util.List< + ? extends com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder> + getValidationErrorsOrBuilderList(); + /** + * + * + *
+   * List of all the validation errors that we were able to detect
+   * independently. See the "MULTIPLE ERRORS" explanation for the
+   * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
+   * message.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * + */ + com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder + getValidationErrorsOrBuilder(int index); + + /** + * + * + *
+   * Duration, distance and usage metrics for this solution.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * + * @return Whether the metrics field is set. + */ + boolean hasMetrics(); + /** + * + * + *
+   * Duration, distance and usage metrics for this solution.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * + * @return The metrics. + */ + com.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics getMetrics(); + /** + * + * + *
+   * Duration, distance and usage metrics for this solution.
+   * 
+ * + * .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + com.google.maps.routeoptimization.v1.OptimizeToursResponse.MetricsOrBuilder getMetricsOrBuilder(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursValidationError.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursValidationError.java new file mode 100644 index 000000000000..5ee77ddc7a4a --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursValidationError.java @@ -0,0 +1,4436 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Describes an error encountered when validating an `OptimizeToursRequest`.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursValidationError} + */ +public final class OptimizeToursValidationError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.OptimizeToursValidationError) + OptimizeToursValidationErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use OptimizeToursValidationError.newBuilder() to construct. + private OptimizeToursValidationError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OptimizeToursValidationError() { + displayName_ = ""; + fields_ = java.util.Collections.emptyList(); + errorMessage_ = ""; + offendingValues_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OptimizeToursValidationError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.class, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder.class); + } + + public interface FieldReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Name of the field, e.g., "vehicles".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Name of the field, e.g., "vehicles".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Index of the field if repeated.
+     * 
+ * + * int32 index = 2; + * + * @return Whether the index field is set. + */ + boolean hasIndex(); + /** + * + * + *
+     * Index of the field if repeated.
+     * 
+ * + * int32 index = 2; + * + * @return The index. + */ + int getIndex(); + + /** + * + * + *
+     * Key if the field is a map.
+     * 
+ * + * string key = 4; + * + * @return Whether the key field is set. + */ + boolean hasKey(); + /** + * + * + *
+     * Key if the field is a map.
+     * 
+ * + * string key = 4; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * Key if the field is a map.
+     * 
+ * + * string key = 4; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * Recursively nested sub-field, if needed.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + * + * @return Whether the subField field is set. + */ + boolean hasSubField(); + /** + * + * + *
+     * Recursively nested sub-field, if needed.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + * + * @return The subField. + */ + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference getSubField(); + /** + * + * + *
+     * Recursively nested sub-field, if needed.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReferenceOrBuilder + getSubFieldOrBuilder(); + + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.IndexOrKeyCase + getIndexOrKeyCase(); + } + /** + * + * + *
+   * Specifies a context for the validation error. A `FieldReference` always
+   * refers to a given field in this file and follows the same hierarchical
+   * structure. For example, we may specify element #2 of `start_time_windows`
+   * of vehicle #5 using:
+   * ```
+   * name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 }
+   * ```
+   * We however omit top-level entities such as `OptimizeToursRequest` or
+   * `ShipmentModel` to avoid crowding the message.
+   * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} + */ + public static final class FieldReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) + FieldReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldReference.newBuilder() to construct. + private FieldReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldReference() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FieldReference(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .class, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder.class); + } + + private int bitField0_; + private int indexOrKeyCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object indexOrKey_; + + public enum IndexOrKeyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INDEX(2), + KEY(4), + INDEXORKEY_NOT_SET(0); + private final int value; + + private IndexOrKeyCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IndexOrKeyCase valueOf(int value) { + return forNumber(value); + } + + public static IndexOrKeyCase forNumber(int value) { + switch (value) { + case 2: + return INDEX; + case 4: + return KEY; + case 0: + return INDEXORKEY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public IndexOrKeyCase getIndexOrKeyCase() { + return IndexOrKeyCase.forNumber(indexOrKeyCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the field, e.g., "vehicles".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * Name of the field, e.g., "vehicles".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FIELD_NUMBER = 2; + /** + * + * + *
+     * Index of the field if repeated.
+     * 
+ * + * int32 index = 2; + * + * @return Whether the index field is set. + */ + @java.lang.Override + public boolean hasIndex() { + return indexOrKeyCase_ == 2; + } + /** + * + * + *
+     * Index of the field if repeated.
+     * 
+ * + * int32 index = 2; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + if (indexOrKeyCase_ == 2) { + return (java.lang.Integer) indexOrKey_; + } + return 0; + } + + public static final int KEY_FIELD_NUMBER = 4; + /** + * + * + *
+     * Key if the field is a map.
+     * 
+ * + * string key = 4; + * + * @return Whether the key field is set. + */ + public boolean hasKey() { + return indexOrKeyCase_ == 4; + } + /** + * + * + *
+     * Key if the field is a map.
+     * 
+ * + * string key = 4; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = ""; + if (indexOrKeyCase_ == 4) { + ref = indexOrKey_; + } + 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(); + if (indexOrKeyCase_ == 4) { + indexOrKey_ = s; + } + return s; + } + } + /** + * + * + *
+     * Key if the field is a map.
+     * 
+ * + * string key = 4; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = ""; + if (indexOrKeyCase_ == 4) { + ref = indexOrKey_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (indexOrKeyCase_ == 4) { + indexOrKey_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUB_FIELD_FIELD_NUMBER = 3; + private com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + subField_; + /** + * + * + *
+     * Recursively nested sub-field, if needed.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + * + * @return Whether the subField field is set. + */ + @java.lang.Override + public boolean hasSubField() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Recursively nested sub-field, if needed.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + * + * @return The subField. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + getSubField() { + return subField_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance() + : subField_; + } + /** + * + * + *
+     * Recursively nested sub-field, if needed.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReferenceOrBuilder + getSubFieldOrBuilder() { + return subField_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance() + : subField_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (indexOrKeyCase_ == 2) { + output.writeInt32(2, (int) ((java.lang.Integer) indexOrKey_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSubField()); + } + if (indexOrKeyCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, indexOrKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (indexOrKeyCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 2, (int) ((java.lang.Integer) indexOrKey_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSubField()); + } + if (indexOrKeyCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, indexOrKey_); + } + 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.OptimizeToursValidationError.FieldReference)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference other = + (com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSubField() != other.hasSubField()) return false; + if (hasSubField()) { + if (!getSubField().equals(other.getSubField())) return false; + } + if (!getIndexOrKeyCase().equals(other.getIndexOrKeyCase())) return false; + switch (indexOrKeyCase_) { + case 2: + if (getIndex() != other.getIndex()) return false; + break; + case 4: + if (!getKey().equals(other.getKey())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasSubField()) { + hash = (37 * hash) + SUB_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getSubField().hashCode(); + } + switch (indexOrKeyCase_) { + case 2: + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + break; + case 4: + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + 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.OptimizeToursValidationError.FieldReference + 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 context for the validation error. A `FieldReference` always
+     * refers to a given field in this file and follows the same hierarchical
+     * structure. For example, we may specify element #2 of `start_time_windows`
+     * of vehicle #5 using:
+     * ```
+     * name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 }
+     * ```
+     * We however omit top-level entities such as `OptimizeToursRequest` or
+     * `ShipmentModel` to avoid crowding the message.
+     * 
+ * + * Protobuf type {@code + * google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .class, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSubFieldFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + subField_ = null; + if (subFieldBuilder_ != null) { + subFieldBuilder_.dispose(); + subFieldBuilder_ = null; + } + indexOrKeyCase_ = 0; + indexOrKey_ = 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_OptimizeToursValidationError_FieldReference_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + build() { + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + buildPartial() { + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference result = + new com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.subField_ = subFieldBuilder_ == null ? subField_ : subFieldBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference result) { + result.indexOrKeyCase_ = indexOrKeyCase_; + result.indexOrKey_ = this.indexOrKey_; + } + + @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.OptimizeToursValidationError.FieldReference) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference other) { + if (other + == com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSubField()) { + mergeSubField(other.getSubField()); + } + switch (other.getIndexOrKeyCase()) { + case INDEX: + { + setIndex(other.getIndex()); + break; + } + case KEY: + { + indexOrKeyCase_ = 4; + indexOrKey_ = other.indexOrKey_; + onChanged(); + break; + } + case INDEXORKEY_NOT_SET: + { + break; + } + } + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + indexOrKey_ = input.readInt32(); + indexOrKeyCase_ = 2; + break; + } // case 16 + case 26: + { + input.readMessage(getSubFieldFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + indexOrKeyCase_ = 4; + indexOrKey_ = s; + break; + } // case 34 + 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 indexOrKeyCase_ = 0; + private java.lang.Object indexOrKey_; + + public IndexOrKeyCase getIndexOrKeyCase() { + return IndexOrKeyCase.forNumber(indexOrKeyCase_); + } + + public Builder clearIndexOrKey() { + indexOrKeyCase_ = 0; + indexOrKey_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name of the field, e.g., "vehicles".
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of the field, e.g., "vehicles".
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of the field, e.g., "vehicles".
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the field, e.g., "vehicles".
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the field, e.g., "vehicles".
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Index of the field if repeated.
+       * 
+ * + * int32 index = 2; + * + * @return Whether the index field is set. + */ + public boolean hasIndex() { + return indexOrKeyCase_ == 2; + } + /** + * + * + *
+       * Index of the field if repeated.
+       * 
+ * + * int32 index = 2; + * + * @return The index. + */ + public int getIndex() { + if (indexOrKeyCase_ == 2) { + return (java.lang.Integer) indexOrKey_; + } + return 0; + } + /** + * + * + *
+       * Index of the field if repeated.
+       * 
+ * + * int32 index = 2; + * + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + + indexOrKeyCase_ = 2; + indexOrKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Index of the field if repeated.
+       * 
+ * + * int32 index = 2; + * + * @return This builder for chaining. + */ + public Builder clearIndex() { + if (indexOrKeyCase_ == 2) { + indexOrKeyCase_ = 0; + indexOrKey_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Key if the field is a map.
+       * 
+ * + * string key = 4; + * + * @return Whether the key field is set. + */ + @java.lang.Override + public boolean hasKey() { + return indexOrKeyCase_ == 4; + } + /** + * + * + *
+       * Key if the field is a map.
+       * 
+ * + * string key = 4; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = ""; + if (indexOrKeyCase_ == 4) { + ref = indexOrKey_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (indexOrKeyCase_ == 4) { + indexOrKey_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Key if the field is a map.
+       * 
+ * + * string key = 4; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = ""; + if (indexOrKeyCase_ == 4) { + ref = indexOrKey_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (indexOrKeyCase_ == 4) { + indexOrKey_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Key if the field is a map.
+       * 
+ * + * string key = 4; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + indexOrKeyCase_ = 4; + indexOrKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Key if the field is a map.
+       * 
+ * + * string key = 4; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + if (indexOrKeyCase_ == 4) { + indexOrKeyCase_ = 0; + indexOrKey_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Key if the field is a map.
+       * 
+ * + * string key = 4; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + indexOrKeyCase_ = 4; + indexOrKey_ = value; + onChanged(); + return this; + } + + private com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + subField_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + subFieldBuilder_; + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + * + * @return Whether the subField field is set. + */ + public boolean hasSubField() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + * + * @return The subField. + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + getSubField() { + if (subFieldBuilder_ == null) { + return subField_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance() + : subField_; + } else { + return subFieldBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + public Builder setSubField( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference value) { + if (subFieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subField_ = value; + } else { + subFieldBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + public Builder setSubField( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + builderForValue) { + if (subFieldBuilder_ == null) { + subField_ = builderForValue.build(); + } else { + subFieldBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + public Builder mergeSubField( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference value) { + if (subFieldBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && subField_ != null + && subField_ + != com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReference.getDefaultInstance()) { + getSubFieldBuilder().mergeFrom(value); + } else { + subField_ = value; + } + } else { + subFieldBuilder_.mergeFrom(value); + } + if (subField_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + public Builder clearSubField() { + bitField0_ = (bitField0_ & ~0x00000008); + subField_ = null; + if (subFieldBuilder_ != null) { + subFieldBuilder_.dispose(); + subFieldBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder + getSubFieldBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getSubFieldFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder + getSubFieldOrBuilder() { + if (subFieldBuilder_ != null) { + return subFieldBuilder_.getMessageOrBuilder(); + } else { + return subField_ == null + ? com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance() + : subField_; + } + } + /** + * + * + *
+       * Recursively nested sub-field, if needed.
+       * 
+ * + * + * .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + getSubFieldFieldBuilder() { + if (subFieldBuilder_ == null) { + subFieldBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder>(getSubField(), getParentForChildren(), isClean()); + subField_ = null; + } + return subFieldBuilder_; + } + + @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.OptimizeToursValidationError.FieldReference) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) + private static final com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReference + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference(); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldReference 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.OptimizeToursValidationError.FieldReference + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * + * + *
+   * A validation error is defined by the pair (`code`, `display_name`) which
+   * are always present.
+   *
+   * Other fields (below) provide more context about the error.
+   *
+   * *MULTIPLE ERRORS*:
+   * When there are multiple errors, the validation process tries to output
+   * several of them. Much like a compiler, this is an imperfect process. Some
+   * validation errors will be "fatal", meaning that they stop the entire
+   * validation process. This is the case for `display_name="UNSPECIFIED"`
+   * errors, among others. Some may cause the validation process to skip other
+   * errors.
+   *
+   * *STABILITY*:
+   * `code` and `display_name` should be very stable. But new codes and
+   * display names may appear over time, which may cause a given (invalid)
+   * request to yield a different (`code`, `display_name`) pair because the new
+   * error hid the old one (see "MULTIPLE ERRORS").
+   *
+   * *REFERENCE*: A list of all (code, name) pairs:
+   *
+   * * UNSPECIFIED = 0;
+   * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within
+   * the deadline.
+   *
+   * * REQUEST_OPTIONS_ERROR = 12;
+   *     * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
+   *     * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
+   *     * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
+   *     * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
+   *     * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
+   *     * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE
+   *       = 1207;
+   *     * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
+   *     * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
+   *     * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
+   *     * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
+   *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
+   *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
+   *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
+   *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
+   * * INJECTED_SOLUTION_ERROR = 20;
+   *     * INJECTED_SOLUTION_MISSING_LABEL = 2000;
+   *     * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
+   *     * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
+   *     * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003;
+   *     * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004;
+   *     * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
+   *     * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
+   *     * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
+   *     * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
+   * * SHIPMENT_MODEL_ERROR = 22;
+   *     * SHIPMENT_MODEL_TOO_LARGE = 2200;
+   *     * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
+   *     * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
+   *     * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
+   *     * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
+   *     * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
+   *     * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206;
+   *     * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207;
+   * * INDEX_ERROR = 24;
+   * * TAG_ERROR = 26;
+   * * TIME_WINDOW_ERROR = 28;
+   *     * TIME_WINDOW_INVALID_START_TIME = 2800;
+   *     * TIME_WINDOW_INVALID_END_TIME = 2801;
+   *     * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
+   *     * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
+   *     * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
+   *     * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
+   *     * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
+   *     * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
+   *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME
+   *       = 2808;
+   *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
+   *     * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME
+   *       = 2810;
+   *     * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
+   *     * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
+   *     * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
+   *     * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
+   *     * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
+   *     * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
+   *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
+   *       = 2817;
+   *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
+   *     * TRANSITION_ATTRIBUTES_ERROR = 30;
+   *     * TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
+   *     * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
+   *     * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
+   *     * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
+   *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
+   *     * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
+   *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
+   *     * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
+   *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
+   *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
+   * * AMOUNT_ERROR = 31;
+   *     * AMOUNT_NEGATIVE_VALUE = 3100;
+   * * LOAD_LIMIT_ERROR = 33;
+   *     * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
+   *     * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
+   *     * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
+   *     * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
+   *     * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
+   *     * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
+   *     * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
+   * * INTERVAL_ERROR = 34;
+   *     * INTERVAL_MIN_EXCEEDS_MAX = 3401;
+   *     * INTERVAL_NEGATIVE_MIN = 3402;
+   *     * INTERVAL_NEGATIVE_MAX = 3403;
+   *     * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
+   *     * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
+   * * DISTANCE_LIMIT_ERROR = 36;
+   *     * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
+   *     * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
+   *     * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
+   *     * DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
+   *     * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
+   *     * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
+   * * DURATION_LIMIT_ERROR = 38;
+   *     * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
+   *     * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
+   *     * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
+   *     * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
+   *     * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
+   *     * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR
+   *       = 3807;
+   *     * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX
+   *       = 3808;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
+   *     * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
+   *     * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE
+   *       = 3812;
+   *     * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
+   *     * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION
+   *       = 3815;
+   * * SHIPMENT_ERROR = 40;
+   *     * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014;
+   *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
+   *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION
+   *       = 4001;
+   *     * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015;
+   *     * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016;
+   *     * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
+   *     * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
+   *     * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
+   *     * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
+   *     * SHIPMENT_INVALID_PENALTY_COST = 4006;
+   *     * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
+   *     * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
+   *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
+   *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
+   *     * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
+   *     * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
+   *     * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
+   * * VEHICLE_ERROR = 42;
+   *     * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
+   *     * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
+   *     * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
+   *     * VEHICLE_EMPTY_START_TAG = 4203;
+   *     * VEHICLE_DUPLICATE_START_TAG = 4204;
+   *     * VEHICLE_EMPTY_END_TAG = 4205;
+   *     * VEHICLE_DUPLICATE_END_TAG = 4206;
+   *     * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
+   *     * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
+   *     * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
+   *     * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
+   *     * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
+   *     * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
+   *     * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
+   *     * VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
+   *     * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
+   *     * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
+   *     * VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
+   *     * VEHICLE_INVALID_COST_PER_HOUR = 4218;
+   *     * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
+   *     * VEHICLE_INVALID_FIXED_COST = 4220;
+   *     * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
+   *     * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS
+   *       = 4223;
+   *     * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224;
+   *     * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
+   * * VISIT_REQUEST_ERROR = 44;
+   *     * VISIT_REQUEST_EMPTY_TAG = 4400;
+   *     * VISIT_REQUEST_DUPLICATE_TAG = 4401;
+   *     * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
+   *     * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
+   * * PRECEDENCE_ERROR = 46;
+   * * BREAK_ERROR = 48;
+   *     * BREAK_RULE_EMPTY = 4800;
+   *     * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
+   *     * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
+   *     * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
+   *     * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
+   *     * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
+   *     * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
+   *     * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
+   *     * BREAK_REQUEST_NON_SCHEDULABLE = 4808;
+   *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
+   *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
+   *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
+   *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION
+   *       = 4812;
+   *     * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
+   *     * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
+   *     * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
+   * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
+   * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
+   *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
+   *     * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
+   *     * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
+   *     * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
+   *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
+   *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
+   *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
+   *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
+   *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
+   *     * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
+   *     * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
+   * * VEHICLE_OPERATOR_ERROR = 54;
+   *     * VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
+   *     * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
+   *     * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
+   *     * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
+   *     * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
+   * * DURATION_SECONDS_MATRIX_ERROR = 56;
+   *     * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
+   *     * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
+   * 
+ * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The error display name.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The error display name.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELDS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference> + fields_; + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + @java.lang.Override + public java.util.List< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference> + getFieldsList() { + return fields_; + } + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + getFieldsOrBuilderList() { + return fields_; + } + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + @java.lang.Override + public int getFieldsCount() { + return fields_.size(); + } + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference getFields( + int index) { + return fields_.get(index); + } + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReferenceOrBuilder + getFieldsOrBuilder(int index) { + return fields_.get(index); + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * + * + *
+   * Human-readable string describing the error. There is a 1:1 mapping
+   * between `code` and `error_message` (when code != "UNSPECIFIED").
+   *
+   * *STABILITY*: Not stable: the error message associated to a given `code` may
+   * change (hopefully to clarify it) over time. Please rely on the
+   * `display_name` and `code` instead.
+   * 
+ * + * string error_message = 4; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + 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(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable string describing the error. There is a 1:1 mapping
+   * between `code` and `error_message` (when code != "UNSPECIFIED").
+   *
+   * *STABILITY*: Not stable: the error message associated to a given `code` may
+   * change (hopefully to clarify it) over time. Please rely on the
+   * `display_name` and `code` instead.
+   * 
+ * + * string error_message = 4; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFENDING_VALUES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object offendingValues_ = ""; + /** + * + * + *
+   * May contain the value(s) of the field(s). This is not always available. You
+   * should absolutely not rely on it and use it only for manual model
+   * debugging.
+   * 
+ * + * string offending_values = 5; + * + * @return The offendingValues. + */ + @java.lang.Override + public java.lang.String getOffendingValues() { + java.lang.Object ref = offendingValues_; + 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(); + offendingValues_ = s; + return s; + } + } + /** + * + * + *
+   * May contain the value(s) of the field(s). This is not always available. You
+   * should absolutely not rely on it and use it only for manual model
+   * debugging.
+   * 
+ * + * string offending_values = 5; + * + * @return The bytes for offendingValues. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOffendingValuesBytes() { + java.lang.Object ref = offendingValues_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + offendingValues_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ != 0) { + output.writeInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + for (int i = 0; i < fields_.size(); i++) { + output.writeMessage(3, fields_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, errorMessage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(offendingValues_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, offendingValues_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, fields_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, errorMessage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(offendingValues_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, offendingValues_); + } + 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.OptimizeToursValidationError)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.OptimizeToursValidationError other = + (com.google.maps.routeoptimization.v1.OptimizeToursValidationError) obj; + + if (getCode() != other.getCode()) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getFieldsList().equals(other.getFieldsList())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) return false; + if (!getOffendingValues().equals(other.getOffendingValues())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (37 * hash) + OFFENDING_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getOffendingValues().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError 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.OptimizeToursValidationError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError 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.OptimizeToursValidationError parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError 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.OptimizeToursValidationError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError 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.OptimizeToursValidationError + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError + 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.OptimizeToursValidationError 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.OptimizeToursValidationError 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.OptimizeToursValidationError 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; + } + /** + * + * + *
+   * Describes an error encountered when validating an `OptimizeToursRequest`.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OptimizeToursValidationError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.OptimizeToursValidationError) + com.google.maps.routeoptimization.v1.OptimizeToursValidationErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.class, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.OptimizeToursValidationError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + displayName_ = ""; + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + } else { + fields_ = null; + fieldsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + errorMessage_ = ""; + offendingValues_ = ""; + 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_OptimizeToursValidationError_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.OptimizeToursValidationError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError build() { + com.google.maps.routeoptimization.v1.OptimizeToursValidationError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError buildPartial() { + com.google.maps.routeoptimization.v1.OptimizeToursValidationError result = + new com.google.maps.routeoptimization.v1.OptimizeToursValidationError(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError result) { + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.errorMessage_ = errorMessage_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.offendingValues_ = offendingValues_; + } + } + + @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.OptimizeToursValidationError) { + return mergeFrom((com.google.maps.routeoptimization.v1.OptimizeToursValidationError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError other) { + if (other + == com.google.maps.routeoptimization.v1.OptimizeToursValidationError.getDefaultInstance()) + return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000004); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOffendingValues().isEmpty()) { + offendingValues_ = other.offendingValues_; + bitField0_ |= 0x00000010; + 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 8: + { + code_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference m = + input.readMessage( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReference.parser(), + extensionRegistry); + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(m); + } else { + fieldsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + errorMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + offendingValues_ = input.readStringRequireUtf8(); + 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 code_; + /** + * + * + *
+     * A validation error is defined by the pair (`code`, `display_name`) which
+     * are always present.
+     *
+     * Other fields (below) provide more context about the error.
+     *
+     * *MULTIPLE ERRORS*:
+     * When there are multiple errors, the validation process tries to output
+     * several of them. Much like a compiler, this is an imperfect process. Some
+     * validation errors will be "fatal", meaning that they stop the entire
+     * validation process. This is the case for `display_name="UNSPECIFIED"`
+     * errors, among others. Some may cause the validation process to skip other
+     * errors.
+     *
+     * *STABILITY*:
+     * `code` and `display_name` should be very stable. But new codes and
+     * display names may appear over time, which may cause a given (invalid)
+     * request to yield a different (`code`, `display_name`) pair because the new
+     * error hid the old one (see "MULTIPLE ERRORS").
+     *
+     * *REFERENCE*: A list of all (code, name) pairs:
+     *
+     * * UNSPECIFIED = 0;
+     * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within
+     * the deadline.
+     *
+     * * REQUEST_OPTIONS_ERROR = 12;
+     *     * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
+     *     * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
+     *     * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
+     *     * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
+     *     * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
+     *     * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE
+     *       = 1207;
+     *     * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
+     *     * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
+     *     * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
+     *     * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
+     *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
+     *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
+     *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
+     *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
+     * * INJECTED_SOLUTION_ERROR = 20;
+     *     * INJECTED_SOLUTION_MISSING_LABEL = 2000;
+     *     * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
+     *     * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
+     *     * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003;
+     *     * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004;
+     *     * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
+     *     * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
+     *     * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
+     *     * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
+     * * SHIPMENT_MODEL_ERROR = 22;
+     *     * SHIPMENT_MODEL_TOO_LARGE = 2200;
+     *     * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
+     *     * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
+     *     * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
+     *     * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
+     *     * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
+     *     * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206;
+     *     * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207;
+     * * INDEX_ERROR = 24;
+     * * TAG_ERROR = 26;
+     * * TIME_WINDOW_ERROR = 28;
+     *     * TIME_WINDOW_INVALID_START_TIME = 2800;
+     *     * TIME_WINDOW_INVALID_END_TIME = 2801;
+     *     * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
+     *     * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
+     *     * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
+     *     * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
+     *     * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
+     *     * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
+     *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME
+     *       = 2808;
+     *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
+     *     * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME
+     *       = 2810;
+     *     * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
+     *     * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
+     *     * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
+     *     * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
+     *     * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
+     *     * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
+     *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
+     *       = 2817;
+     *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
+     *     * TRANSITION_ATTRIBUTES_ERROR = 30;
+     *     * TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
+     *     * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
+     *     * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
+     *     * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
+     *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
+     *     * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
+     *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
+     *     * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
+     *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
+     *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
+     * * AMOUNT_ERROR = 31;
+     *     * AMOUNT_NEGATIVE_VALUE = 3100;
+     * * LOAD_LIMIT_ERROR = 33;
+     *     * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
+     *     * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
+     *     * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
+     *     * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
+     *     * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
+     *     * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
+     *     * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
+     * * INTERVAL_ERROR = 34;
+     *     * INTERVAL_MIN_EXCEEDS_MAX = 3401;
+     *     * INTERVAL_NEGATIVE_MIN = 3402;
+     *     * INTERVAL_NEGATIVE_MAX = 3403;
+     *     * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
+     *     * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
+     * * DISTANCE_LIMIT_ERROR = 36;
+     *     * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
+     *     * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
+     *     * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
+     *     * DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
+     *     * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
+     *     * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
+     * * DURATION_LIMIT_ERROR = 38;
+     *     * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
+     *     * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
+     *     * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
+     *     * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
+     *     * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
+     *     * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR
+     *       = 3807;
+     *     * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX
+     *       = 3808;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
+     *     * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
+     *     * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE
+     *       = 3812;
+     *     * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
+     *     * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 3815;
+     * * SHIPMENT_ERROR = 40;
+     *     * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014;
+     *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
+     *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 4001;
+     *     * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015;
+     *     * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016;
+     *     * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
+     *     * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
+     *     * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
+     *     * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
+     *     * SHIPMENT_INVALID_PENALTY_COST = 4006;
+     *     * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
+     *     * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
+     *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
+     *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
+     *     * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
+     *     * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
+     *     * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
+     * * VEHICLE_ERROR = 42;
+     *     * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
+     *     * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
+     *     * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
+     *     * VEHICLE_EMPTY_START_TAG = 4203;
+     *     * VEHICLE_DUPLICATE_START_TAG = 4204;
+     *     * VEHICLE_EMPTY_END_TAG = 4205;
+     *     * VEHICLE_DUPLICATE_END_TAG = 4206;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
+     *     * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
+     *     * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
+     *     * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
+     *     * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
+     *     * VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
+     *     * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
+     *     * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
+     *     * VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
+     *     * VEHICLE_INVALID_COST_PER_HOUR = 4218;
+     *     * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
+     *     * VEHICLE_INVALID_FIXED_COST = 4220;
+     *     * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
+     *     * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS
+     *       = 4223;
+     *     * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224;
+     *     * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
+     * * VISIT_REQUEST_ERROR = 44;
+     *     * VISIT_REQUEST_EMPTY_TAG = 4400;
+     *     * VISIT_REQUEST_DUPLICATE_TAG = 4401;
+     *     * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
+     *     * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
+     * * PRECEDENCE_ERROR = 46;
+     * * BREAK_ERROR = 48;
+     *     * BREAK_RULE_EMPTY = 4800;
+     *     * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
+     *     * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
+     *     * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
+     *     * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
+     *     * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
+     *     * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
+     *     * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
+     *     * BREAK_REQUEST_NON_SCHEDULABLE = 4808;
+     *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
+     *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
+     *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
+     *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 4812;
+     *     * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
+     *     * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
+     *     * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
+     * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
+     * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
+     *     * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
+     *     * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
+     *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
+     *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
+     *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
+     *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
+     *     * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
+     *     * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
+     * * VEHICLE_OPERATOR_ERROR = 54;
+     *     * VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
+     *     * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
+     *     * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
+     *     * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
+     *     * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
+     * * DURATION_SECONDS_MATRIX_ERROR = 56;
+     *     * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
+     *     * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
+     * 
+ * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * + * + *
+     * A validation error is defined by the pair (`code`, `display_name`) which
+     * are always present.
+     *
+     * Other fields (below) provide more context about the error.
+     *
+     * *MULTIPLE ERRORS*:
+     * When there are multiple errors, the validation process tries to output
+     * several of them. Much like a compiler, this is an imperfect process. Some
+     * validation errors will be "fatal", meaning that they stop the entire
+     * validation process. This is the case for `display_name="UNSPECIFIED"`
+     * errors, among others. Some may cause the validation process to skip other
+     * errors.
+     *
+     * *STABILITY*:
+     * `code` and `display_name` should be very stable. But new codes and
+     * display names may appear over time, which may cause a given (invalid)
+     * request to yield a different (`code`, `display_name`) pair because the new
+     * error hid the old one (see "MULTIPLE ERRORS").
+     *
+     * *REFERENCE*: A list of all (code, name) pairs:
+     *
+     * * UNSPECIFIED = 0;
+     * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within
+     * the deadline.
+     *
+     * * REQUEST_OPTIONS_ERROR = 12;
+     *     * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
+     *     * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
+     *     * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
+     *     * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
+     *     * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
+     *     * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE
+     *       = 1207;
+     *     * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
+     *     * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
+     *     * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
+     *     * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
+     *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
+     *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
+     *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
+     *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
+     * * INJECTED_SOLUTION_ERROR = 20;
+     *     * INJECTED_SOLUTION_MISSING_LABEL = 2000;
+     *     * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
+     *     * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
+     *     * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003;
+     *     * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004;
+     *     * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
+     *     * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
+     *     * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
+     *     * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
+     * * SHIPMENT_MODEL_ERROR = 22;
+     *     * SHIPMENT_MODEL_TOO_LARGE = 2200;
+     *     * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
+     *     * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
+     *     * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
+     *     * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
+     *     * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
+     *     * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206;
+     *     * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207;
+     * * INDEX_ERROR = 24;
+     * * TAG_ERROR = 26;
+     * * TIME_WINDOW_ERROR = 28;
+     *     * TIME_WINDOW_INVALID_START_TIME = 2800;
+     *     * TIME_WINDOW_INVALID_END_TIME = 2801;
+     *     * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
+     *     * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
+     *     * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
+     *     * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
+     *     * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
+     *     * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
+     *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME
+     *       = 2808;
+     *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
+     *     * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME
+     *       = 2810;
+     *     * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
+     *     * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
+     *     * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
+     *     * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
+     *     * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
+     *     * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
+     *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
+     *       = 2817;
+     *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
+     *     * TRANSITION_ATTRIBUTES_ERROR = 30;
+     *     * TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
+     *     * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
+     *     * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
+     *     * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
+     *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
+     *     * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
+     *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
+     *     * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
+     *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
+     *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
+     * * AMOUNT_ERROR = 31;
+     *     * AMOUNT_NEGATIVE_VALUE = 3100;
+     * * LOAD_LIMIT_ERROR = 33;
+     *     * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
+     *     * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
+     *     * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
+     *     * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
+     *     * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
+     *     * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
+     *     * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
+     * * INTERVAL_ERROR = 34;
+     *     * INTERVAL_MIN_EXCEEDS_MAX = 3401;
+     *     * INTERVAL_NEGATIVE_MIN = 3402;
+     *     * INTERVAL_NEGATIVE_MAX = 3403;
+     *     * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
+     *     * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
+     * * DISTANCE_LIMIT_ERROR = 36;
+     *     * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
+     *     * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
+     *     * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
+     *     * DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
+     *     * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
+     *     * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
+     * * DURATION_LIMIT_ERROR = 38;
+     *     * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
+     *     * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
+     *     * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
+     *     * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
+     *     * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
+     *     * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR
+     *       = 3807;
+     *     * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX
+     *       = 3808;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
+     *     * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
+     *     * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE
+     *       = 3812;
+     *     * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
+     *     * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 3815;
+     * * SHIPMENT_ERROR = 40;
+     *     * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014;
+     *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
+     *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 4001;
+     *     * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015;
+     *     * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016;
+     *     * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
+     *     * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
+     *     * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
+     *     * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
+     *     * SHIPMENT_INVALID_PENALTY_COST = 4006;
+     *     * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
+     *     * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
+     *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
+     *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
+     *     * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
+     *     * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
+     *     * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
+     * * VEHICLE_ERROR = 42;
+     *     * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
+     *     * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
+     *     * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
+     *     * VEHICLE_EMPTY_START_TAG = 4203;
+     *     * VEHICLE_DUPLICATE_START_TAG = 4204;
+     *     * VEHICLE_EMPTY_END_TAG = 4205;
+     *     * VEHICLE_DUPLICATE_END_TAG = 4206;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
+     *     * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
+     *     * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
+     *     * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
+     *     * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
+     *     * VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
+     *     * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
+     *     * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
+     *     * VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
+     *     * VEHICLE_INVALID_COST_PER_HOUR = 4218;
+     *     * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
+     *     * VEHICLE_INVALID_FIXED_COST = 4220;
+     *     * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
+     *     * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS
+     *       = 4223;
+     *     * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224;
+     *     * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
+     * * VISIT_REQUEST_ERROR = 44;
+     *     * VISIT_REQUEST_EMPTY_TAG = 4400;
+     *     * VISIT_REQUEST_DUPLICATE_TAG = 4401;
+     *     * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
+     *     * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
+     * * PRECEDENCE_ERROR = 46;
+     * * BREAK_ERROR = 48;
+     *     * BREAK_RULE_EMPTY = 4800;
+     *     * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
+     *     * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
+     *     * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
+     *     * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
+     *     * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
+     *     * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
+     *     * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
+     *     * BREAK_REQUEST_NON_SCHEDULABLE = 4808;
+     *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
+     *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
+     *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
+     *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 4812;
+     *     * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
+     *     * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
+     *     * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
+     * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
+     * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
+     *     * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
+     *     * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
+     *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
+     *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
+     *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
+     *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
+     *     * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
+     *     * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
+     * * VEHICLE_OPERATOR_ERROR = 54;
+     *     * VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
+     *     * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
+     *     * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
+     *     * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
+     *     * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
+     * * DURATION_SECONDS_MATRIX_ERROR = 56;
+     *     * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
+     *     * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
+     * 
+ * + * int32 code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A validation error is defined by the pair (`code`, `display_name`) which
+     * are always present.
+     *
+     * Other fields (below) provide more context about the error.
+     *
+     * *MULTIPLE ERRORS*:
+     * When there are multiple errors, the validation process tries to output
+     * several of them. Much like a compiler, this is an imperfect process. Some
+     * validation errors will be "fatal", meaning that they stop the entire
+     * validation process. This is the case for `display_name="UNSPECIFIED"`
+     * errors, among others. Some may cause the validation process to skip other
+     * errors.
+     *
+     * *STABILITY*:
+     * `code` and `display_name` should be very stable. But new codes and
+     * display names may appear over time, which may cause a given (invalid)
+     * request to yield a different (`code`, `display_name`) pair because the new
+     * error hid the old one (see "MULTIPLE ERRORS").
+     *
+     * *REFERENCE*: A list of all (code, name) pairs:
+     *
+     * * UNSPECIFIED = 0;
+     * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within
+     * the deadline.
+     *
+     * * REQUEST_OPTIONS_ERROR = 12;
+     *     * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
+     *     * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
+     *     * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
+     *     * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
+     *     * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
+     *     * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE
+     *       = 1207;
+     *     * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
+     *     * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
+     *     * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
+     *     * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
+     *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
+     *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
+     *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
+     *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
+     * * INJECTED_SOLUTION_ERROR = 20;
+     *     * INJECTED_SOLUTION_MISSING_LABEL = 2000;
+     *     * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
+     *     * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
+     *     * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003;
+     *     * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004;
+     *     * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
+     *     * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
+     *     * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
+     *     * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
+     * * SHIPMENT_MODEL_ERROR = 22;
+     *     * SHIPMENT_MODEL_TOO_LARGE = 2200;
+     *     * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
+     *     * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
+     *     * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
+     *     * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
+     *     * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
+     *     * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206;
+     *     * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207;
+     * * INDEX_ERROR = 24;
+     * * TAG_ERROR = 26;
+     * * TIME_WINDOW_ERROR = 28;
+     *     * TIME_WINDOW_INVALID_START_TIME = 2800;
+     *     * TIME_WINDOW_INVALID_END_TIME = 2801;
+     *     * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
+     *     * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
+     *     * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
+     *     * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
+     *     * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
+     *     * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
+     *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME
+     *       = 2808;
+     *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
+     *     * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME
+     *       = 2810;
+     *     * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
+     *     * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
+     *     * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
+     *     * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
+     *     * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
+     *     * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
+     *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
+     *       = 2817;
+     *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
+     *     * TRANSITION_ATTRIBUTES_ERROR = 30;
+     *     * TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
+     *     * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
+     *     * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
+     *     * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
+     *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
+     *     * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
+     *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
+     *     * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
+     *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
+     *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
+     * * AMOUNT_ERROR = 31;
+     *     * AMOUNT_NEGATIVE_VALUE = 3100;
+     * * LOAD_LIMIT_ERROR = 33;
+     *     * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
+     *     * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
+     *     * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
+     *     * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
+     *     * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
+     *     * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
+     *     * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
+     * * INTERVAL_ERROR = 34;
+     *     * INTERVAL_MIN_EXCEEDS_MAX = 3401;
+     *     * INTERVAL_NEGATIVE_MIN = 3402;
+     *     * INTERVAL_NEGATIVE_MAX = 3403;
+     *     * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
+     *     * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
+     * * DISTANCE_LIMIT_ERROR = 36;
+     *     * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
+     *     * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
+     *     * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
+     *     * DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
+     *     * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
+     *     * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
+     * * DURATION_LIMIT_ERROR = 38;
+     *     * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
+     *     * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
+     *     * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
+     *     * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
+     *     * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
+     *     * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR
+     *       = 3807;
+     *     * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX
+     *       = 3808;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
+     *     * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
+     *     * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE
+     *       = 3812;
+     *     * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
+     *     * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
+     *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 3815;
+     * * SHIPMENT_ERROR = 40;
+     *     * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014;
+     *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
+     *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 4001;
+     *     * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015;
+     *     * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016;
+     *     * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
+     *     * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
+     *     * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
+     *     * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
+     *     * SHIPMENT_INVALID_PENALTY_COST = 4006;
+     *     * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
+     *     * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
+     *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
+     *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
+     *     * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
+     *     * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
+     *     * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
+     * * VEHICLE_ERROR = 42;
+     *     * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
+     *     * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
+     *     * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
+     *     * VEHICLE_EMPTY_START_TAG = 4203;
+     *     * VEHICLE_DUPLICATE_START_TAG = 4204;
+     *     * VEHICLE_EMPTY_END_TAG = 4205;
+     *     * VEHICLE_DUPLICATE_END_TAG = 4206;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
+     *     * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
+     *     * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
+     *     * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
+     *     * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
+     *     * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
+     *     * VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
+     *     * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
+     *     * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
+     *     * VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
+     *     * VEHICLE_INVALID_COST_PER_HOUR = 4218;
+     *     * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
+     *     * VEHICLE_INVALID_FIXED_COST = 4220;
+     *     * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
+     *     * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS
+     *       = 4223;
+     *     * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224;
+     *     * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
+     * * VISIT_REQUEST_ERROR = 44;
+     *     * VISIT_REQUEST_EMPTY_TAG = 4400;
+     *     * VISIT_REQUEST_DUPLICATE_TAG = 4401;
+     *     * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
+     *     * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
+     * * PRECEDENCE_ERROR = 46;
+     * * BREAK_ERROR = 48;
+     *     * BREAK_RULE_EMPTY = 4800;
+     *     * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
+     *     * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
+     *     * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
+     *     * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
+     *     * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
+     *     * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
+     *     * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
+     *     * BREAK_REQUEST_NON_SCHEDULABLE = 4808;
+     *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
+     *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
+     *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
+     *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION
+     *       = 4812;
+     *     * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
+     *     * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
+     *     * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
+     * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
+     *     * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
+     * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
+     *     * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
+     *     * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
+     *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
+     *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
+     *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
+     *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
+     *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
+     *     * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
+     *     * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
+     * * VEHICLE_OPERATOR_ERROR = 54;
+     *     * VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
+     *     * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
+     *     * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
+     *     * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
+     *     * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
+     * * DURATION_SECONDS_MATRIX_ERROR = 56;
+     *     * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
+     *     * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
+     * 
+ * + * int32 code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The error display name.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The error display name.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The error display name.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The error display name.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The error display name.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference> + fields_ = java.util.Collections.emptyList(); + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + fields_ = + new java.util.ArrayList< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference>( + fields_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + fieldsBuilder_; + + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference> + getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder setFields( + int index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder setFields( + int index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder addFields( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder addFields( + int index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder addFields( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder addFields( + int index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder addAllFields( + java.lang.Iterable< + ? extends + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReference> + values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + getFieldsBuilder(int index) { + return getFieldsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReferenceOrBuilder + getFieldsOrBuilder(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public java.util.List< + ? extends + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + addFieldsBuilder() { + return getFieldsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance()); + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.Builder + addFieldsBuilder(int index) { + return getFieldsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .getDefaultInstance()); + } + /** + * + * + *
+     * An error context may involve 0, 1 (most of the time) or more fields. For
+     * example, referring to vehicle #4 and shipment #2's first pickup can be
+     * done as follows:
+     * ```
+     * fields { name: "vehicles" index: 4}
+     * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+     * ```
+     * Note, however, that the cardinality of `fields` should not change for a
+     * given error code.
+     * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + public java.util.List< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder> + getFieldsBuilderList() { + return getFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + .Builder, + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder>( + fields_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * Human-readable string describing the error. There is a 1:1 mapping
+     * between `code` and `error_message` (when code != "UNSPECIFIED").
+     *
+     * *STABILITY*: Not stable: the error message associated to a given `code` may
+     * change (hopefully to clarify it) over time. Please rely on the
+     * `display_name` and `code` instead.
+     * 
+ * + * string error_message = 4; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable string describing the error. There is a 1:1 mapping
+     * between `code` and `error_message` (when code != "UNSPECIFIED").
+     *
+     * *STABILITY*: Not stable: the error message associated to a given `code` may
+     * change (hopefully to clarify it) over time. Please rely on the
+     * `display_name` and `code` instead.
+     * 
+ * + * string error_message = 4; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable string describing the error. There is a 1:1 mapping
+     * between `code` and `error_message` (when code != "UNSPECIFIED").
+     *
+     * *STABILITY*: Not stable: the error message associated to a given `code` may
+     * change (hopefully to clarify it) over time. Please rely on the
+     * `display_name` and `code` instead.
+     * 
+ * + * string error_message = 4; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMessage_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable string describing the error. There is a 1:1 mapping
+     * between `code` and `error_message` (when code != "UNSPECIFIED").
+     *
+     * *STABILITY*: Not stable: the error message associated to a given `code` may
+     * change (hopefully to clarify it) over time. Please rely on the
+     * `display_name` and `code` instead.
+     * 
+ * + * string error_message = 4; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable string describing the error. There is a 1:1 mapping
+     * between `code` and `error_message` (when code != "UNSPECIFIED").
+     *
+     * *STABILITY*: Not stable: the error message associated to a given `code` may
+     * change (hopefully to clarify it) over time. Please rely on the
+     * `display_name` and `code` instead.
+     * 
+ * + * string error_message = 4; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMessage_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object offendingValues_ = ""; + /** + * + * + *
+     * May contain the value(s) of the field(s). This is not always available. You
+     * should absolutely not rely on it and use it only for manual model
+     * debugging.
+     * 
+ * + * string offending_values = 5; + * + * @return The offendingValues. + */ + public java.lang.String getOffendingValues() { + java.lang.Object ref = offendingValues_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + offendingValues_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * May contain the value(s) of the field(s). This is not always available. You
+     * should absolutely not rely on it and use it only for manual model
+     * debugging.
+     * 
+ * + * string offending_values = 5; + * + * @return The bytes for offendingValues. + */ + public com.google.protobuf.ByteString getOffendingValuesBytes() { + java.lang.Object ref = offendingValues_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + offendingValues_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * May contain the value(s) of the field(s). This is not always available. You
+     * should absolutely not rely on it and use it only for manual model
+     * debugging.
+     * 
+ * + * string offending_values = 5; + * + * @param value The offendingValues to set. + * @return This builder for chaining. + */ + public Builder setOffendingValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + offendingValues_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * May contain the value(s) of the field(s). This is not always available. You
+     * should absolutely not rely on it and use it only for manual model
+     * debugging.
+     * 
+ * + * string offending_values = 5; + * + * @return This builder for chaining. + */ + public Builder clearOffendingValues() { + offendingValues_ = getDefaultInstance().getOffendingValues(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * May contain the value(s) of the field(s). This is not always available. You
+     * should absolutely not rely on it and use it only for manual model
+     * debugging.
+     * 
+ * + * string offending_values = 5; + * + * @param value The bytes for offendingValues to set. + * @return This builder for chaining. + */ + public Builder setOffendingValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + offendingValues_ = value; + bitField0_ |= 0x00000010; + 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.OptimizeToursValidationError) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.OptimizeToursValidationError) + private static final com.google.maps.routeoptimization.v1.OptimizeToursValidationError + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.OptimizeToursValidationError(); + } + + public static com.google.maps.routeoptimization.v1.OptimizeToursValidationError + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizeToursValidationError 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.OptimizeToursValidationError + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursValidationErrorOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursValidationErrorOrBuilder.java new file mode 100644 index 000000000000..2b7827333e32 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OptimizeToursValidationErrorOrBuilder.java @@ -0,0 +1,472 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface OptimizeToursValidationErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.OptimizeToursValidationError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A validation error is defined by the pair (`code`, `display_name`) which
+   * are always present.
+   *
+   * Other fields (below) provide more context about the error.
+   *
+   * *MULTIPLE ERRORS*:
+   * When there are multiple errors, the validation process tries to output
+   * several of them. Much like a compiler, this is an imperfect process. Some
+   * validation errors will be "fatal", meaning that they stop the entire
+   * validation process. This is the case for `display_name="UNSPECIFIED"`
+   * errors, among others. Some may cause the validation process to skip other
+   * errors.
+   *
+   * *STABILITY*:
+   * `code` and `display_name` should be very stable. But new codes and
+   * display names may appear over time, which may cause a given (invalid)
+   * request to yield a different (`code`, `display_name`) pair because the new
+   * error hid the old one (see "MULTIPLE ERRORS").
+   *
+   * *REFERENCE*: A list of all (code, name) pairs:
+   *
+   * * UNSPECIFIED = 0;
+   * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within
+   * the deadline.
+   *
+   * * REQUEST_OPTIONS_ERROR = 12;
+   *     * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
+   *     * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
+   *     * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
+   *     * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
+   *     * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
+   *     * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE
+   *       = 1207;
+   *     * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
+   *     * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
+   *     * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
+   *     * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
+   *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
+   *     * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
+   *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
+   *     * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
+   * * INJECTED_SOLUTION_ERROR = 20;
+   *     * INJECTED_SOLUTION_MISSING_LABEL = 2000;
+   *     * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
+   *     * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
+   *     * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003;
+   *     * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004;
+   *     * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
+   *     * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
+   *     * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
+   *     * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
+   * * SHIPMENT_MODEL_ERROR = 22;
+   *     * SHIPMENT_MODEL_TOO_LARGE = 2200;
+   *     * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
+   *     * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
+   *     * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
+   *     * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
+   *     * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
+   *     * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206;
+   *     * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207;
+   * * INDEX_ERROR = 24;
+   * * TAG_ERROR = 26;
+   * * TIME_WINDOW_ERROR = 28;
+   *     * TIME_WINDOW_INVALID_START_TIME = 2800;
+   *     * TIME_WINDOW_INVALID_END_TIME = 2801;
+   *     * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
+   *     * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
+   *     * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
+   *     * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
+   *     * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
+   *     * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
+   *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME
+   *       = 2808;
+   *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
+   *     * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME
+   *       = 2810;
+   *     * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
+   *     * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
+   *     * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
+   *     * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
+   *     * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
+   *     * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
+   *     * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
+   *       = 2817;
+   *     * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
+   *     * TRANSITION_ATTRIBUTES_ERROR = 30;
+   *     * TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
+   *     * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
+   *     * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
+   *     * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
+   *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
+   *     * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
+   *     * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
+   *     * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
+   *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
+   *     * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
+   * * AMOUNT_ERROR = 31;
+   *     * AMOUNT_NEGATIVE_VALUE = 3100;
+   * * LOAD_LIMIT_ERROR = 33;
+   *     * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
+   *     * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
+   *     * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
+   *     * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
+   *     * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
+   *     * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
+   *     * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
+   * * INTERVAL_ERROR = 34;
+   *     * INTERVAL_MIN_EXCEEDS_MAX = 3401;
+   *     * INTERVAL_NEGATIVE_MIN = 3402;
+   *     * INTERVAL_NEGATIVE_MAX = 3403;
+   *     * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
+   *     * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
+   * * DISTANCE_LIMIT_ERROR = 36;
+   *     * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
+   *     * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
+   *     * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
+   *     * DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
+   *     * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
+   *     * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
+   * * DURATION_LIMIT_ERROR = 38;
+   *     * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
+   *     * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
+   *     * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
+   *     * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
+   *     * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
+   *     * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR
+   *       = 3807;
+   *     * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX
+   *       = 3808;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
+   *     * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
+   *     * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE
+   *       = 3812;
+   *     * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
+   *     * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
+   *     * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION
+   *       = 3815;
+   * * SHIPMENT_ERROR = 40;
+   *     * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014;
+   *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
+   *     * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION
+   *       = 4001;
+   *     * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015;
+   *     * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016;
+   *     * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
+   *     * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
+   *     * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
+   *     * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
+   *     * SHIPMENT_INVALID_PENALTY_COST = 4006;
+   *     * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
+   *     * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
+   *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
+   *     * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
+   *     * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
+   *     * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
+   *     * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
+   * * VEHICLE_ERROR = 42;
+   *     * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
+   *     * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
+   *     * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
+   *     * VEHICLE_EMPTY_START_TAG = 4203;
+   *     * VEHICLE_DUPLICATE_START_TAG = 4204;
+   *     * VEHICLE_EMPTY_END_TAG = 4205;
+   *     * VEHICLE_DUPLICATE_END_TAG = 4206;
+   *     * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
+   *     * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
+   *     * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
+   *     * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
+   *     * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
+   *     * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
+   *     * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
+   *     * VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
+   *     * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
+   *     * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
+   *     * VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
+   *     * VEHICLE_INVALID_COST_PER_HOUR = 4218;
+   *     * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
+   *     * VEHICLE_INVALID_FIXED_COST = 4220;
+   *     * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
+   *     * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS
+   *       = 4223;
+   *     * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224;
+   *     * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
+   * * VISIT_REQUEST_ERROR = 44;
+   *     * VISIT_REQUEST_EMPTY_TAG = 4400;
+   *     * VISIT_REQUEST_DUPLICATE_TAG = 4401;
+   *     * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
+   *     * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
+   * * PRECEDENCE_ERROR = 46;
+   * * BREAK_ERROR = 48;
+   *     * BREAK_RULE_EMPTY = 4800;
+   *     * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
+   *     * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
+   *     * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
+   *     * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
+   *     * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
+   *     * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
+   *     * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
+   *     * BREAK_REQUEST_NON_SCHEDULABLE = 4808;
+   *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
+   *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
+   *     * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
+   *     * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION
+   *       = 4812;
+   *     * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
+   *     * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
+   *     * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
+   * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
+   *     * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
+   * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
+   *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
+   *     * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
+   *     * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
+   *     * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
+   *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
+   *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
+   *     * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
+   *     * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
+   *     * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
+   *     * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
+   *     * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
+   * * VEHICLE_OPERATOR_ERROR = 54;
+   *     * VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
+   *     * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
+   *     * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
+   *     * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
+   *     * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
+   * * DURATION_SECONDS_MATRIX_ERROR = 56;
+   *     * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
+   *     * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
+   * 
+ * + * int32 code = 1; + * + * @return The code. + */ + int getCode(); + + /** + * + * + *
+   * The error display name.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The error display name.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + java.util.List + getFieldsList(); + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference getFields( + int index); + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + int getFieldsCount(); + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + java.util.List< + ? extends + com.google.maps.routeoptimization.v1.OptimizeToursValidationError + .FieldReferenceOrBuilder> + getFieldsOrBuilderList(); + /** + * + * + *
+   * An error context may involve 0, 1 (most of the time) or more fields. For
+   * example, referring to vehicle #4 and shipment #2's first pickup can be
+   * done as follows:
+   * ```
+   * fields { name: "vehicles" index: 4}
+   * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }
+   * ```
+   * Note, however, that the cardinality of `fields` should not change for a
+   * given error code.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * + */ + com.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReferenceOrBuilder + getFieldsOrBuilder(int index); + + /** + * + * + *
+   * Human-readable string describing the error. There is a 1:1 mapping
+   * between `code` and `error_message` (when code != "UNSPECIFIED").
+   *
+   * *STABILITY*: Not stable: the error message associated to a given `code` may
+   * change (hopefully to clarify it) over time. Please rely on the
+   * `display_name` and `code` instead.
+   * 
+ * + * string error_message = 4; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+   * Human-readable string describing the error. There is a 1:1 mapping
+   * between `code` and `error_message` (when code != "UNSPECIFIED").
+   *
+   * *STABILITY*: Not stable: the error message associated to a given `code` may
+   * change (hopefully to clarify it) over time. Please rely on the
+   * `display_name` and `code` instead.
+   * 
+ * + * string error_message = 4; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + + /** + * + * + *
+   * May contain the value(s) of the field(s). This is not always available. You
+   * should absolutely not rely on it and use it only for manual model
+   * debugging.
+   * 
+ * + * string offending_values = 5; + * + * @return The offendingValues. + */ + java.lang.String getOffendingValues(); + /** + * + * + *
+   * May contain the value(s) of the field(s). This is not always available. You
+   * should absolutely not rely on it and use it only for manual model
+   * debugging.
+   * 
+ * + * string offending_values = 5; + * + * @return The bytes for offendingValues. + */ + com.google.protobuf.ByteString getOffendingValuesBytes(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OutputConfig.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OutputConfig.java new file mode 100644 index 000000000000..299b81563f26 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OutputConfig.java @@ -0,0 +1,988 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Specify a destination for
+ * [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours]
+ * results.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OutputConfig} + */ +public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.OutputConfig) + OutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputConfig.newBuilder() to construct. + private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputConfig() { + dataFormat_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OutputConfig.class, + com.google.maps.routeoptimization.v1.OutputConfig.Builder.class); + } + + private int destinationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_DESTINATION(1), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * The Google Cloud Storage location to write the output to.
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * The Google Cloud Storage location to write the output to.
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsDestination) destination_; + } + return com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * The Google Cloud Storage location to write the output to.
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsDestination) destination_; + } + return com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } + + public static final int DATA_FORMAT_FIELD_NUMBER = 2; + private int dataFormat_ = 0; + /** + * + * + *
+   * Required. The output data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+   * Required. The output data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DataFormat getDataFormat() { + com.google.maps.routeoptimization.v1.DataFormat result = + com.google.maps.routeoptimization.v1.DataFormat.forNumber(dataFormat_); + return result == null ? com.google.maps.routeoptimization.v1.DataFormat.UNRECOGNIZED : result; + } + + 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 (destinationCase_ == 1) { + output.writeMessage(1, (com.google.maps.routeoptimization.v1.GcsDestination) destination_); + } + if (dataFormat_ + != com.google.maps.routeoptimization.v1.DataFormat.DATA_FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, dataFormat_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.maps.routeoptimization.v1.GcsDestination) destination_); + } + if (dataFormat_ + != com.google.maps.routeoptimization.v1.DataFormat.DATA_FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, dataFormat_); + } + 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.OutputConfig)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.OutputConfig other = + (com.google.maps.routeoptimization.v1.OutputConfig) obj; + + if (dataFormat_ != other.dataFormat_) return false; + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATA_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + dataFormat_; + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.OutputConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OutputConfig 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.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OutputConfig 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.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.OutputConfig 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.OutputConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OutputConfig 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.OutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.OutputConfig 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.OutputConfig 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.OutputConfig 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.OutputConfig 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; + } + /** + * + * + *
+   * Specify a destination for
+   * [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours]
+   * results.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.OutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.OutputConfig) + com.google.maps.routeoptimization.v1.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.OutputConfig.class, + com.google.maps.routeoptimization.v1.OutputConfig.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.OutputConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.clear(); + } + dataFormat_ = 0; + destinationCase_ = 0; + destination_ = 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_OutputConfig_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OutputConfig getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OutputConfig build() { + com.google.maps.routeoptimization.v1.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.OutputConfig buildPartial() { + com.google.maps.routeoptimization.v1.OutputConfig result = + new com.google.maps.routeoptimization.v1.OutputConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.OutputConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataFormat_ = dataFormat_; + } + } + + private void buildPartialOneofs(com.google.maps.routeoptimization.v1.OutputConfig result) { + result.destinationCase_ = destinationCase_; + result.destination_ = this.destination_; + if (destinationCase_ == 1 && gcsDestinationBuilder_ != null) { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + + @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.OutputConfig) { + return mergeFrom((com.google.maps.routeoptimization.v1.OutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.OutputConfig other) { + if (other == com.google.maps.routeoptimization.v1.OutputConfig.getDefaultInstance()) + return this; + if (other.dataFormat_ != 0) { + setDataFormatValue(other.getDataFormatValue()); + } + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry); + destinationCase_ = 1; + break; + } // case 10 + case 16: + { + dataFormat_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.GcsDestination, + com.google.maps.routeoptimization.v1.GcsDestination.Builder, + com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsDestination) destination_; + } + return com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.maps.routeoptimization.v1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.maps.routeoptimization.v1.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.maps.routeoptimization.v1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ + != com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.maps.routeoptimization.v1.GcsDestination.newBuilder( + (com.google.maps.routeoptimization.v1.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } else { + gcsDestinationBuilder_.setMessage(value); + } + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + public com.google.maps.routeoptimization.v1.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder + getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.maps.routeoptimization.v1.GcsDestination) destination_; + } + return com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location to write the output to.
+     * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.GcsDestination, + com.google.maps.routeoptimization.v1.GcsDestination.Builder, + com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.maps.routeoptimization.v1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.GcsDestination, + com.google.maps.routeoptimization.v1.GcsDestination.Builder, + com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder>( + (com.google.maps.routeoptimization.v1.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + return gcsDestinationBuilder_; + } + + private int dataFormat_ = 0; + /** + * + * + *
+     * Required. The output data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+     * Required. The output data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormatValue(int value) { + dataFormat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DataFormat getDataFormat() { + com.google.maps.routeoptimization.v1.DataFormat result = + com.google.maps.routeoptimization.v1.DataFormat.forNumber(dataFormat_); + return result == null ? com.google.maps.routeoptimization.v1.DataFormat.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. The output data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormat(com.google.maps.routeoptimization.v1.DataFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + dataFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output data format.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataFormat() { + bitField0_ = (bitField0_ & ~0x00000002); + dataFormat_ = 0; + 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.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.OutputConfig) + private static final com.google.maps.routeoptimization.v1.OutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.OutputConfig(); + } + + public static com.google.maps.routeoptimization.v1.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputConfig 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.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OutputConfigOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OutputConfigOrBuilder.java new file mode 100644 index 000000000000..7b4accf4347b --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/OutputConfigOrBuilder.java @@ -0,0 +1,92 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface OutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location to write the output to.
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location to write the output to.
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + com.google.maps.routeoptimization.v1.GcsDestination getGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location to write the output to.
+   * 
+ * + * .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + */ + com.google.maps.routeoptimization.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + * + * + *
+   * Required. The output data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + int getDataFormatValue(); + /** + * + * + *
+   * Required. The output data format.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataFormat. + */ + com.google.maps.routeoptimization.v1.DataFormat getDataFormat(); + + com.google.maps.routeoptimization.v1.OutputConfig.DestinationCase getDestinationCase(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationServiceProto.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationServiceProto.java new file mode 100644 index 000000000000..826b65562764 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/RouteOptimizationServiceProto.java @@ -0,0 +1,1319 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public final class RouteOptimizationServiceProto { + private RouteOptimizationServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_CostsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_CostsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentModel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Shipment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Shipment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Shipment_Load_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Vehicle_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimitsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimitsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Vehicle_ExtraVisitDurationForVisitTypeEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Vehicle_ExtraVisitDurationForVisitTypeEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_TimeWindow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_DistanceLimit_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_DistanceLimit_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_TransitionAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_TransitionAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Waypoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Waypoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_Location_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_Location_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BreakRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_LoadDemandsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_LoadDemandsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_VehicleLoadsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_VehicleLoadsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_RouteCostsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_RouteCostsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_SkippedShipment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_SkippedShipment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_MaxLoadsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_MaxLoadsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_InputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_InputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_OutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routeoptimization_v1_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routeoptimization_v1_GcsDestination_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nAgoogle/maps/routeoptimization/v1/route" + + "_optimization_service.proto\022 google.maps" + + ".routeoptimization.v1\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\032\037go" + + "ogle/api/field_behavior.proto\032#google/lo" + + "ngrunning/operations.proto\032\036google/proto" + + "buf/duration.proto\032\037google/protobuf/time" + + "stamp.proto\032\030google/type/latlng.proto\"\340\002" + + "\n\031BatchOptimizeToursRequest\022\023\n\006parent\030\001 " + + "\001(\tB\003\340A\002\022h\n\rmodel_configs\030\002 \003(\0132L.google" + + ".maps.routeoptimization.v1.BatchOptimize" + + "ToursRequest.AsyncModelConfigB\003\340A\002\032\303\001\n\020A" + + "syncModelConfig\022\031\n\014display_name\030\001 \001(\tB\003\340" + + "A\001\022H\n\014input_config\030\002 \001(\0132-.google.maps.r" + + "outeoptimization.v1.InputConfigB\003\340A\002\022J\n\r" + + "output_config\030\003 \001(\0132..google.maps.routeo" + + "ptimization.v1.OutputConfigB\003\340A\002\"\034\n\032Batc" + + "hOptimizeToursResponse\"\034\n\032BatchOptimizeT" + + "oursMetadata\"\220\t\n\024OptimizeToursRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022*\n\007timeout\030\002 \001(\0132\031.go" + + "ogle.protobuf.Duration\022>\n\005model\030\003 \001(\0132/." + + "google.maps.routeoptimization.v1.Shipmen" + + "tModel\022X\n\014solving_mode\030\004 \001(\0162B.google.ma" + + "ps.routeoptimization.v1.OptimizeToursReq" + + "uest.SolvingMode\022V\n\013search_mode\030\006 \001(\0162A." + + "google.maps.routeoptimization.v1.Optimiz" + + "eToursRequest.SearchMode\022W\n\036injected_fir" + + "st_solution_routes\030\007 \003(\0132/.google.maps.r" + + "outeoptimization.v1.ShipmentRoute\022b\n\034inj" + + "ected_solution_constraint\030\010 \001(\0132<.google" + + ".maps.routeoptimization.v1.InjectedSolut" + + "ionConstraint\022O\n\026refresh_details_routes\030" + + "\t \003(\0132/.google.maps.routeoptimization.v1" + + ".ShipmentRoute\0221\n)interpret_injected_sol" + + "utions_using_labels\030\n \001(\010\022\035\n\025consider_ro" + + "ad_traffic\030\013 \001(\010\022\032\n\022populate_polylines\030\014" + + " \001(\010\022%\n\035populate_transition_polylines\030\r " + + "\001(\010\0226\n.allow_large_deadline_despite_inte" + + "rruption_risk\030\016 \001(\010\022\036\n\026use_geodesic_dist" + + "ances\030\017 \001(\010\022\'\n\032geodesic_meters_per_secon" + + "d\030\020 \001(\001H\000\210\001\001\022\"\n\025max_validation_errors\030\005 " + + "\001(\005H\001\210\001\001\022\r\n\005label\030\021 \001(\t\"Y\n\013SolvingMode\022\021" + + "\n\rDEFAULT_SOLVE\020\000\022\021\n\rVALIDATE_ONLY\020\001\022$\n " + + "DETECT_SOME_INFEASIBLE_SHIPMENTS\020\002\"Z\n\nSe" + + "archMode\022\033\n\027SEARCH_MODE_UNSPECIFIED\020\000\022\017\n" + + "\013RETURN_FAST\020\001\022\036\n\032CONSUME_ALL_AVAILABLE_" + + "TIME\020\002B\035\n\033_geodesic_meters_per_secondB\030\n" + + "\026_max_validation_errors\"\256\006\n\025OptimizeTour" + + "sResponse\022?\n\006routes\030\001 \003(\0132/.google.maps." + + "routeoptimization.v1.ShipmentRoute\022\025\n\rre" + + "quest_label\030\003 \001(\t\022L\n\021skipped_shipments\030\004" + + " \003(\01321.google.maps.routeoptimization.v1." + + "SkippedShipment\022Y\n\021validation_errors\030\005 \003" + + "(\0132>.google.maps.routeoptimization.v1.Op" + + "timizeToursValidationError\022P\n\007metrics\030\006 " + + "\001(\0132?.google.maps.routeoptimization.v1.O" + + "ptimizeToursResponse.Metrics\032\301\003\n\007Metrics" + + "\022U\n\030aggregated_route_metrics\030\001 \001(\01323.goo" + + "gle.maps.routeoptimization.v1.Aggregated" + + "Metrics\022(\n skipped_mandatory_shipment_co" + + "unt\030\002 \001(\005\022\032\n\022used_vehicle_count\030\003 \001(\005\022?\n" + + "\033earliest_vehicle_start_time\030\004 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022;\n\027latest_vehicle" + + "_end_time\030\005 \001(\0132\032.google.protobuf.Timest" + + "amp\022Y\n\005costs\030\n \003(\0132J.google.maps.routeop" + + "timization.v1.OptimizeToursResponse.Metr" + + "ics.CostsEntry\022\022\n\ntotal_cost\030\006 \001(\001\032,\n\nCo" + + "stsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\001:\0028\001" + + "\"\273\n\n\rShipmentModel\022=\n\tshipments\030\001 \003(\0132*." + + "google.maps.routeoptimization.v1.Shipmen" + + "t\022;\n\010vehicles\030\002 \003(\0132).google.maps.routeo" + + "ptimization.v1.Vehicle\022 \n\023max_active_veh" + + "icles\030\004 \001(\005H\000\210\001\001\0225\n\021global_start_time\030\005 " + + "\001(\0132\032.google.protobuf.Timestamp\0223\n\017globa" + + "l_end_time\030\006 \001(\0132\032.google.protobuf.Times" + + "tamp\022%\n\035global_duration_cost_per_hour\030\007 " + + "\001(\001\022j\n\032duration_distance_matrices\030\010 \003(\0132" + + "F.google.maps.routeoptimization.v1.Shipm" + + "entModel.DurationDistanceMatrix\022)\n!durat" + + "ion_distance_matrix_src_tags\030\t \003(\t\022)\n!du" + + "ration_distance_matrix_dst_tags\030\n \003(\t\022U\n" + + "\025transition_attributes\030\013 \003(\01326.google.ma" + + "ps.routeoptimization.v1.TransitionAttrib" + + "utes\022f\n\037shipment_type_incompatibilities\030" + + "\014 \003(\0132=.google.maps.routeoptimization.v1" + + ".ShipmentTypeIncompatibility\022]\n\032shipment" + + "_type_requirements\030\r \003(\01329.google.maps.r" + + "outeoptimization.v1.ShipmentTypeRequirem" + + "ent\022X\n\020precedence_rules\030\016 \003(\0132>.google.m" + + "aps.routeoptimization.v1.ShipmentModel.P" + + "recedenceRule\032\322\001\n\026DurationDistanceMatrix" + + "\022X\n\004rows\030\001 \003(\0132J.google.maps.routeoptimi" + + "zation.v1.ShipmentModel.DurationDistance" + + "Matrix.Row\022\031\n\021vehicle_start_tag\030\002 \001(\t\032C\n" + + "\003Row\022,\n\tdurations\030\001 \003(\0132\031.google.protobu" + + "f.Duration\022\016\n\006meters\030\002 \003(\001\032\321\001\n\016Precedenc" + + "eRule\022\030\n\013first_index\030\001 \001(\005H\000\210\001\001\022\031\n\021first" + + "_is_delivery\030\003 \001(\010\022\031\n\014second_index\030\002 \001(\005" + + "H\001\210\001\001\022\032\n\022second_is_delivery\030\004 \001(\010\0222\n\017off" + + "set_duration\030\005 \001(\0132\031.google.protobuf.Dur" + + "ationB\016\n\014_first_indexB\017\n\r_second_indexB\026" + + "\n\024_max_active_vehicles\"\260\013\n\010Shipment\022\024\n\014d" + + "isplay_name\030\020 \001(\t\022H\n\007pickups\030\001 \003(\01327.goo" + + "gle.maps.routeoptimization.v1.Shipment.V" + + "isitRequest\022K\n\ndeliveries\030\002 \003(\01327.google" + + ".maps.routeoptimization.v1.Shipment.Visi" + + "tRequest\022Q\n\014load_demands\030\016 \003(\0132;.google." + + "maps.routeoptimization.v1.Shipment.LoadD" + + "emandsEntry\022\031\n\014penalty_cost\030\004 \001(\001H\000\210\001\001\022\037" + + "\n\027allowed_vehicle_indices\030\005 \003(\005\022\031\n\021costs" + + "_per_vehicle\030\006 \003(\001\022!\n\031costs_per_vehicle_" + + "indices\030\007 \003(\005\0225\n(pickup_to_delivery_rela" + + "tive_detour_limit\030\010 \001(\001H\001\210\001\001\022K\n(pickup_t" + + "o_delivery_absolute_detour_limit\030\t \001(\0132\031" + + ".google.protobuf.Duration\022@\n\035pickup_to_d" + + "elivery_time_limit\030\n \001(\0132\031.google.protob" + + "uf.Duration\022\025\n\rshipment_type\030\013 \001(\t\022\r\n\005la" + + "bel\030\014 \001(\t\022\016\n\006ignore\030\r \001(\010\032\362\004\n\014VisitReque" + + "st\022-\n\020arrival_location\030\001 \001(\0132\023.google.ty" + + "pe.LatLng\022D\n\020arrival_waypoint\030\002 \001(\0132*.go" + + "ogle.maps.routeoptimization.v1.Waypoint\022" + + "/\n\022departure_location\030\003 \001(\0132\023.google.typ" + + "e.LatLng\022F\n\022departure_waypoint\030\004 \001(\0132*.g" + + "oogle.maps.routeoptimization.v1.Waypoint" + + "\022\014\n\004tags\030\005 \003(\t\022B\n\014time_windows\030\006 \003(\0132,.g" + + "oogle.maps.routeoptimization.v1.TimeWind" + + "ow\022+\n\010duration\030\007 \001(\0132\031.google.protobuf.D" + + "uration\022\014\n\004cost\030\010 \001(\001\022^\n\014load_demands\030\014 " + + "\003(\0132H.google.maps.routeoptimization.v1.S" + + "hipment.VisitRequest.LoadDemandsEntry\022\023\n" + + "\013visit_types\030\n \003(\t\022\r\n\005label\030\013 \001(\t\032c\n\020Loa" + + "dDemandsEntry\022\013\n\003key\030\001 \001(\t\022>\n\005value\030\002 \001(" + + "\0132/.google.maps.routeoptimization.v1.Shi" + + "pment.Load:\0028\001\032\026\n\004Load\022\016\n\006amount\030\002 \001(\003\032c" + + "\n\020LoadDemandsEntry\022\013\n\003key\030\001 \001(\t\022>\n\005value" + + "\030\002 \001(\0132/.google.maps.routeoptimization.v" + + "1.Shipment.Load:\0028\001B\017\n\r_penalty_costB+\n)" + + "_pickup_to_delivery_relative_detour_limi" + + "t\"\246\002\n\033ShipmentTypeIncompatibility\022\r\n\005typ" + + "es\030\001 \003(\t\022o\n\024incompatibility_mode\030\002 \001(\0162Q" + + ".google.maps.routeoptimization.v1.Shipme" + + "ntTypeIncompatibility.IncompatibilityMod" + + "e\"\206\001\n\023IncompatibilityMode\022$\n INCOMPATIBI" + + "LITY_MODE_UNSPECIFIED\020\000\022!\n\035NOT_PERFORMED" + + "_BY_SAME_VEHICLE\020\001\022&\n\"NOT_IN_SAME_VEHICL" + + "E_SIMULTANEOUSLY\020\002\"\354\002\n\027ShipmentTypeRequi" + + "rement\022+\n#required_shipment_type_alterna" + + "tives\030\001 \003(\t\022 \n\030dependent_shipment_types\030" + + "\002 \003(\t\022c\n\020requirement_mode\030\003 \001(\0162I.google" + + ".maps.routeoptimization.v1.ShipmentTypeR" + + "equirement.RequirementMode\"\234\001\n\017Requireme" + + "ntMode\022 \n\034REQUIREMENT_MODE_UNSPECIFIED\020\000" + + "\022\035\n\031PERFORMED_BY_SAME_VEHICLE\020\001\022\"\n\036IN_SA" + + "ME_VEHICLE_AT_PICKUP_TIME\020\002\022$\n IN_SAME_V" + + "EHICLE_AT_DELIVERY_TIME\020\003\"\206\023\n\007Vehicle\022\024\n" + + "\014display_name\030 \001(\t\022I\n\013travel_mode\030\001 \001(\016" + + "24.google.maps.routeoptimization.v1.Vehi" + + "cle.TravelMode\022+\n\016start_location\030\003 \001(\0132\023" + + ".google.type.LatLng\022B\n\016start_waypoint\030\004 " + + "\001(\0132*.google.maps.routeoptimization.v1.W" + + "aypoint\022)\n\014end_location\030\005 \001(\0132\023.google.t" + + "ype.LatLng\022@\n\014end_waypoint\030\006 \001(\0132*.googl" + + "e.maps.routeoptimization.v1.Waypoint\022\022\n\n" + + "start_tags\030\007 \003(\t\022\020\n\010end_tags\030\010 \003(\t\022H\n\022st" + + "art_time_windows\030\t \003(\0132,.google.maps.rou" + + "teoptimization.v1.TimeWindow\022F\n\020end_time" + + "_windows\030\n \003(\0132,.google.maps.routeoptimi" + + "zation.v1.TimeWindow\022%\n\030travel_duration_" + + "multiple\030\013 \001(\001H\000\210\001\001\022S\n\020unloading_policy\030" + + "\014 \001(\01629.google.maps.routeoptimization.v1" + + ".Vehicle.UnloadingPolicy\022N\n\013load_limits\030" + + "\036 \003(\01329.google.maps.routeoptimization.v1" + + ".Vehicle.LoadLimitsEntry\022\025\n\rcost_per_hou" + + "r\030\020 \001(\001\022\036\n\026cost_per_traveled_hour\030\021 \001(\001\022" + + "\032\n\022cost_per_kilometer\030\022 \001(\001\022\022\n\nfixed_cos" + + "t\030\023 \001(\001\022\036\n\026used_if_route_is_empty\030\024 \001(\010\022" + + "U\n\024route_duration_limit\030\025 \001(\01327.google.m" + + "aps.routeoptimization.v1.Vehicle.Duratio" + + "nLimit\022V\n\025travel_duration_limit\030\026 \001(\01327." + + "google.maps.routeoptimization.v1.Vehicle" + + ".DurationLimit\022M\n\024route_distance_limit\030\027" + + " \001(\0132/.google.maps.routeoptimization.v1." + + "DistanceLimit\022z\n#extra_visit_duration_fo" + + "r_visit_type\030\030 \003(\0132M.google.maps.routeop" + + "timization.v1.Vehicle.ExtraVisitDuration" + + "ForVisitTypeEntry\022?\n\nbreak_rule\030\031 \001(\0132+." + + "google.maps.routeoptimization.v1.BreakRu" + + "le\022\r\n\005label\030\033 \001(\t\022\016\n\006ignore\030\034 \001(\010\032\323\002\n\tLo" + + "adLimit\022\025\n\010max_load\030\001 \001(\003H\000\210\001\001\022\025\n\rsoft_m" + + "ax_load\030\002 \001(\003\022$\n\034cost_per_unit_above_sof" + + "t_max\030\003 \001(\001\022Y\n\023start_load_interval\030\004 \001(\013" + + "2<.google.maps.routeoptimization.v1.Vehi" + + "cle.LoadLimit.Interval\022W\n\021end_load_inter" + + "val\030\005 \001(\0132<.google.maps.routeoptimizatio" + + "n.v1.Vehicle.LoadLimit.Interval\0321\n\010Inter" + + "val\022\013\n\003min\030\001 \001(\003\022\020\n\003max\030\002 \001(\003H\000\210\001\001B\006\n\004_m" + + "axB\013\n\t_max_load\032\360\002\n\rDurationLimit\022/\n\014max" + + "_duration\030\001 \001(\0132\031.google.protobuf.Durati" + + "on\0224\n\021soft_max_duration\030\002 \001(\0132\031.google.p" + + "rotobuf.Duration\022)\n\034cost_per_hour_after_" + + "soft_max\030\003 \001(\001H\000\210\001\001\022>\n\033quadratic_soft_ma" + + "x_duration\030\004 \001(\0132\031.google.protobuf.Durat" + + "ion\022:\n-cost_per_square_hour_after_quadra" + + "tic_soft_max\030\005 \001(\001H\001\210\001\001B\037\n\035_cost_per_hou" + + "r_after_soft_maxB0\n._cost_per_square_hou" + + "r_after_quadratic_soft_max\032f\n\017LoadLimits" + + "Entry\022\013\n\003key\030\001 \001(\t\022B\n\005value\030\002 \001(\01323.goog" + + "le.maps.routeoptimization.v1.Vehicle.Loa" + + "dLimit:\0028\001\032`\n#ExtraVisitDurationForVisit" + + "TypeEntry\022\013\n\003key\030\001 \001(\t\022(\n\005value\030\002 \001(\0132\031." + + "google.protobuf.Duration:\0028\001\"C\n\nTravelMo" + + "de\022\033\n\027TRAVEL_MODE_UNSPECIFIED\020\000\022\013\n\007DRIVI" + + "NG\020\001\022\013\n\007WALKING\020\002\"b\n\017UnloadingPolicy\022 \n\034" + + "UNLOADING_POLICY_UNSPECIFIED\020\000\022\025\n\021LAST_I" + + "N_FIRST_OUT\020\001\022\026\n\022FIRST_IN_FIRST_OUT\020\002B\033\n" + + "\031_travel_duration_multiple\"\204\003\n\nTimeWindo" + + "w\022.\n\nstart_time\030\001 \001(\0132\032.google.protobuf." + + "Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google.pro" + + "tobuf.Timestamp\0223\n\017soft_start_time\030\003 \001(\013" + + "2\032.google.protobuf.Timestamp\0221\n\rsoft_end" + + "_time\030\004 \001(\0132\032.google.protobuf.Timestamp\022" + + "1\n$cost_per_hour_before_soft_start_time\030" + + "\005 \001(\001H\000\210\001\001\022.\n!cost_per_hour_after_soft_e" + + "nd_time\030\006 \001(\001H\001\210\001\001B\'\n%_cost_per_hour_bef" + + "ore_soft_start_timeB$\n\"_cost_per_hour_af" + + "ter_soft_end_time\"\277\001\n\rDistanceLimit\022\027\n\nm" + + "ax_meters\030\001 \001(\003H\000\210\001\001\022\034\n\017soft_max_meters\030" + + "\002 \001(\003H\001\210\001\001\022.\n!cost_per_kilometer_above_s" + + "oft_max\030\003 \001(\001H\002\210\001\001B\r\n\013_max_metersB\022\n\020_so" + + "ft_max_metersB$\n\"_cost_per_kilometer_abo" + + "ve_soft_max\"\211\002\n\024TransitionAttributes\022\017\n\007" + + "src_tag\030\001 \001(\t\022\030\n\020excluded_src_tag\030\002 \001(\t\022" + + "\017\n\007dst_tag\030\003 \001(\t\022\030\n\020excluded_dst_tag\030\004 \001" + + "(\t\022\014\n\004cost\030\005 \001(\001\022\032\n\022cost_per_kilometer\030\006" + + " \001(\001\022G\n\016distance_limit\030\007 \001(\0132/.google.ma" + + "ps.routeoptimization.v1.DistanceLimit\022(\n" + + "\005delay\030\010 \001(\0132\031.google.protobuf.Duration\"" + + "\212\001\n\010Waypoint\022>\n\010location\030\001 \001(\0132*.google." + + "maps.routeoptimization.v1.LocationH\000\022\022\n\010" + + "place_id\030\002 \001(\tH\000\022\031\n\014side_of_road\030\003 \001(\010B\003" + + "\340A\001B\017\n\rlocation_type\"R\n\010Location\022$\n\007lat_" + + "lng\030\001 \001(\0132\023.google.type.LatLng\022\024\n\007headin" + + "g\030\002 \001(\005H\000\210\001\001B\n\n\010_heading\"\224\004\n\tBreakRule\022P" + + "\n\016break_requests\030\001 \003(\01328.google.maps.rou" + + "teoptimization.v1.BreakRule.BreakRequest" + + "\022^\n\025frequency_constraints\030\002 \003(\0132?.google" + + ".maps.routeoptimization.v1.BreakRule.Fre" + + "quencyConstraint\032\276\001\n\014BreakRequest\022<\n\023ear" + + "liest_start_time\030\001 \001(\0132\032.google.protobuf" + + ".TimestampB\003\340A\002\022:\n\021latest_start_time\030\002 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\002\0224\n\014m" + + "in_duration\030\003 \001(\0132\031.google.protobuf.Dura" + + "tionB\003\340A\002\032\223\001\n\023FrequencyConstraint\022:\n\022min" + + "_break_duration\030\001 \001(\0132\031.google.protobuf." + + "DurationB\003\340A\002\022@\n\030max_inter_break_duratio" + + "n\030\002 \001(\0132\031.google.protobuf.DurationB\003\340A\002\"" + + "\346\017\n\rShipmentRoute\022\025\n\rvehicle_index\030\001 \001(\005" + + "\022\025\n\rvehicle_label\030\002 \001(\t\0226\n\022vehicle_start" + + "_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022" + + "4\n\020vehicle_end_time\030\006 \001(\0132\032.google.proto" + + "buf.Timestamp\022E\n\006visits\030\007 \003(\01325.google.m" + + "aps.routeoptimization.v1.ShipmentRoute.V" + + "isit\022O\n\013transitions\030\010 \003(\0132:.google.maps." + + "routeoptimization.v1.ShipmentRoute.Trans" + + "ition\022#\n\033has_traffic_infeasibilities\030\t \001" + + "(\010\022W\n\016route_polyline\030\n \001(\0132?.google.maps" + + ".routeoptimization.v1.ShipmentRoute.Enco" + + "dedPolyline\022E\n\006breaks\030\013 \003(\01325.google.map" + + "s.routeoptimization.v1.ShipmentRoute.Bre" + + "ak\022D\n\007metrics\030\014 \001(\01323.google.maps.routeo" + + "ptimization.v1.AggregatedMetrics\022T\n\013rout" + + "e_costs\030\021 \003(\0132?.google.maps.routeoptimiz" + + "ation.v1.ShipmentRoute.RouteCostsEntry\022\030" + + "\n\020route_total_cost\030\022 \001(\001\032\232\003\n\005Visit\022\026\n\016sh" + + "ipment_index\030\001 \001(\005\022\021\n\tis_pickup\030\002 \001(\010\022\033\n" + + "\023visit_request_index\030\003 \001(\005\022.\n\nstart_time" + + "\030\004 \001(\0132\032.google.protobuf.Timestamp\022\\\n\014lo" + + "ad_demands\030\013 \003(\0132F.google.maps.routeopti" + + "mization.v1.ShipmentRoute.Visit.LoadDema" + + "ndsEntry\022)\n\006detour\030\006 \001(\0132\031.google.protob" + + "uf.Duration\022\026\n\016shipment_label\030\007 \001(\t\022\023\n\013v" + + "isit_label\030\010 \001(\t\032c\n\020LoadDemandsEntry\022\013\n\003" + + "key\030\001 \001(\t\022>\n\005value\030\002 \001(\0132/.google.maps.r" + + "outeoptimization.v1.Shipment.Load:\0028\001\032\255\005" + + "\n\nTransition\0222\n\017travel_duration\030\001 \001(\0132\031." + + "google.protobuf.Duration\022\036\n\026travel_dista" + + "nce_meters\030\002 \001(\001\022 \n\030traffic_info_unavail" + + "able\030\003 \001(\010\0221\n\016delay_duration\030\004 \001(\0132\031.goo" + + "gle.protobuf.Duration\0221\n\016break_duration\030" + + "\005 \001(\0132\031.google.protobuf.Duration\0220\n\rwait" + + "_duration\030\006 \001(\0132\031.google.protobuf.Durati" + + "on\0221\n\016total_duration\030\007 \001(\0132\031.google.prot" + + "obuf.Duration\022.\n\nstart_time\030\010 \001(\0132\032.goog" + + "le.protobuf.Timestamp\022W\n\016route_polyline\030" + + "\t \001(\0132?.google.maps.routeoptimization.v1" + + ".ShipmentRoute.EncodedPolyline\022c\n\rvehicl" + + "e_loads\030\013 \003(\0132L.google.maps.routeoptimiz" + + "ation.v1.ShipmentRoute.Transition.Vehicl" + + "eLoadsEntry\032p\n\021VehicleLoadsEntry\022\013\n\003key\030" + + "\001 \001(\t\022J\n\005value\030\002 \001(\0132;.google.maps.route" + + "optimization.v1.ShipmentRoute.VehicleLoa" + + "d:\0028\001\032\035\n\013VehicleLoad\022\016\n\006amount\030\001 \001(\003\032!\n\017" + + "EncodedPolyline\022\016\n\006points\030\001 \001(\t\032d\n\005Break" + + "\022.\n\nstart_time\030\001 \001(\0132\032.google.protobuf.T" + + "imestamp\022+\n\010duration\030\002 \001(\0132\031.google.prot" + + "obuf.Duration\0321\n\017RouteCostsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\001:\0028\001\"\206\005\n\017SkippedShip" + + "ment\022\r\n\005index\030\001 \001(\005\022\r\n\005label\030\002 \001(\t\022I\n\007re" + + "asons\030\003 \003(\01328.google.maps.routeoptimizat" + + "ion.v1.SkippedShipment.Reason\032\211\004\n\006Reason" + + "\022K\n\004code\030\001 \001(\0162=.google.maps.routeoptimi" + + "zation.v1.SkippedShipment.Reason.Code\022\"\n" + + "\025example_vehicle_index\030\002 \001(\005H\000\210\001\001\022&\n\036exa" + + "mple_exceeded_capacity_type\030\003 \001(\t\"\313\002\n\004Co" + + "de\022\024\n\020CODE_UNSPECIFIED\020\000\022\016\n\nNO_VEHICLE\020\001" + + "\022#\n\037DEMAND_EXCEEDS_VEHICLE_CAPACITY\020\002\0225\n" + + "1CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DIST" + + "ANCE_LIMIT\020\003\0225\n1CANNOT_BE_PERFORMED_WITH" + + "IN_VEHICLE_DURATION_LIMIT\020\004\022<\n8CANNOT_BE" + + "_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATIO" + + "N_LIMIT\020\005\0223\n/CANNOT_BE_PERFORMED_WITHIN_" + + "VEHICLE_TIME_WINDOWS\020\006\022\027\n\023VEHICLE_NOT_AL" + + "LOWED\020\007B\030\n\026_example_vehicle_index\"\313\004\n\021Ag" + + "gregatedMetrics\022 \n\030performed_shipment_co" + + "unt\030\001 \001(\005\0222\n\017travel_duration\030\002 \001(\0132\031.goo" + + "gle.protobuf.Duration\0220\n\rwait_duration\030\003" + + " \001(\0132\031.google.protobuf.Duration\0221\n\016delay" + + "_duration\030\004 \001(\0132\031.google.protobuf.Durati" + + "on\0221\n\016break_duration\030\005 \001(\0132\031.google.prot" + + "obuf.Duration\0221\n\016visit_duration\030\006 \001(\0132\031." + + "google.protobuf.Duration\0221\n\016total_durati" + + "on\030\007 \001(\0132\031.google.protobuf.Duration\022\036\n\026t" + + "ravel_distance_meters\030\010 \001(\001\022T\n\tmax_loads" + + "\030\t \003(\0132A.google.maps.routeoptimization.v" + + "1.AggregatedMetrics.MaxLoadsEntry\032l\n\rMax" + + "LoadsEntry\022\013\n\003key\030\001 \001(\t\022J\n\005value\030\002 \001(\0132;" + + ".google.maps.routeoptimization.v1.Shipme" + + "ntRoute.VehicleLoad:\0028\001\"\263\006\n\032InjectedSolu" + + "tionConstraint\022?\n\006routes\030\001 \003(\0132/.google." + + "maps.routeoptimization.v1.ShipmentRoute\022" + + "L\n\021skipped_shipments\030\002 \003(\01321.google.maps" + + ".routeoptimization.v1.SkippedShipment\022q\n" + + "\026constraint_relaxations\030\003 \003(\0132Q.google.m" + + "aps.routeoptimization.v1.InjectedSolutio" + + "nConstraint.ConstraintRelaxation\032\222\004\n\024Con" + + "straintRelaxation\022q\n\013relaxations\030\001 \003(\0132\\" + + ".google.maps.routeoptimization.v1.Inject" + + "edSolutionConstraint.ConstraintRelaxatio" + + "n.Relaxation\022\027\n\017vehicle_indices\030\002 \003(\005\032\355\002" + + "\n\nRelaxation\022q\n\005level\030\001 \001(\0162b.google.map" + + "s.routeoptimization.v1.InjectedSolutionC" + + "onstraint.ConstraintRelaxation.Relaxatio" + + "n.Level\0222\n\016threshold_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\022\035\n\025threshold_visit_c" + + "ount\030\003 \001(\005\"\230\001\n\005Level\022\025\n\021LEVEL_UNSPECIFIE" + + "D\020\000\022%\n!RELAX_VISIT_TIMES_AFTER_THRESHOLD" + + "\020\001\0222\n.RELAX_VISIT_TIMES_AND_SEQUENCE_AFT" + + "ER_THRESHOLD\020\002\022\035\n\031RELAX_ALL_AFTER_THRESH" + + "OLD\020\003\"\205\003\n\034OptimizeToursValidationError\022\014" + + "\n\004code\030\001 \001(\005\022\024\n\014display_name\030\002 \001(\t\022]\n\006fi" + + "elds\030\003 \003(\0132M.google.maps.routeoptimizati" + + "on.v1.OptimizeToursValidationError.Field" + + "Reference\022\025\n\rerror_message\030\004 \001(\t\022\030\n\020offe" + + "nding_values\030\005 \001(\t\032\260\001\n\016FieldReference\022\014\n" + + "\004name\030\001 \001(\t\022\017\n\005index\030\002 \001(\005H\000\022\r\n\003key\030\004 \001(" + + "\tH\000\022`\n\tsub_field\030\003 \001(\0132M.google.maps.rou" + + "teoptimization.v1.OptimizeToursValidatio" + + "nError.FieldReferenceB\016\n\014index_or_key\"\242\001" + + "\n\013InputConfig\022A\n\ngcs_source\030\001 \001(\0132+.goog" + + "le.maps.routeoptimization.v1.GcsSourceH\000" + + "\022F\n\013data_format\030\002 \001(\0162,.google.maps.rout" + + "eoptimization.v1.DataFormatB\003\340A\002B\010\n\006sour" + + "ce\"\262\001\n\014OutputConfig\022K\n\017gcs_destination\030\001" + + " \001(\01320.google.maps.routeoptimization.v1." + + "GcsDestinationH\000\022F\n\013data_format\030\002 \001(\0162,." + + "google.maps.routeoptimization.v1.DataFor" + + "matB\003\340A\002B\r\n\013destination\"\035\n\tGcsSource\022\020\n\003" + + "uri\030\001 \001(\tB\003\340A\002\"\"\n\016GcsDestination\022\020\n\003uri\030" + + "\001 \001(\tB\003\340A\002*C\n\nDataFormat\022\033\n\027DATA_FORMAT_" + + "UNSPECIFIED\020\000\022\010\n\004JSON\020\001\022\016\n\nPROTO_TEXT\020\0022" + + "\371\004\n\021RouteOptimization\022\352\001\n\rOptimizeTours\022" + + "6.google.maps.routeoptimization.v1.Optim" + + "izeToursRequest\0327.google.maps.routeoptim" + + "ization.v1.OptimizeToursResponse\"h\202\323\344\223\002b" + + "\"1/v1/{parent=projects/*/locations/*}:op" + + "timizeTours:\001*Z*\"%/v1/{parent=projects/*" + + "}:optimizeTours:\001*\022\240\002\n\022BatchOptimizeTour" + + "s\022;.google.maps.routeoptimization.v1.Bat" + + "chOptimizeToursRequest\032\035.google.longrunn" + + "ing.Operation\"\255\001\312A8\n\032BatchOptimizeToursR" + + "esponse\022\032BatchOptimizeToursMetadata\202\323\344\223\002" + + "l\"6/v1/{parent=projects/*/locations/*}:b" + + "atchOptimizeTours:\001*Z/\"*/v1/{parent=proj" + + "ects/*}:batchOptimizeTours:\001*\032T\312A routeo" + + "ptimization.googleapis.com\322A.https://www" + + ".googleapis.com/auth/cloud-platformB\215\002\n$" + + "com.google.maps.routeoptimization.v1B\035Ro" + + "uteOptimizationServiceProtoP\001ZXcloud.goo" + + "gle.com/go/maps/routeoptimization/apiv1/" + + "routeoptimizationpb;routeoptimizationpb\252", + "\002 Google.Maps.RouteOptimization.V1\312\002 Goo" + + "gle\\Maps\\RouteOptimization\\V1\352\002#Google::" + + "Maps::RouteOptimization::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.LatLngProto.getDescriptor(), + }); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_descriptor, + new java.lang.String[] { + "Parent", "ModelConfigs", + }); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_descriptor = + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursRequest_AsyncModelConfig_descriptor, + new java.lang.String[] { + "DisplayName", "InputConfig", "OutputConfig", + }); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BatchOptimizeToursMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OptimizeToursRequest_descriptor, + new java.lang.String[] { + "Parent", + "Timeout", + "Model", + "SolvingMode", + "SearchMode", + "InjectedFirstSolutionRoutes", + "InjectedSolutionConstraint", + "RefreshDetailsRoutes", + "InterpretInjectedSolutionsUsingLabels", + "ConsiderRoadTraffic", + "PopulatePolylines", + "PopulateTransitionPolylines", + "AllowLargeDeadlineDespiteInterruptionRisk", + "UseGeodesicDistances", + "GeodesicMetersPerSecond", + "MaxValidationErrors", + "Label", + }); + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_descriptor, + new java.lang.String[] { + "Routes", "RequestLabel", "SkippedShipments", "ValidationErrors", "Metrics", + }); + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_descriptor = + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_descriptor, + new java.lang.String[] { + "AggregatedRouteMetrics", + "SkippedMandatoryShipmentCount", + "UsedVehicleCount", + "EarliestVehicleStartTime", + "LatestVehicleEndTime", + "Costs", + "TotalCost", + }); + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_CostsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_CostsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OptimizeToursResponse_Metrics_CostsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor, + new java.lang.String[] { + "Shipments", + "Vehicles", + "MaxActiveVehicles", + "GlobalStartTime", + "GlobalEndTime", + "GlobalDurationCostPerHour", + "DurationDistanceMatrices", + "DurationDistanceMatrixSrcTags", + "DurationDistanceMatrixDstTags", + "TransitionAttributes", + "ShipmentTypeIncompatibilities", + "ShipmentTypeRequirements", + "PrecedenceRules", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_descriptor, + new java.lang.String[] { + "Rows", "VehicleStartTag", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentModel_DurationDistanceMatrix_Row_descriptor, + new java.lang.String[] { + "Durations", "Meters", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentModel_descriptor + .getNestedTypes() + .get(1); + internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentModel_PrecedenceRule_descriptor, + new java.lang.String[] { + "FirstIndex", "FirstIsDelivery", "SecondIndex", "SecondIsDelivery", "OffsetDuration", + }); + internal_static_google_maps_routeoptimization_v1_Shipment_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_maps_routeoptimization_v1_Shipment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Shipment_descriptor, + new java.lang.String[] { + "DisplayName", + "Pickups", + "Deliveries", + "LoadDemands", + "PenaltyCost", + "AllowedVehicleIndices", + "CostsPerVehicle", + "CostsPerVehicleIndices", + "PickupToDeliveryRelativeDetourLimit", + "PickupToDeliveryAbsoluteDetourLimit", + "PickupToDeliveryTimeLimit", + "ShipmentType", + "Label", + "Ignore", + }); + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor = + internal_static_google_maps_routeoptimization_v1_Shipment_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor, + new java.lang.String[] { + "ArrivalLocation", + "ArrivalWaypoint", + "DepartureLocation", + "DepartureWaypoint", + "Tags", + "TimeWindows", + "Duration", + "Cost", + "LoadDemands", + "VisitTypes", + "Label", + }); + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor = + internal_static_google_maps_routeoptimization_v1_Shipment_descriptor + .getNestedTypes() + .get(1); + internal_static_google_maps_routeoptimization_v1_Shipment_Load_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor, + new java.lang.String[] { + "Amount", + }); + internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_Shipment_descriptor + .getNestedTypes() + .get(2); + internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_descriptor, + new java.lang.String[] { + "Types", "IncompatibilityMode", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_descriptor, + new java.lang.String[] { + "RequiredShipmentTypeAlternatives", "DependentShipmentTypes", "RequirementMode", + }); + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_maps_routeoptimization_v1_Vehicle_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor, + new java.lang.String[] { + "DisplayName", + "TravelMode", + "StartLocation", + "StartWaypoint", + "EndLocation", + "EndWaypoint", + "StartTags", + "EndTags", + "StartTimeWindows", + "EndTimeWindows", + "TravelDurationMultiple", + "UnloadingPolicy", + "LoadLimits", + "CostPerHour", + "CostPerTraveledHour", + "CostPerKilometer", + "FixedCost", + "UsedIfRouteIsEmpty", + "RouteDurationLimit", + "TravelDurationLimit", + "RouteDistanceLimit", + "ExtraVisitDurationForVisitType", + "BreakRule", + "Label", + "Ignore", + }); + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_descriptor = + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor.getNestedTypes().get(0); + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_descriptor, + new java.lang.String[] { + "MaxLoad", + "SoftMaxLoad", + "CostPerUnitAboveSoftMax", + "StartLoadInterval", + "EndLoadInterval", + }); + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_descriptor = + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_descriptor, + new java.lang.String[] { + "Min", "Max", + }); + internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_descriptor = + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor.getNestedTypes().get(1); + internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_descriptor, + new java.lang.String[] { + "MaxDuration", + "SoftMaxDuration", + "CostPerHourAfterSoftMax", + "QuadraticSoftMaxDuration", + "CostPerSquareHourAfterQuadraticSoftMax", + }); + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimitsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor.getNestedTypes().get(2); + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimitsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimitsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_Vehicle_ExtraVisitDurationForVisitTypeEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor.getNestedTypes().get(3); + internal_static_google_maps_routeoptimization_v1_Vehicle_ExtraVisitDurationForVisitTypeEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Vehicle_ExtraVisitDurationForVisitTypeEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_maps_routeoptimization_v1_TimeWindow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "SoftStartTime", + "SoftEndTime", + "CostPerHourBeforeSoftStartTime", + "CostPerHourAfterSoftEndTime", + }); + internal_static_google_maps_routeoptimization_v1_DistanceLimit_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_maps_routeoptimization_v1_DistanceLimit_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_DistanceLimit_descriptor, + new java.lang.String[] { + "MaxMeters", "SoftMaxMeters", "CostPerKilometerAboveSoftMax", + }); + internal_static_google_maps_routeoptimization_v1_TransitionAttributes_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_maps_routeoptimization_v1_TransitionAttributes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_TransitionAttributes_descriptor, + new java.lang.String[] { + "SrcTag", + "ExcludedSrcTag", + "DstTag", + "ExcludedDstTag", + "Cost", + "CostPerKilometer", + "DistanceLimit", + "Delay", + }); + internal_static_google_maps_routeoptimization_v1_Waypoint_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_maps_routeoptimization_v1_Waypoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Waypoint_descriptor, + new java.lang.String[] { + "Location", "PlaceId", "SideOfRoad", "LocationType", + }); + internal_static_google_maps_routeoptimization_v1_Location_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_maps_routeoptimization_v1_Location_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_Location_descriptor, + new java.lang.String[] { + "LatLng", "Heading", + }); + internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_maps_routeoptimization_v1_BreakRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor, + new java.lang.String[] { + "BreakRequests", "FrequencyConstraints", + }); + internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_descriptor = + internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BreakRule_BreakRequest_descriptor, + new java.lang.String[] { + "EarliestStartTime", "LatestStartTime", "MinDuration", + }); + internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_descriptor = + internal_static_google_maps_routeoptimization_v1_BreakRule_descriptor + .getNestedTypes() + .get(1); + internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_BreakRule_FrequencyConstraint_descriptor, + new java.lang.String[] { + "MinBreakDuration", "MaxInterBreakDuration", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor, + new java.lang.String[] { + "VehicleIndex", + "VehicleLabel", + "VehicleStartTime", + "VehicleEndTime", + "Visits", + "Transitions", + "HasTrafficInfeasibilities", + "RoutePolyline", + "Breaks", + "Metrics", + "RouteCosts", + "RouteTotalCost", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_descriptor, + new java.lang.String[] { + "ShipmentIndex", + "IsPickup", + "VisitRequestIndex", + "StartTime", + "LoadDemands", + "Detour", + "ShipmentLabel", + "VisitLabel", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_LoadDemandsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_LoadDemandsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_LoadDemandsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor + .getNestedTypes() + .get(1); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_descriptor, + new java.lang.String[] { + "TravelDuration", + "TravelDistanceMeters", + "TrafficInfoUnavailable", + "DelayDuration", + "BreakDuration", + "WaitDuration", + "TotalDuration", + "StartTime", + "RoutePolyline", + "VehicleLoads", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_VehicleLoadsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_VehicleLoadsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_VehicleLoadsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor + .getNestedTypes() + .get(2); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_descriptor, + new java.lang.String[] { + "Amount", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor + .getNestedTypes() + .get(3); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_descriptor, + new java.lang.String[] { + "Points", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor + .getNestedTypes() + .get(4); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_descriptor, + new java.lang.String[] { + "StartTime", "Duration", + }); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_RouteCostsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor + .getNestedTypes() + .get(5); + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_RouteCostsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_ShipmentRoute_RouteCostsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_SkippedShipment_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_maps_routeoptimization_v1_SkippedShipment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_SkippedShipment_descriptor, + new java.lang.String[] { + "Index", "Label", "Reasons", + }); + internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_descriptor = + internal_static_google_maps_routeoptimization_v1_SkippedShipment_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_descriptor, + new java.lang.String[] { + "Code", "ExampleVehicleIndex", "ExampleExceededCapacityType", + }); + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_descriptor, + new java.lang.String[] { + "PerformedShipmentCount", + "TravelDuration", + "WaitDuration", + "DelayDuration", + "BreakDuration", + "VisitDuration", + "TotalDuration", + "TravelDistanceMeters", + "MaxLoads", + }); + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_MaxLoadsEntry_descriptor = + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_MaxLoadsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_AggregatedMetrics_MaxLoadsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_descriptor, + new java.lang.String[] { + "Routes", "SkippedShipments", "ConstraintRelaxations", + }); + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_descriptor = + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_descriptor, + new java.lang.String[] { + "Relaxations", "VehicleIndices", + }); + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_descriptor = + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_InjectedSolutionConstraint_ConstraintRelaxation_Relaxation_descriptor, + new java.lang.String[] { + "Level", "ThresholdTime", "ThresholdVisitCount", + }); + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_descriptor, + new java.lang.String[] { + "Code", "DisplayName", "Fields", "ErrorMessage", "OffendingValues", + }); + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_descriptor = + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_descriptor + .getNestedTypes() + .get(0); + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OptimizeToursValidationError_FieldReference_descriptor, + new java.lang.String[] { + "Name", "Index", "Key", "SubField", "IndexOrKey", + }); + internal_static_google_maps_routeoptimization_v1_InputConfig_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_maps_routeoptimization_v1_InputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_InputConfig_descriptor, + new java.lang.String[] { + "GcsSource", "DataFormat", "Source", + }); + internal_static_google_maps_routeoptimization_v1_OutputConfig_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_maps_routeoptimization_v1_OutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_OutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "DataFormat", "Destination", + }); + internal_static_google_maps_routeoptimization_v1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_maps_routeoptimization_v1_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_GcsSource_descriptor, + new java.lang.String[] { + "Uri", + }); + internal_static_google_maps_routeoptimization_v1_GcsDestination_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_maps_routeoptimization_v1_GcsDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routeoptimization_v1_GcsDestination_descriptor, + new java.lang.String[] { + "Uri", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.LatLngProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Shipment.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Shipment.java new file mode 100644 index 000000000000..e99d698e3b19 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Shipment.java @@ -0,0 +1,10224 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * The shipment of a single item, from one of its pickups to one of its
+ * deliveries. For the shipment to be considered as performed, a unique vehicle
+ * must visit one of its pickup locations (and decrease its spare capacities
+ * accordingly), then visit one of its delivery locations later on (and
+ * therefore re-increase its spare capacities accordingly).
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Shipment} + */ +public final class Shipment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Shipment) + ShipmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Shipment.newBuilder() to construct. + private Shipment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Shipment() { + displayName_ = ""; + pickups_ = java.util.Collections.emptyList(); + deliveries_ = java.util.Collections.emptyList(); + allowedVehicleIndices_ = emptyIntList(); + costsPerVehicle_ = emptyDoubleList(); + costsPerVehicleIndices_ = emptyIntList(); + shipmentType_ = ""; + label_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Shipment(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 14: + return internalGetLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Shipment.class, + com.google.maps.routeoptimization.v1.Shipment.Builder.class); + } + + public interface VisitRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Shipment.VisitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The geo-location where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_location` must not be specified.
+     * 
+ * + * .google.type.LatLng arrival_location = 1; + * + * @return Whether the arrivalLocation field is set. + */ + boolean hasArrivalLocation(); + /** + * + * + *
+     * The geo-location where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_location` must not be specified.
+     * 
+ * + * .google.type.LatLng arrival_location = 1; + * + * @return The arrivalLocation. + */ + com.google.type.LatLng getArrivalLocation(); + /** + * + * + *
+     * The geo-location where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_location` must not be specified.
+     * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + com.google.type.LatLngOrBuilder getArrivalLocationOrBuilder(); + + /** + * + * + *
+     * The waypoint where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * + * @return Whether the arrivalWaypoint field is set. + */ + boolean hasArrivalWaypoint(); + /** + * + * + *
+     * The waypoint where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * + * @return The arrivalWaypoint. + */ + com.google.maps.routeoptimization.v1.Waypoint getArrivalWaypoint(); + /** + * + * + *
+     * The waypoint where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + com.google.maps.routeoptimization.v1.WaypointOrBuilder getArrivalWaypointOrBuilder(); + + /** + * + * + *
+     * The geo-location where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+     * If the shipment model has duration distance matrices,
+     * `departure_location` must not be specified.
+     * 
+ * + * .google.type.LatLng departure_location = 3; + * + * @return Whether the departureLocation field is set. + */ + boolean hasDepartureLocation(); + /** + * + * + *
+     * The geo-location where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+     * If the shipment model has duration distance matrices,
+     * `departure_location` must not be specified.
+     * 
+ * + * .google.type.LatLng departure_location = 3; + * + * @return The departureLocation. + */ + com.google.type.LatLng getDepartureLocation(); + /** + * + * + *
+     * The geo-location where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+     * If the shipment model has duration distance matrices,
+     * `departure_location` must not be specified.
+     * 
+ * + * .google.type.LatLng departure_location = 3; + */ + com.google.type.LatLngOrBuilder getDepartureLocationOrBuilder(); + + /** + * + * + *
+     * The waypoint where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+     * If the shipment model has duration distance matrices,
+     * `departure_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * + * @return Whether the departureWaypoint field is set. + */ + boolean hasDepartureWaypoint(); + /** + * + * + *
+     * The waypoint where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+     * If the shipment model has duration distance matrices,
+     * `departure_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * + * @return The departureWaypoint. + */ + com.google.maps.routeoptimization.v1.Waypoint getDepartureWaypoint(); + /** + * + * + *
+     * The waypoint where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+     * If the shipment model has duration distance matrices,
+     * `departure_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + com.google.maps.routeoptimization.v1.WaypointOrBuilder getDepartureWaypointOrBuilder(); + + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + java.util.List getTimeWindowsList(); + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + com.google.maps.routeoptimization.v1.TimeWindow getTimeWindows(int index); + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + int getTimeWindowsCount(); + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + java.util.List + getTimeWindowsOrBuilderList(); + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getTimeWindowsOrBuilder(int index); + + /** + * + * + *
+     * Duration of the visit, i.e. time spent by the vehicle between arrival
+     * and departure (to be added to the possible waiting time; see
+     * `time_windows`).
+     * 
+ * + * .google.protobuf.Duration duration = 7; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+     * Duration of the visit, i.e. time spent by the vehicle between arrival
+     * and departure (to be added to the possible waiting time; see
+     * `time_windows`).
+     * 
+ * + * .google.protobuf.Duration duration = 7; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+     * Duration of the visit, i.e. time spent by the vehicle between arrival
+     * and departure (to be added to the possible waiting time; see
+     * `time_windows`).
+     * 
+ * + * .google.protobuf.Duration duration = 7; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + + /** + * + * + *
+     * Cost to service this visit request on a vehicle route. This can be used
+     * to pay different costs for each alternative pickup or delivery of a
+     * shipment. This cost must be in the same unit as `Shipment.penalty_cost`
+     * and must not be negative.
+     * 
+ * + * double cost = 8; + * + * @return The cost. + */ + double getCost(); + + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + int getLoadDemandsCount(); + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + boolean containsLoadDemands(java.lang.String key); + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getLoadDemands(); + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + java.util.Map + getLoadDemandsMap(); + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue); + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(java.lang.String key); + + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @return A list containing the visitTypes. + */ + java.util.List getVisitTypesList(); + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @return The count of visitTypes. + */ + int getVisitTypesCount(); + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @param index The index of the element to return. + * @return The visitTypes at the given index. + */ + java.lang.String getVisitTypes(int index); + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @param index The index of the value to return. + * @return The bytes of the visitTypes at the given index. + */ + com.google.protobuf.ByteString getVisitTypesBytes(int index); + + /** + * + * + *
+     * Specifies a label for this `VisitRequest`. This label is reported in the
+     * response as `visit_label` in the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 11; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+     * Specifies a label for this `VisitRequest`. This label is reported in the
+     * response as `visit_label` in the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 11; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); + } + /** + * + * + *
+   * Request for a visit which can be done by a vehicle: it has a geo-location
+   * (or two, see below), opening and closing times represented by time windows,
+   * and a service duration time (time spent by the vehicle once it has arrived
+   * to pickup or drop off goods).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Shipment.VisitRequest} + */ + public static final class VisitRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Shipment.VisitRequest) + VisitRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use VisitRequest.newBuilder() to construct. + private VisitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VisitRequest() { + tags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + timeWindows_ = java.util.Collections.emptyList(); + visitTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + label_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VisitRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 12: + return internalGetLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.class, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder.class); + } + + private int bitField0_; + public static final int ARRIVAL_LOCATION_FIELD_NUMBER = 1; + private com.google.type.LatLng arrivalLocation_; + /** + * + * + *
+     * The geo-location where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_location` must not be specified.
+     * 
+ * + * .google.type.LatLng arrival_location = 1; + * + * @return Whether the arrivalLocation field is set. + */ + @java.lang.Override + public boolean hasArrivalLocation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The geo-location where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_location` must not be specified.
+     * 
+ * + * .google.type.LatLng arrival_location = 1; + * + * @return The arrivalLocation. + */ + @java.lang.Override + public com.google.type.LatLng getArrivalLocation() { + return arrivalLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : arrivalLocation_; + } + /** + * + * + *
+     * The geo-location where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_location` must not be specified.
+     * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + @java.lang.Override + public com.google.type.LatLngOrBuilder getArrivalLocationOrBuilder() { + return arrivalLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : arrivalLocation_; + } + + public static final int ARRIVAL_WAYPOINT_FIELD_NUMBER = 2; + private com.google.maps.routeoptimization.v1.Waypoint arrivalWaypoint_; + /** + * + * + *
+     * The waypoint where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * + * @return Whether the arrivalWaypoint field is set. + */ + @java.lang.Override + public boolean hasArrivalWaypoint() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The waypoint where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * + * @return The arrivalWaypoint. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint getArrivalWaypoint() { + return arrivalWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : arrivalWaypoint_; + } + /** + * + * + *
+     * The waypoint where the vehicle arrives when performing this
+     * `VisitRequest`. If the shipment model has duration distance matrices,
+     * `arrival_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getArrivalWaypointOrBuilder() { + return arrivalWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : arrivalWaypoint_; + } + + public static final int DEPARTURE_LOCATION_FIELD_NUMBER = 3; + private com.google.type.LatLng departureLocation_; + /** + * + * + *
+     * The geo-location where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+     * If the shipment model has duration distance matrices,
+     * `departure_location` must not be specified.
+     * 
+ * + * .google.type.LatLng departure_location = 3; + * + * @return Whether the departureLocation field is set. + */ + @java.lang.Override + public boolean hasDepartureLocation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The geo-location where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+     * If the shipment model has duration distance matrices,
+     * `departure_location` must not be specified.
+     * 
+ * + * .google.type.LatLng departure_location = 3; + * + * @return The departureLocation. + */ + @java.lang.Override + public com.google.type.LatLng getDepartureLocation() { + return departureLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : departureLocation_; + } + /** + * + * + *
+     * The geo-location where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+     * If the shipment model has duration distance matrices,
+     * `departure_location` must not be specified.
+     * 
+ * + * .google.type.LatLng departure_location = 3; + */ + @java.lang.Override + public com.google.type.LatLngOrBuilder getDepartureLocationOrBuilder() { + return departureLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : departureLocation_; + } + + public static final int DEPARTURE_WAYPOINT_FIELD_NUMBER = 4; + private com.google.maps.routeoptimization.v1.Waypoint departureWaypoint_; + /** + * + * + *
+     * The waypoint where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+     * If the shipment model has duration distance matrices,
+     * `departure_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * + * @return Whether the departureWaypoint field is set. + */ + @java.lang.Override + public boolean hasDepartureWaypoint() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The waypoint where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+     * If the shipment model has duration distance matrices,
+     * `departure_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * + * @return The departureWaypoint. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint getDepartureWaypoint() { + return departureWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : departureWaypoint_; + } + /** + * + * + *
+     * The waypoint where the vehicle departs after completing this
+     * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+     * If the shipment model has duration distance matrices,
+     * `departure_waypoint` must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getDepartureWaypointOrBuilder() { + return departureWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : departureWaypoint_; + } + + public static final int TAGS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Specifies tags attached to the visit request.
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string tags = 5; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int TIME_WINDOWS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List timeWindows_; + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + @java.lang.Override + public java.util.List getTimeWindowsList() { + return timeWindows_; + } + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + @java.lang.Override + public java.util.List + getTimeWindowsOrBuilderList() { + return timeWindows_; + } + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + @java.lang.Override + public int getTimeWindowsCount() { + return timeWindows_.size(); + } + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindow getTimeWindows(int index) { + return timeWindows_.get(index); + } + /** + * + * + *
+     * Time windows which constrain the arrival time at a visit.
+     * Note that a vehicle may depart outside of the arrival time window, i.e.
+     * arrival time + duration do not need to be inside a time window. This can
+     * result in waiting time if the vehicle arrives before
+     * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+     *
+     * The absence of `TimeWindow` means that the vehicle can perform this visit
+     * at any time.
+     *
+     * Time windows must be disjoint, i.e. no time window must overlap with or
+     * be adjacent to another, and they must be in increasing order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+     * be set if there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getTimeWindowsOrBuilder( + int index) { + return timeWindows_.get(index); + } + + public static final int DURATION_FIELD_NUMBER = 7; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+     * Duration of the visit, i.e. time spent by the vehicle between arrival
+     * and departure (to be added to the possible waiting time; see
+     * `time_windows`).
+     * 
+ * + * .google.protobuf.Duration duration = 7; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Duration of the visit, i.e. time spent by the vehicle between arrival
+     * and departure (to be added to the possible waiting time; see
+     * `time_windows`).
+     * 
+ * + * .google.protobuf.Duration duration = 7; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+     * Duration of the visit, i.e. time spent by the vehicle between arrival
+     * and departure (to be added to the possible waiting time; see
+     * `time_windows`).
+     * 
+ * + * .google.protobuf.Duration duration = 7; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + public static final int COST_FIELD_NUMBER = 8; + private double cost_ = 0D; + /** + * + * + *
+     * Cost to service this visit request on a vehicle route. This can be used
+     * to pay different costs for each alternative pickup or delivery of a
+     * shipment. This cost must be in the same unit as `Shipment.penalty_cost`
+     * and must not be negative.
+     * 
+ * + * double cost = 8; + * + * @return The cost. + */ + @java.lang.Override + public double getCost() { + return cost_; + } + + public static final int LOAD_DEMANDS_FIELD_NUMBER = 12; + + private static final class LoadDemandsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_LoadDemandsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + internalGetLoadDemands() { + if (loadDemands_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LoadDemandsDefaultEntryHolder.defaultEntry); + } + return loadDemands_; + } + + public int getLoadDemandsCount() { + return internalGetLoadDemands().getMap().size(); + } + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public boolean containsLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadDemands().getMap().containsKey(key); + } + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadDemands() { + return getLoadDemandsMap(); + } + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public java.util.Map + getLoadDemandsMap() { + return internalGetLoadDemands().getMap(); + } + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load + getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadDemands().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Load demands of this visit request. This is just like
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field, except that it only applies to this
+     * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+     * instead of the whole
+     * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+     * here are added to the demands listed in
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadDemands().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int VISIT_TYPES_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList visitTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @return A list containing the visitTypes. + */ + public com.google.protobuf.ProtocolStringList getVisitTypesList() { + return visitTypes_; + } + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @return The count of visitTypes. + */ + public int getVisitTypesCount() { + return visitTypes_.size(); + } + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @param index The index of the element to return. + * @return The visitTypes at the given index. + */ + public java.lang.String getVisitTypes(int index) { + return visitTypes_.get(index); + } + /** + * + * + *
+     * Specifies the types of the visit. This may be used to allocate additional
+     * time required for a vehicle to complete this visit (see
+     * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+     *
+     * A type can only appear once.
+     * 
+ * + * repeated string visit_types = 10; + * + * @param index The index of the value to return. + * @return The bytes of the visitTypes at the given index. + */ + public com.google.protobuf.ByteString getVisitTypesBytes(int index) { + return visitTypes_.getByteString(index); + } + + public static final int LABEL_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object label_ = ""; + /** + * + * + *
+     * Specifies a label for this `VisitRequest`. This label is reported in the
+     * response as `visit_label` in the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 11; + * + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + * + * + *
+     * Specifies a label for this `VisitRequest`. This label is reported in the
+     * response as `visit_label` in the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 11; + * + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getArrivalLocation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getArrivalWaypoint()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getDepartureLocation()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(4, getDepartureWaypoint()); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, tags_.getRaw(i)); + } + for (int i = 0; i < timeWindows_.size(); i++) { + output.writeMessage(6, timeWindows_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getDuration()); + } + if (java.lang.Double.doubleToRawLongBits(cost_) != 0) { + output.writeDouble(8, cost_); + } + for (int i = 0; i < visitTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, visitTypes_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, label_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLoadDemands(), LoadDemandsDefaultEntryHolder.defaultEntry, 12); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getArrivalLocation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getArrivalWaypoint()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDepartureLocation()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDepartureWaypoint()); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + for (int i = 0; i < timeWindows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, timeWindows_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDuration()); + } + if (java.lang.Double.doubleToRawLongBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, cost_); + } + { + int dataSize = 0; + for (int i = 0; i < visitTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(visitTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getVisitTypesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, label_); + } + for (java.util.Map.Entry + entry : internalGetLoadDemands().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands__ = + LoadDemandsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, loadDemands__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.routeoptimization.v1.Shipment.VisitRequest)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Shipment.VisitRequest other = + (com.google.maps.routeoptimization.v1.Shipment.VisitRequest) obj; + + if (hasArrivalLocation() != other.hasArrivalLocation()) return false; + if (hasArrivalLocation()) { + if (!getArrivalLocation().equals(other.getArrivalLocation())) return false; + } + if (hasArrivalWaypoint() != other.hasArrivalWaypoint()) return false; + if (hasArrivalWaypoint()) { + if (!getArrivalWaypoint().equals(other.getArrivalWaypoint())) return false; + } + if (hasDepartureLocation() != other.hasDepartureLocation()) return false; + if (hasDepartureLocation()) { + if (!getDepartureLocation().equals(other.getDepartureLocation())) return false; + } + if (hasDepartureWaypoint() != other.hasDepartureWaypoint()) return false; + if (hasDepartureWaypoint()) { + if (!getDepartureWaypoint().equals(other.getDepartureWaypoint())) return false; + } + if (!getTagsList().equals(other.getTagsList())) return false; + if (!getTimeWindowsList().equals(other.getTimeWindowsList())) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (java.lang.Double.doubleToLongBits(getCost()) + != java.lang.Double.doubleToLongBits(other.getCost())) return false; + if (!internalGetLoadDemands().equals(other.internalGetLoadDemands())) return false; + if (!getVisitTypesList().equals(other.getVisitTypesList())) return false; + if (!getLabel().equals(other.getLabel())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasArrivalLocation()) { + hash = (37 * hash) + ARRIVAL_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getArrivalLocation().hashCode(); + } + if (hasArrivalWaypoint()) { + hash = (37 * hash) + ARRIVAL_WAYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getArrivalWaypoint().hashCode(); + } + if (hasDepartureLocation()) { + hash = (37 * hash) + DEPARTURE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getDepartureLocation().hashCode(); + } + if (hasDepartureWaypoint()) { + hash = (37 * hash) + DEPARTURE_WAYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getDepartureWaypoint().hashCode(); + } + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + if (getTimeWindowsCount() > 0) { + hash = (37 * hash) + TIME_WINDOWS_FIELD_NUMBER; + hash = (53 * hash) + getTimeWindowsList().hashCode(); + } + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getCost())); + if (!internalGetLoadDemands().getMap().isEmpty()) { + hash = (37 * hash) + LOAD_DEMANDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLoadDemands().hashCode(); + } + if (getVisitTypesCount() > 0) { + hash = (37 * hash) + VISIT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getVisitTypesList().hashCode(); + } + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Request for a visit which can be done by a vehicle: it has a geo-location
+     * (or two, see below), opening and closing times represented by time windows,
+     * and a service duration time (time spent by the vehicle once it has arrived
+     * to pickup or drop off goods).
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Shipment.VisitRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Shipment.VisitRequest) + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 12: + return internalGetLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 12: + return internalGetMutableLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.class, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Shipment.VisitRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getArrivalLocationFieldBuilder(); + getArrivalWaypointFieldBuilder(); + getDepartureLocationFieldBuilder(); + getDepartureWaypointFieldBuilder(); + getTimeWindowsFieldBuilder(); + getDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + arrivalLocation_ = null; + if (arrivalLocationBuilder_ != null) { + arrivalLocationBuilder_.dispose(); + arrivalLocationBuilder_ = null; + } + arrivalWaypoint_ = null; + if (arrivalWaypointBuilder_ != null) { + arrivalWaypointBuilder_.dispose(); + arrivalWaypointBuilder_ = null; + } + departureLocation_ = null; + if (departureLocationBuilder_ != null) { + departureLocationBuilder_.dispose(); + departureLocationBuilder_ = null; + } + departureWaypoint_ = null; + if (departureWaypointBuilder_ != null) { + departureWaypointBuilder_.dispose(); + departureWaypointBuilder_ = null; + } + tags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (timeWindowsBuilder_ == null) { + timeWindows_ = java.util.Collections.emptyList(); + } else { + timeWindows_ = null; + timeWindowsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + cost_ = 0D; + internalGetMutableLoadDemands().clear(); + visitTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + label_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_VisitRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest build() { + com.google.maps.routeoptimization.v1.Shipment.VisitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest buildPartial() { + com.google.maps.routeoptimization.v1.Shipment.VisitRequest result = + new com.google.maps.routeoptimization.v1.Shipment.VisitRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest result) { + if (timeWindowsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + timeWindows_ = java.util.Collections.unmodifiableList(timeWindows_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.timeWindows_ = timeWindows_; + } else { + result.timeWindows_ = timeWindowsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.arrivalLocation_ = + arrivalLocationBuilder_ == null ? arrivalLocation_ : arrivalLocationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.arrivalWaypoint_ = + arrivalWaypointBuilder_ == null ? arrivalWaypoint_ : arrivalWaypointBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.departureLocation_ = + departureLocationBuilder_ == null + ? departureLocation_ + : departureLocationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.departureWaypoint_ = + departureWaypointBuilder_ == null + ? departureWaypoint_ + : departureWaypointBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + tags_.makeImmutable(); + result.tags_ = tags_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.cost_ = cost_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.loadDemands_ = + internalGetLoadDemands().build(LoadDemandsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + visitTypes_.makeImmutable(); + result.visitTypes_ = visitTypes_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.label_ = label_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.maps.routeoptimization.v1.Shipment.VisitRequest) { + return mergeFrom((com.google.maps.routeoptimization.v1.Shipment.VisitRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Shipment.VisitRequest other) { + if (other + == com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance()) + return this; + if (other.hasArrivalLocation()) { + mergeArrivalLocation(other.getArrivalLocation()); + } + if (other.hasArrivalWaypoint()) { + mergeArrivalWaypoint(other.getArrivalWaypoint()); + } + if (other.hasDepartureLocation()) { + mergeDepartureLocation(other.getDepartureLocation()); + } + if (other.hasDepartureWaypoint()) { + mergeDepartureWaypoint(other.getDepartureWaypoint()); + } + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ |= 0x00000010; + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (timeWindowsBuilder_ == null) { + if (!other.timeWindows_.isEmpty()) { + if (timeWindows_.isEmpty()) { + timeWindows_ = other.timeWindows_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTimeWindowsIsMutable(); + timeWindows_.addAll(other.timeWindows_); + } + onChanged(); + } + } else { + if (!other.timeWindows_.isEmpty()) { + if (timeWindowsBuilder_.isEmpty()) { + timeWindowsBuilder_.dispose(); + timeWindowsBuilder_ = null; + timeWindows_ = other.timeWindows_; + bitField0_ = (bitField0_ & ~0x00000020); + timeWindowsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTimeWindowsFieldBuilder() + : null; + } else { + timeWindowsBuilder_.addAllMessages(other.timeWindows_); + } + } + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.getCost() != 0D) { + setCost(other.getCost()); + } + internalGetMutableLoadDemands().mergeFrom(other.internalGetLoadDemands()); + bitField0_ |= 0x00000100; + if (!other.visitTypes_.isEmpty()) { + if (visitTypes_.isEmpty()) { + visitTypes_ = other.visitTypes_; + bitField0_ |= 0x00000200; + } else { + ensureVisitTypesIsMutable(); + visitTypes_.addAll(other.visitTypes_); + } + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + bitField0_ |= 0x00000400; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getArrivalLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getArrivalWaypointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getDepartureLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + getDepartureWaypointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTagsIsMutable(); + tags_.add(s); + break; + } // case 42 + case 50: + { + com.google.maps.routeoptimization.v1.TimeWindow m = + input.readMessage( + com.google.maps.routeoptimization.v1.TimeWindow.parser(), + extensionRegistry); + if (timeWindowsBuilder_ == null) { + ensureTimeWindowsIsMutable(); + timeWindows_.add(m); + } else { + timeWindowsBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 65: + { + cost_ = input.readDouble(); + bitField0_ |= 0x00000080; + break; + } // case 65 + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureVisitTypesIsMutable(); + visitTypes_.add(s); + break; + } // case 82 + case 90: + { + label_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands__ = + input.readMessage( + LoadDemandsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLoadDemands() + .ensureBuilderMap() + .put(loadDemands__.getKey(), loadDemands__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.type.LatLng arrivalLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder> + arrivalLocationBuilder_; + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + * + * @return Whether the arrivalLocation field is set. + */ + public boolean hasArrivalLocation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + * + * @return The arrivalLocation. + */ + public com.google.type.LatLng getArrivalLocation() { + if (arrivalLocationBuilder_ == null) { + return arrivalLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : arrivalLocation_; + } else { + return arrivalLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + public Builder setArrivalLocation(com.google.type.LatLng value) { + if (arrivalLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + arrivalLocation_ = value; + } else { + arrivalLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + public Builder setArrivalLocation(com.google.type.LatLng.Builder builderForValue) { + if (arrivalLocationBuilder_ == null) { + arrivalLocation_ = builderForValue.build(); + } else { + arrivalLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + public Builder mergeArrivalLocation(com.google.type.LatLng value) { + if (arrivalLocationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && arrivalLocation_ != null + && arrivalLocation_ != com.google.type.LatLng.getDefaultInstance()) { + getArrivalLocationBuilder().mergeFrom(value); + } else { + arrivalLocation_ = value; + } + } else { + arrivalLocationBuilder_.mergeFrom(value); + } + if (arrivalLocation_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + public Builder clearArrivalLocation() { + bitField0_ = (bitField0_ & ~0x00000001); + arrivalLocation_ = null; + if (arrivalLocationBuilder_ != null) { + arrivalLocationBuilder_.dispose(); + arrivalLocationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + public com.google.type.LatLng.Builder getArrivalLocationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getArrivalLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + public com.google.type.LatLngOrBuilder getArrivalLocationOrBuilder() { + if (arrivalLocationBuilder_ != null) { + return arrivalLocationBuilder_.getMessageOrBuilder(); + } else { + return arrivalLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : arrivalLocation_; + } + } + /** + * + * + *
+       * The geo-location where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_location` must not be specified.
+       * 
+ * + * .google.type.LatLng arrival_location = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder> + getArrivalLocationFieldBuilder() { + if (arrivalLocationBuilder_ == null) { + arrivalLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>( + getArrivalLocation(), getParentForChildren(), isClean()); + arrivalLocation_ = null; + } + return arrivalLocationBuilder_; + } + + private com.google.maps.routeoptimization.v1.Waypoint arrivalWaypoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + arrivalWaypointBuilder_; + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * + * @return Whether the arrivalWaypoint field is set. + */ + public boolean hasArrivalWaypoint() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * + * @return The arrivalWaypoint. + */ + public com.google.maps.routeoptimization.v1.Waypoint getArrivalWaypoint() { + if (arrivalWaypointBuilder_ == null) { + return arrivalWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : arrivalWaypoint_; + } else { + return arrivalWaypointBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + public Builder setArrivalWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (arrivalWaypointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + arrivalWaypoint_ = value; + } else { + arrivalWaypointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + public Builder setArrivalWaypoint( + com.google.maps.routeoptimization.v1.Waypoint.Builder builderForValue) { + if (arrivalWaypointBuilder_ == null) { + arrivalWaypoint_ = builderForValue.build(); + } else { + arrivalWaypointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + public Builder mergeArrivalWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (arrivalWaypointBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && arrivalWaypoint_ != null + && arrivalWaypoint_ + != com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) { + getArrivalWaypointBuilder().mergeFrom(value); + } else { + arrivalWaypoint_ = value; + } + } else { + arrivalWaypointBuilder_.mergeFrom(value); + } + if (arrivalWaypoint_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + public Builder clearArrivalWaypoint() { + bitField0_ = (bitField0_ & ~0x00000002); + arrivalWaypoint_ = null; + if (arrivalWaypointBuilder_ != null) { + arrivalWaypointBuilder_.dispose(); + arrivalWaypointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + public com.google.maps.routeoptimization.v1.Waypoint.Builder getArrivalWaypointBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getArrivalWaypointFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getArrivalWaypointOrBuilder() { + if (arrivalWaypointBuilder_ != null) { + return arrivalWaypointBuilder_.getMessageOrBuilder(); + } else { + return arrivalWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : arrivalWaypoint_; + } + } + /** + * + * + *
+       * The waypoint where the vehicle arrives when performing this
+       * `VisitRequest`. If the shipment model has duration distance matrices,
+       * `arrival_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + getArrivalWaypointFieldBuilder() { + if (arrivalWaypointBuilder_ == null) { + arrivalWaypointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder>( + getArrivalWaypoint(), getParentForChildren(), isClean()); + arrivalWaypoint_ = null; + } + return arrivalWaypointBuilder_; + } + + private com.google.type.LatLng departureLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder> + departureLocationBuilder_; + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + * + * @return Whether the departureLocation field is set. + */ + public boolean hasDepartureLocation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + * + * @return The departureLocation. + */ + public com.google.type.LatLng getDepartureLocation() { + if (departureLocationBuilder_ == null) { + return departureLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : departureLocation_; + } else { + return departureLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + public Builder setDepartureLocation(com.google.type.LatLng value) { + if (departureLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + departureLocation_ = value; + } else { + departureLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + public Builder setDepartureLocation(com.google.type.LatLng.Builder builderForValue) { + if (departureLocationBuilder_ == null) { + departureLocation_ = builderForValue.build(); + } else { + departureLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + public Builder mergeDepartureLocation(com.google.type.LatLng value) { + if (departureLocationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && departureLocation_ != null + && departureLocation_ != com.google.type.LatLng.getDefaultInstance()) { + getDepartureLocationBuilder().mergeFrom(value); + } else { + departureLocation_ = value; + } + } else { + departureLocationBuilder_.mergeFrom(value); + } + if (departureLocation_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + public Builder clearDepartureLocation() { + bitField0_ = (bitField0_ & ~0x00000004); + departureLocation_ = null; + if (departureLocationBuilder_ != null) { + departureLocationBuilder_.dispose(); + departureLocationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + public com.google.type.LatLng.Builder getDepartureLocationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDepartureLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + public com.google.type.LatLngOrBuilder getDepartureLocationOrBuilder() { + if (departureLocationBuilder_ != null) { + return departureLocationBuilder_.getMessageOrBuilder(); + } else { + return departureLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : departureLocation_; + } + } + /** + * + * + *
+       * The geo-location where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
+       * If the shipment model has duration distance matrices,
+       * `departure_location` must not be specified.
+       * 
+ * + * .google.type.LatLng departure_location = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder> + getDepartureLocationFieldBuilder() { + if (departureLocationBuilder_ == null) { + departureLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>( + getDepartureLocation(), getParentForChildren(), isClean()); + departureLocation_ = null; + } + return departureLocationBuilder_; + } + + private com.google.maps.routeoptimization.v1.Waypoint departureWaypoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + departureWaypointBuilder_; + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * + * @return Whether the departureWaypoint field is set. + */ + public boolean hasDepartureWaypoint() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * + * @return The departureWaypoint. + */ + public com.google.maps.routeoptimization.v1.Waypoint getDepartureWaypoint() { + if (departureWaypointBuilder_ == null) { + return departureWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : departureWaypoint_; + } else { + return departureWaypointBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + public Builder setDepartureWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (departureWaypointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + departureWaypoint_ = value; + } else { + departureWaypointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + public Builder setDepartureWaypoint( + com.google.maps.routeoptimization.v1.Waypoint.Builder builderForValue) { + if (departureWaypointBuilder_ == null) { + departureWaypoint_ = builderForValue.build(); + } else { + departureWaypointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + public Builder mergeDepartureWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (departureWaypointBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && departureWaypoint_ != null + && departureWaypoint_ + != com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) { + getDepartureWaypointBuilder().mergeFrom(value); + } else { + departureWaypoint_ = value; + } + } else { + departureWaypointBuilder_.mergeFrom(value); + } + if (departureWaypoint_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + public Builder clearDepartureWaypoint() { + bitField0_ = (bitField0_ & ~0x00000008); + departureWaypoint_ = null; + if (departureWaypointBuilder_ != null) { + departureWaypointBuilder_.dispose(); + departureWaypointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + public com.google.maps.routeoptimization.v1.Waypoint.Builder getDepartureWaypointBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDepartureWaypointFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + public com.google.maps.routeoptimization.v1.WaypointOrBuilder + getDepartureWaypointOrBuilder() { + if (departureWaypointBuilder_ != null) { + return departureWaypointBuilder_.getMessageOrBuilder(); + } else { + return departureWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : departureWaypoint_; + } + } + /** + * + * + *
+       * The waypoint where the vehicle departs after completing this
+       * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
+       * If the shipment model has duration distance matrices,
+       * `departure_waypoint` must not be specified.
+       * 
+ * + * .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + getDepartureWaypointFieldBuilder() { + if (departureWaypointBuilder_ == null) { + departureWaypointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder>( + getDepartureWaypoint(), getParentForChildren(), isClean()); + departureWaypoint_ = null; + } + return departureWaypointBuilder_; + } + + private com.google.protobuf.LazyStringArrayList tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTagsIsMutable() { + if (!tags_.isModifiable()) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + } + bitField0_ |= 0x00000010; + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + tags_.makeImmutable(); + return tags_; + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies tags attached to the visit request.
+       * Empty or duplicate strings are not allowed.
+       * 
+ * + * repeated string tags = 5; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.util.List timeWindows_ = + java.util.Collections.emptyList(); + + private void ensureTimeWindowsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + timeWindows_ = + new java.util.ArrayList( + timeWindows_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder> + timeWindowsBuilder_; + + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public java.util.List getTimeWindowsList() { + if (timeWindowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(timeWindows_); + } else { + return timeWindowsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public int getTimeWindowsCount() { + if (timeWindowsBuilder_ == null) { + return timeWindows_.size(); + } else { + return timeWindowsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public com.google.maps.routeoptimization.v1.TimeWindow getTimeWindows(int index) { + if (timeWindowsBuilder_ == null) { + return timeWindows_.get(index); + } else { + return timeWindowsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder setTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow value) { + if (timeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeWindowsIsMutable(); + timeWindows_.set(index, value); + onChanged(); + } else { + timeWindowsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder setTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (timeWindowsBuilder_ == null) { + ensureTimeWindowsIsMutable(); + timeWindows_.set(index, builderForValue.build()); + onChanged(); + } else { + timeWindowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder addTimeWindows(com.google.maps.routeoptimization.v1.TimeWindow value) { + if (timeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeWindowsIsMutable(); + timeWindows_.add(value); + onChanged(); + } else { + timeWindowsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder addTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow value) { + if (timeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeWindowsIsMutable(); + timeWindows_.add(index, value); + onChanged(); + } else { + timeWindowsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder addTimeWindows( + com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (timeWindowsBuilder_ == null) { + ensureTimeWindowsIsMutable(); + timeWindows_.add(builderForValue.build()); + onChanged(); + } else { + timeWindowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder addTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (timeWindowsBuilder_ == null) { + ensureTimeWindowsIsMutable(); + timeWindows_.add(index, builderForValue.build()); + onChanged(); + } else { + timeWindowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder addAllTimeWindows( + java.lang.Iterable values) { + if (timeWindowsBuilder_ == null) { + ensureTimeWindowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, timeWindows_); + onChanged(); + } else { + timeWindowsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder clearTimeWindows() { + if (timeWindowsBuilder_ == null) { + timeWindows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + timeWindowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public Builder removeTimeWindows(int index) { + if (timeWindowsBuilder_ == null) { + ensureTimeWindowsIsMutable(); + timeWindows_.remove(index); + onChanged(); + } else { + timeWindowsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder getTimeWindowsBuilder( + int index) { + return getTimeWindowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getTimeWindowsOrBuilder( + int index) { + if (timeWindowsBuilder_ == null) { + return timeWindows_.get(index); + } else { + return timeWindowsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public java.util.List + getTimeWindowsOrBuilderList() { + if (timeWindowsBuilder_ != null) { + return timeWindowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(timeWindows_); + } + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder addTimeWindowsBuilder() { + return getTimeWindowsFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()); + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder addTimeWindowsBuilder( + int index) { + return getTimeWindowsFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()); + } + /** + * + * + *
+       * Time windows which constrain the arrival time at a visit.
+       * Note that a vehicle may depart outside of the arrival time window, i.e.
+       * arrival time + duration do not need to be inside a time window. This can
+       * result in waiting time if the vehicle arrives before
+       * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time].
+       *
+       * The absence of `TimeWindow` means that the vehicle can perform this visit
+       * at any time.
+       *
+       * Time windows must be disjoint, i.e. no time window must overlap with or
+       * be adjacent to another, and they must be in increasing order.
+       *
+       * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
+       * be set if there is a single time window.
+       * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + public java.util.List + getTimeWindowsBuilderList() { + return getTimeWindowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder> + getTimeWindowsFieldBuilder() { + if (timeWindowsBuilder_ == null) { + timeWindowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>( + timeWindows_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + timeWindows_ = null; + } + return timeWindowsBuilder_; + } + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + if (duration_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000040); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + /** + * + * + *
+       * Duration of the visit, i.e. time spent by the vehicle between arrival
+       * and departure (to be added to the possible waiting time; see
+       * `time_windows`).
+       * 
+ * + * .google.protobuf.Duration duration = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + private double cost_; + /** + * + * + *
+       * Cost to service this visit request on a vehicle route. This can be used
+       * to pay different costs for each alternative pickup or delivery of a
+       * shipment. This cost must be in the same unit as `Shipment.penalty_cost`
+       * and must not be negative.
+       * 
+ * + * double cost = 8; + * + * @return The cost. + */ + @java.lang.Override + public double getCost() { + return cost_; + } + /** + * + * + *
+       * Cost to service this visit request on a vehicle route. This can be used
+       * to pay different costs for each alternative pickup or delivery of a
+       * shipment. This cost must be in the same unit as `Shipment.penalty_cost`
+       * and must not be negative.
+       * 
+ * + * double cost = 8; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(double value) { + + cost_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * Cost to service this visit request on a vehicle route. This can be used
+       * to pay different costs for each alternative pickup or delivery of a
+       * shipment. This cost must be in the same unit as `Shipment.penalty_cost`
+       * and must not be negative.
+       * 
+ * + * double cost = 8; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + bitField0_ = (bitField0_ & ~0x00000080); + cost_ = 0D; + onChanged(); + return this; + } + + private static final class LoadDemandsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load> { + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load build( + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder val) { + if (val instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + return (com.google.maps.routeoptimization.v1.Shipment.Load) val; + } + return ((com.google.maps.routeoptimization.v1.Shipment.Load.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + defaultEntry() { + return LoadDemandsDefaultEntryHolder.defaultEntry; + } + }; + + private static final LoadDemandsConverter loadDemandsConverter = new LoadDemandsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + loadDemands_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + internalGetLoadDemands() { + if (loadDemands_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter); + } + return loadDemands_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + internalGetMutableLoadDemands() { + if (loadDemands_ == null) { + loadDemands_ = new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter); + } + bitField0_ |= 0x00000100; + onChanged(); + return loadDemands_; + } + + public int getLoadDemandsCount() { + return internalGetLoadDemands().ensureBuilderMap().size(); + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public boolean containsLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadDemands().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadDemands() { + return getLoadDemandsMap(); + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public java.util.Map + getLoadDemandsMap() { + return internalGetLoadDemands().getImmutableMap(); + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load + getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableLoadDemands().ensureBuilderMap(); + return map.containsKey(key) ? loadDemandsConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableLoadDemands().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return loadDemandsConverter.build(map.get(key)); + } + + public Builder clearLoadDemands() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableLoadDemands().clear(); + return this; + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + public Builder removeLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLoadDemands().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableLoadDemands() { + bitField0_ |= 0x00000100; + return internalGetMutableLoadDemands().ensureMessageMap(); + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + public Builder putLoadDemands( + java.lang.String key, com.google.maps.routeoptimization.v1.Shipment.Load value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLoadDemands().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + public Builder putAllLoadDemands( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableLoadDemands().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+       * Load demands of this visit request. This is just like
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * field, except that it only applies to this
+       * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest]
+       * instead of the whole
+       * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed
+       * here are added to the demands listed in
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 12; + * + */ + public com.google.maps.routeoptimization.v1.Shipment.Load.Builder + putLoadDemandsBuilderIfAbsent(java.lang.String key) { + java.util.Map + builderMap = internalGetMutableLoadDemands().ensureBuilderMap(); + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + entry = ((com.google.maps.routeoptimization.v1.Shipment.Load) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.maps.routeoptimization.v1.Shipment.Load.Builder) entry; + } + + private com.google.protobuf.LazyStringArrayList visitTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureVisitTypesIsMutable() { + if (!visitTypes_.isModifiable()) { + visitTypes_ = new com.google.protobuf.LazyStringArrayList(visitTypes_); + } + bitField0_ |= 0x00000200; + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @return A list containing the visitTypes. + */ + public com.google.protobuf.ProtocolStringList getVisitTypesList() { + visitTypes_.makeImmutable(); + return visitTypes_; + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @return The count of visitTypes. + */ + public int getVisitTypesCount() { + return visitTypes_.size(); + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @param index The index of the element to return. + * @return The visitTypes at the given index. + */ + public java.lang.String getVisitTypes(int index) { + return visitTypes_.get(index); + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @param index The index of the value to return. + * @return The bytes of the visitTypes at the given index. + */ + public com.google.protobuf.ByteString getVisitTypesBytes(int index) { + return visitTypes_.getByteString(index); + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @param index The index to set the value at. + * @param value The visitTypes to set. + * @return This builder for chaining. + */ + public Builder setVisitTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisitTypesIsMutable(); + visitTypes_.set(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @param value The visitTypes to add. + * @return This builder for chaining. + */ + public Builder addVisitTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisitTypesIsMutable(); + visitTypes_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @param values The visitTypes to add. + * @return This builder for chaining. + */ + public Builder addAllVisitTypes(java.lang.Iterable values) { + ensureVisitTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, visitTypes_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @return This builder for chaining. + */ + public Builder clearVisitTypes() { + visitTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the types of the visit. This may be used to allocate additional
+       * time required for a vehicle to complete this visit (see
+       * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]).
+       *
+       * A type can only appear once.
+       * 
+ * + * repeated string visit_types = 10; + * + * @param value The bytes of the visitTypes to add. + * @return This builder for chaining. + */ + public Builder addVisitTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVisitTypesIsMutable(); + visitTypes_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+       * Specifies a label for this `VisitRequest`. This label is reported in the
+       * response as `visit_label` in the corresponding
+       * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+       * 
+ * + * string label = 11; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Specifies a label for this `VisitRequest`. This label is reported in the
+       * response as `visit_label` in the corresponding
+       * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+       * 
+ * + * string label = 11; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Specifies a label for this `VisitRequest`. This label is reported in the
+       * response as `visit_label` in the corresponding
+       * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+       * 
+ * + * string label = 11; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + label_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies a label for this `VisitRequest`. This label is reported in the
+       * response as `visit_label` in the corresponding
+       * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+       * 
+ * + * string label = 11; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + label_ = getDefaultInstance().getLabel(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies a label for this `VisitRequest`. This label is reported in the
+       * response as `visit_label` in the corresponding
+       * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+       * 
+ * + * string label = 11; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + label_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Shipment.VisitRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Shipment.VisitRequest) + private static final com.google.maps.routeoptimization.v1.Shipment.VisitRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Shipment.VisitRequest(); + } + + public static com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VisitRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LoadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Shipment.Load) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The amount by which the load of the vehicle performing the corresponding
+     * visit will vary. Since it is an integer, users are advised to choose an
+     * appropriate unit to avoid loss of precision. Must be ≥ 0.
+     * 
+ * + * int64 amount = 2; + * + * @return The amount. + */ + long getAmount(); + } + /** + * + * + *
+   * When performing a visit, a predefined amount may be added to the vehicle
+   * load if it's a pickup, or subtracted if it's a delivery. This message
+   * defines such amount. See
+   * [load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Shipment.Load} + */ + public static final class Load extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Shipment.Load) + LoadOrBuilder { + private static final long serialVersionUID = 0L; + // Use Load.newBuilder() to construct. + private Load(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Load() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Load(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_Load_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Shipment.Load.class, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder.class); + } + + public static final int AMOUNT_FIELD_NUMBER = 2; + private long amount_ = 0L; + /** + * + * + *
+     * The amount by which the load of the vehicle performing the corresponding
+     * visit will vary. Since it is an integer, users are advised to choose an
+     * appropriate unit to avoid loss of precision. Must be ≥ 0.
+     * 
+ * + * int64 amount = 2; + * + * @return The amount. + */ + @java.lang.Override + public long getAmount() { + return amount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (amount_ != 0L) { + output.writeInt64(2, amount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (amount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, amount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.routeoptimization.v1.Shipment.Load)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Shipment.Load other = + (com.google.maps.routeoptimization.v1.Shipment.Load) obj; + + if (getAmount() != other.getAmount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.maps.routeoptimization.v1.Shipment.Load prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * When performing a visit, a predefined amount may be added to the vehicle
+     * load if it's a pickup, or subtracted if it's a delivery. This message
+     * defines such amount. See
+     * [load_demands][google.maps.routeoptimization.v1.Shipment.load_demands].
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Shipment.Load} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Shipment.Load) + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_Load_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Shipment.Load.class, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_Load_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load build() { + com.google.maps.routeoptimization.v1.Shipment.Load result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load buildPartial() { + com.google.maps.routeoptimization.v1.Shipment.Load result = + new com.google.maps.routeoptimization.v1.Shipment.Load(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.Shipment.Load result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amount_ = amount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + return mergeFrom((com.google.maps.routeoptimization.v1.Shipment.Load) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Shipment.Load other) { + if (other == com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance()) + return this; + if (other.getAmount() != 0L) { + setAmount(other.getAmount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: + { + amount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long amount_; + /** + * + * + *
+       * The amount by which the load of the vehicle performing the corresponding
+       * visit will vary. Since it is an integer, users are advised to choose an
+       * appropriate unit to avoid loss of precision. Must be ≥ 0.
+       * 
+ * + * int64 amount = 2; + * + * @return The amount. + */ + @java.lang.Override + public long getAmount() { + return amount_; + } + /** + * + * + *
+       * The amount by which the load of the vehicle performing the corresponding
+       * visit will vary. Since it is an integer, users are advised to choose an
+       * appropriate unit to avoid loss of precision. Must be ≥ 0.
+       * 
+ * + * int64 amount = 2; + * + * @param value The amount to set. + * @return This builder for chaining. + */ + public Builder setAmount(long value) { + + amount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount by which the load of the vehicle performing the corresponding
+       * visit will vary. Since it is an integer, users are advised to choose an
+       * appropriate unit to avoid loss of precision. Must be ≥ 0.
+       * 
+ * + * int64 amount = 2; + * + * @return This builder for chaining. + */ + public Builder clearAmount() { + bitField0_ = (bitField0_ & ~0x00000001); + amount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Shipment.Load) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Shipment.Load) + private static final com.google.maps.routeoptimization.v1.Shipment.Load DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Shipment.Load(); + } + + public static com.google.maps.routeoptimization.v1.Shipment.Load getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Load parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int DISPLAY_NAME_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The user-defined display name of the shipment.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 16; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The user-defined display name of the shipment.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 16; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PICKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List pickups_; + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + @java.lang.Override + public java.util.List + getPickupsList() { + return pickups_; + } + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + getPickupsOrBuilderList() { + return pickups_; + } + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + @java.lang.Override + public int getPickupsCount() { + return pickups_.size(); + } + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getPickups(int index) { + return pickups_.get(index); + } + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getPickupsOrBuilder( + int index) { + return pickups_.get(index); + } + + public static final int DELIVERIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List deliveries_; + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + @java.lang.Override + public java.util.List + getDeliveriesList() { + return deliveries_; + } + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + getDeliveriesOrBuilderList() { + return deliveries_; + } + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + @java.lang.Override + public int getDeliveriesCount() { + return deliveries_.size(); + } + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDeliveries(int index) { + return deliveries_.get(index); + } + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getDeliveriesOrBuilder( + int index) { + return deliveries_.get(index); + } + + public static final int LOAD_DEMANDS_FIELD_NUMBER = 14; + + private static final class LoadDemandsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_LoadDemandsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + internalGetLoadDemands() { + if (loadDemands_ == null) { + return com.google.protobuf.MapField.emptyMapField(LoadDemandsDefaultEntryHolder.defaultEntry); + } + return loadDemands_; + } + + public int getLoadDemandsCount() { + return internalGetLoadDemands().getMap().size(); + } + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public boolean containsLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadDemands().getMap().containsKey(key); + } + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadDemands() { + return getLoadDemandsMap(); + } + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public java.util.Map + getLoadDemandsMap() { + return internalGetLoadDemands().getMap(); + } + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadDemands().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadDemands().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PENALTY_COST_FIELD_NUMBER = 4; + private double penaltyCost_ = 0D; + /** + * + * + *
+   * If the shipment is not completed, this penalty is added to the overall
+   * cost of the routes. A shipment is considered completed if one of its pickup
+   * and delivery alternatives is visited. The cost may be expressed in the
+   * same unit used for all other cost-related fields in the model and must be
+   * positive.
+   *
+   * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+   * i.e. the shipment must be completed.
+   * 
+ * + * optional double penalty_cost = 4; + * + * @return Whether the penaltyCost field is set. + */ + @java.lang.Override + public boolean hasPenaltyCost() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * If the shipment is not completed, this penalty is added to the overall
+   * cost of the routes. A shipment is considered completed if one of its pickup
+   * and delivery alternatives is visited. The cost may be expressed in the
+   * same unit used for all other cost-related fields in the model and must be
+   * positive.
+   *
+   * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+   * i.e. the shipment must be completed.
+   * 
+ * + * optional double penalty_cost = 4; + * + * @return The penaltyCost. + */ + @java.lang.Override + public double getPenaltyCost() { + return penaltyCost_; + } + + public static final int ALLOWED_VEHICLE_INDICES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList allowedVehicleIndices_ = emptyIntList(); + /** + * + * + *
+   * The set of vehicles that may perform this shipment. If empty, all vehicles
+   * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+   * `vehicles` list.
+   * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return A list containing the allowedVehicleIndices. + */ + @java.lang.Override + public java.util.List getAllowedVehicleIndicesList() { + return allowedVehicleIndices_; + } + /** + * + * + *
+   * The set of vehicles that may perform this shipment. If empty, all vehicles
+   * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+   * `vehicles` list.
+   * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return The count of allowedVehicleIndices. + */ + public int getAllowedVehicleIndicesCount() { + return allowedVehicleIndices_.size(); + } + /** + * + * + *
+   * The set of vehicles that may perform this shipment. If empty, all vehicles
+   * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+   * `vehicles` list.
+   * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @param index The index of the element to return. + * @return The allowedVehicleIndices at the given index. + */ + public int getAllowedVehicleIndices(int index) { + return allowedVehicleIndices_.getInt(index); + } + + private int allowedVehicleIndicesMemoizedSerializedSize = -1; + + public static final int COSTS_PER_VEHICLE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList costsPerVehicle_ = emptyDoubleList(); + /** + * + * + *
+   * Specifies the cost that is incurred when this shipment is delivered by each
+   * vehicle. If specified, it must have EITHER:
+   *
+   *   * the same number of elements as `costs_per_vehicle_indices`.
+   *     `costs_per_vehicle[i]` corresponds to vehicle
+   *     `costs_per_vehicle_indices[i]` of the model.
+   *   * the same number of elements as there are vehicles in the model. The
+   *     i-th element corresponds to vehicle #i of the model.
+   *
+   * These costs must be in the same unit as `penalty_cost` and must not be
+   * negative. Leave this field empty, if there are no such costs.
+   * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return A list containing the costsPerVehicle. + */ + @java.lang.Override + public java.util.List getCostsPerVehicleList() { + return costsPerVehicle_; + } + /** + * + * + *
+   * Specifies the cost that is incurred when this shipment is delivered by each
+   * vehicle. If specified, it must have EITHER:
+   *
+   *   * the same number of elements as `costs_per_vehicle_indices`.
+   *     `costs_per_vehicle[i]` corresponds to vehicle
+   *     `costs_per_vehicle_indices[i]` of the model.
+   *   * the same number of elements as there are vehicles in the model. The
+   *     i-th element corresponds to vehicle #i of the model.
+   *
+   * These costs must be in the same unit as `penalty_cost` and must not be
+   * negative. Leave this field empty, if there are no such costs.
+   * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return The count of costsPerVehicle. + */ + public int getCostsPerVehicleCount() { + return costsPerVehicle_.size(); + } + /** + * + * + *
+   * Specifies the cost that is incurred when this shipment is delivered by each
+   * vehicle. If specified, it must have EITHER:
+   *
+   *   * the same number of elements as `costs_per_vehicle_indices`.
+   *     `costs_per_vehicle[i]` corresponds to vehicle
+   *     `costs_per_vehicle_indices[i]` of the model.
+   *   * the same number of elements as there are vehicles in the model. The
+   *     i-th element corresponds to vehicle #i of the model.
+   *
+   * These costs must be in the same unit as `penalty_cost` and must not be
+   * negative. Leave this field empty, if there are no such costs.
+   * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @param index The index of the element to return. + * @return The costsPerVehicle at the given index. + */ + public double getCostsPerVehicle(int index) { + return costsPerVehicle_.getDouble(index); + } + + private int costsPerVehicleMemoizedSerializedSize = -1; + + public static final int COSTS_PER_VEHICLE_INDICES_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList costsPerVehicleIndices_ = emptyIntList(); + /** + * + * + *
+   * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+   * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+   * index may not be specified more than once. If a vehicle is excluded from
+   * `costs_per_vehicle_indices`, its cost is zero.
+   * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return A list containing the costsPerVehicleIndices. + */ + @java.lang.Override + public java.util.List getCostsPerVehicleIndicesList() { + return costsPerVehicleIndices_; + } + /** + * + * + *
+   * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+   * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+   * index may not be specified more than once. If a vehicle is excluded from
+   * `costs_per_vehicle_indices`, its cost is zero.
+   * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return The count of costsPerVehicleIndices. + */ + public int getCostsPerVehicleIndicesCount() { + return costsPerVehicleIndices_.size(); + } + /** + * + * + *
+   * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+   * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+   * index may not be specified more than once. If a vehicle is excluded from
+   * `costs_per_vehicle_indices`, its cost is zero.
+   * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @param index The index of the element to return. + * @return The costsPerVehicleIndices at the given index. + */ + public int getCostsPerVehicleIndices(int index) { + return costsPerVehicleIndices_.getInt(index); + } + + private int costsPerVehicleIndicesMemoizedSerializedSize = -1; + + public static final int PICKUP_TO_DELIVERY_RELATIVE_DETOUR_LIMIT_FIELD_NUMBER = 8; + private double pickupToDeliveryRelativeDetourLimit_ = 0D; + /** + * + * + *
+   * Specifies the maximum relative detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_relative_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return Whether the pickupToDeliveryRelativeDetourLimit field is set. + */ + @java.lang.Override + public boolean hasPickupToDeliveryRelativeDetourLimit() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Specifies the maximum relative detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_relative_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return The pickupToDeliveryRelativeDetourLimit. + */ + @java.lang.Override + public double getPickupToDeliveryRelativeDetourLimit() { + return pickupToDeliveryRelativeDetourLimit_; + } + + public static final int PICKUP_TO_DELIVERY_ABSOLUTE_DETOUR_LIMIT_FIELD_NUMBER = 9; + private com.google.protobuf.Duration pickupToDeliveryAbsoluteDetourLimit_; + /** + * + * + *
+   * Specifies the maximum absolute detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * t + pickup_to_delivery_absolute_detour_limit
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * + * @return Whether the pickupToDeliveryAbsoluteDetourLimit field is set. + */ + @java.lang.Override + public boolean hasPickupToDeliveryAbsoluteDetourLimit() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Specifies the maximum absolute detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * t + pickup_to_delivery_absolute_detour_limit
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * + * @return The pickupToDeliveryAbsoluteDetourLimit. + */ + @java.lang.Override + public com.google.protobuf.Duration getPickupToDeliveryAbsoluteDetourLimit() { + return pickupToDeliveryAbsoluteDetourLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryAbsoluteDetourLimit_; + } + /** + * + * + *
+   * Specifies the maximum absolute detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * t + pickup_to_delivery_absolute_detour_limit
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder() { + return pickupToDeliveryAbsoluteDetourLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryAbsoluteDetourLimit_; + } + + public static final int PICKUP_TO_DELIVERY_TIME_LIMIT_FIELD_NUMBER = 10; + private com.google.protobuf.Duration pickupToDeliveryTimeLimit_; + /** + * + * + *
+   * Specifies the maximum duration from start of pickup to start of delivery of
+   * a shipment. If specified, it must be nonnegative, and the shipment must
+   * contain at least a pickup and a delivery. This does not depend on which
+   * alternatives are selected for pickup and delivery, nor on vehicle speed.
+   * This can be specified alongside maximum detour constraints: the solution
+   * will respect both specifications.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * + * @return Whether the pickupToDeliveryTimeLimit field is set. + */ + @java.lang.Override + public boolean hasPickupToDeliveryTimeLimit() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Specifies the maximum duration from start of pickup to start of delivery of
+   * a shipment. If specified, it must be nonnegative, and the shipment must
+   * contain at least a pickup and a delivery. This does not depend on which
+   * alternatives are selected for pickup and delivery, nor on vehicle speed.
+   * This can be specified alongside maximum detour constraints: the solution
+   * will respect both specifications.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * + * @return The pickupToDeliveryTimeLimit. + */ + @java.lang.Override + public com.google.protobuf.Duration getPickupToDeliveryTimeLimit() { + return pickupToDeliveryTimeLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryTimeLimit_; + } + /** + * + * + *
+   * Specifies the maximum duration from start of pickup to start of delivery of
+   * a shipment. If specified, it must be nonnegative, and the shipment must
+   * contain at least a pickup and a delivery. This does not depend on which
+   * alternatives are selected for pickup and delivery, nor on vehicle speed.
+   * This can be specified alongside maximum detour constraints: the solution
+   * will respect both specifications.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder() { + return pickupToDeliveryTimeLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryTimeLimit_; + } + + public static final int SHIPMENT_TYPE_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object shipmentType_ = ""; + /** + * + * + *
+   * Non-empty string specifying a "type" for this shipment.
+   * This feature can be used to define incompatibilities or requirements
+   * between `shipment_types` (see `shipment_type_incompatibilities` and
+   * `shipment_type_requirements` in `ShipmentModel`).
+   *
+   * Differs from `visit_types` which is specified for a single visit: All
+   * pickup/deliveries belonging to the same shipment share the same
+   * `shipment_type`.
+   * 
+ * + * string shipment_type = 11; + * + * @return The shipmentType. + */ + @java.lang.Override + public java.lang.String getShipmentType() { + java.lang.Object ref = shipmentType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shipmentType_ = s; + return s; + } + } + /** + * + * + *
+   * Non-empty string specifying a "type" for this shipment.
+   * This feature can be used to define incompatibilities or requirements
+   * between `shipment_types` (see `shipment_type_incompatibilities` and
+   * `shipment_type_requirements` in `ShipmentModel`).
+   *
+   * Differs from `visit_types` which is specified for a single visit: All
+   * pickup/deliveries belonging to the same shipment share the same
+   * `shipment_type`.
+   * 
+ * + * string shipment_type = 11; + * + * @return The bytes for shipmentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getShipmentTypeBytes() { + java.lang.Object ref = shipmentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shipmentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object label_ = ""; + /** + * + * + *
+   * Specifies a label for this shipment. This label is reported in the response
+   * in the `shipment_label` of the corresponding
+   * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+   * 
+ * + * string label = 12; + * + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies a label for this shipment. This label is reported in the response
+   * in the `shipment_label` of the corresponding
+   * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+   * 
+ * + * string label = 12; + * + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IGNORE_FIELD_NUMBER = 13; + private boolean ignore_ = false; + /** + * + * + *
+   * If true, skip this shipment, but don't apply a `penalty_cost`.
+   *
+   * Ignoring a shipment results in a validation error when there are any
+   * `shipment_type_requirements` in the model.
+   *
+   * Ignoring a shipment that is performed in `injected_first_solution_routes`
+   * or `injected_solution_constraint` is permitted; the solver removes the
+   * related pickup/delivery visits from the performing route.
+   * `precedence_rules` that reference ignored shipments will also be ignored.
+   * 
+ * + * bool ignore = 13; + * + * @return The ignore. + */ + @java.lang.Override + public boolean getIgnore() { + return ignore_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < pickups_.size(); i++) { + output.writeMessage(1, pickups_.get(i)); + } + for (int i = 0; i < deliveries_.size(); i++) { + output.writeMessage(2, deliveries_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(4, penaltyCost_); + } + if (getAllowedVehicleIndicesList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(allowedVehicleIndicesMemoizedSerializedSize); + } + for (int i = 0; i < allowedVehicleIndices_.size(); i++) { + output.writeInt32NoTag(allowedVehicleIndices_.getInt(i)); + } + if (getCostsPerVehicleList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(costsPerVehicleMemoizedSerializedSize); + } + for (int i = 0; i < costsPerVehicle_.size(); i++) { + output.writeDoubleNoTag(costsPerVehicle_.getDouble(i)); + } + if (getCostsPerVehicleIndicesList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(costsPerVehicleIndicesMemoizedSerializedSize); + } + for (int i = 0; i < costsPerVehicleIndices_.size(); i++) { + output.writeInt32NoTag(costsPerVehicleIndices_.getInt(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(8, pickupToDeliveryRelativeDetourLimit_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getPickupToDeliveryAbsoluteDetourLimit()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getPickupToDeliveryTimeLimit()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shipmentType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, shipmentType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, label_); + } + if (ignore_ != false) { + output.writeBool(13, ignore_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLoadDemands(), LoadDemandsDefaultEntryHolder.defaultEntry, 14); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < pickups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, pickups_.get(i)); + } + for (int i = 0; i < deliveries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, deliveries_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, penaltyCost_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedVehicleIndices_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( + allowedVehicleIndices_.getInt(i)); + } + size += dataSize; + if (!getAllowedVehicleIndicesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + allowedVehicleIndicesMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getCostsPerVehicleList().size(); + size += dataSize; + if (!getCostsPerVehicleList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + costsPerVehicleMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < costsPerVehicleIndices_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( + costsPerVehicleIndices_.getInt(i)); + } + size += dataSize; + if (!getCostsPerVehicleIndicesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + costsPerVehicleIndicesMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 8, pickupToDeliveryRelativeDetourLimit_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, getPickupToDeliveryAbsoluteDetourLimit()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getPickupToDeliveryTimeLimit()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shipmentType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, shipmentType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, label_); + } + if (ignore_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, ignore_); + } + for (java.util.Map.Entry + entry : internalGetLoadDemands().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands__ = + LoadDemandsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, loadDemands__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, displayName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.routeoptimization.v1.Shipment)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Shipment other = + (com.google.maps.routeoptimization.v1.Shipment) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getPickupsList().equals(other.getPickupsList())) return false; + if (!getDeliveriesList().equals(other.getDeliveriesList())) return false; + if (!internalGetLoadDemands().equals(other.internalGetLoadDemands())) return false; + if (hasPenaltyCost() != other.hasPenaltyCost()) return false; + if (hasPenaltyCost()) { + if (java.lang.Double.doubleToLongBits(getPenaltyCost()) + != java.lang.Double.doubleToLongBits(other.getPenaltyCost())) return false; + } + if (!getAllowedVehicleIndicesList().equals(other.getAllowedVehicleIndicesList())) return false; + if (!getCostsPerVehicleList().equals(other.getCostsPerVehicleList())) return false; + if (!getCostsPerVehicleIndicesList().equals(other.getCostsPerVehicleIndicesList())) + return false; + if (hasPickupToDeliveryRelativeDetourLimit() != other.hasPickupToDeliveryRelativeDetourLimit()) + return false; + if (hasPickupToDeliveryRelativeDetourLimit()) { + if (java.lang.Double.doubleToLongBits(getPickupToDeliveryRelativeDetourLimit()) + != java.lang.Double.doubleToLongBits(other.getPickupToDeliveryRelativeDetourLimit())) + return false; + } + if (hasPickupToDeliveryAbsoluteDetourLimit() != other.hasPickupToDeliveryAbsoluteDetourLimit()) + return false; + if (hasPickupToDeliveryAbsoluteDetourLimit()) { + if (!getPickupToDeliveryAbsoluteDetourLimit() + .equals(other.getPickupToDeliveryAbsoluteDetourLimit())) return false; + } + if (hasPickupToDeliveryTimeLimit() != other.hasPickupToDeliveryTimeLimit()) return false; + if (hasPickupToDeliveryTimeLimit()) { + if (!getPickupToDeliveryTimeLimit().equals(other.getPickupToDeliveryTimeLimit())) + return false; + } + if (!getShipmentType().equals(other.getShipmentType())) return false; + if (!getLabel().equals(other.getLabel())) return false; + if (getIgnore() != other.getIgnore()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getPickupsCount() > 0) { + hash = (37 * hash) + PICKUPS_FIELD_NUMBER; + hash = (53 * hash) + getPickupsList().hashCode(); + } + if (getDeliveriesCount() > 0) { + hash = (37 * hash) + DELIVERIES_FIELD_NUMBER; + hash = (53 * hash) + getDeliveriesList().hashCode(); + } + if (!internalGetLoadDemands().getMap().isEmpty()) { + hash = (37 * hash) + LOAD_DEMANDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLoadDemands().hashCode(); + } + if (hasPenaltyCost()) { + hash = (37 * hash) + PENALTY_COST_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPenaltyCost())); + } + if (getAllowedVehicleIndicesCount() > 0) { + hash = (37 * hash) + ALLOWED_VEHICLE_INDICES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedVehicleIndicesList().hashCode(); + } + if (getCostsPerVehicleCount() > 0) { + hash = (37 * hash) + COSTS_PER_VEHICLE_FIELD_NUMBER; + hash = (53 * hash) + getCostsPerVehicleList().hashCode(); + } + if (getCostsPerVehicleIndicesCount() > 0) { + hash = (37 * hash) + COSTS_PER_VEHICLE_INDICES_FIELD_NUMBER; + hash = (53 * hash) + getCostsPerVehicleIndicesList().hashCode(); + } + if (hasPickupToDeliveryRelativeDetourLimit()) { + hash = (37 * hash) + PICKUP_TO_DELIVERY_RELATIVE_DETOUR_LIMIT_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPickupToDeliveryRelativeDetourLimit())); + } + if (hasPickupToDeliveryAbsoluteDetourLimit()) { + hash = (37 * hash) + PICKUP_TO_DELIVERY_ABSOLUTE_DETOUR_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getPickupToDeliveryAbsoluteDetourLimit().hashCode(); + } + if (hasPickupToDeliveryTimeLimit()) { + hash = (37 * hash) + PICKUP_TO_DELIVERY_TIME_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getPickupToDeliveryTimeLimit().hashCode(); + } + hash = (37 * hash) + SHIPMENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getShipmentType().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + IGNORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnore()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Shipment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.maps.routeoptimization.v1.Shipment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The shipment of a single item, from one of its pickups to one of its
+   * deliveries. For the shipment to be considered as performed, a unique vehicle
+   * must visit one of its pickup locations (and decrease its spare capacities
+   * accordingly), then visit one of its delivery locations later on (and
+   * therefore re-increase its spare capacities accordingly).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Shipment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Shipment) + com.google.maps.routeoptimization.v1.ShipmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 14: + return internalGetLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 14: + return internalGetMutableLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Shipment.class, + com.google.maps.routeoptimization.v1.Shipment.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Shipment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPickupsFieldBuilder(); + getDeliveriesFieldBuilder(); + getPickupToDeliveryAbsoluteDetourLimitFieldBuilder(); + getPickupToDeliveryTimeLimitFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayName_ = ""; + if (pickupsBuilder_ == null) { + pickups_ = java.util.Collections.emptyList(); + } else { + pickups_ = null; + pickupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (deliveriesBuilder_ == null) { + deliveries_ = java.util.Collections.emptyList(); + } else { + deliveries_ = null; + deliveriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableLoadDemands().clear(); + penaltyCost_ = 0D; + allowedVehicleIndices_ = emptyIntList(); + costsPerVehicle_ = emptyDoubleList(); + costsPerVehicleIndices_ = emptyIntList(); + pickupToDeliveryRelativeDetourLimit_ = 0D; + pickupToDeliveryAbsoluteDetourLimit_ = null; + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ != null) { + pickupToDeliveryAbsoluteDetourLimitBuilder_.dispose(); + pickupToDeliveryAbsoluteDetourLimitBuilder_ = null; + } + pickupToDeliveryTimeLimit_ = null; + if (pickupToDeliveryTimeLimitBuilder_ != null) { + pickupToDeliveryTimeLimitBuilder_.dispose(); + pickupToDeliveryTimeLimitBuilder_ = null; + } + shipmentType_ = ""; + label_ = ""; + ignore_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Shipment_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Shipment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment build() { + com.google.maps.routeoptimization.v1.Shipment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment buildPartial() { + com.google.maps.routeoptimization.v1.Shipment result = + new com.google.maps.routeoptimization.v1.Shipment(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.maps.routeoptimization.v1.Shipment result) { + if (pickupsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + pickups_ = java.util.Collections.unmodifiableList(pickups_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.pickups_ = pickups_; + } else { + result.pickups_ = pickupsBuilder_.build(); + } + if (deliveriesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + deliveries_ = java.util.Collections.unmodifiableList(deliveries_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.deliveries_ = deliveries_; + } else { + result.deliveries_ = deliveriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.Shipment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.loadDemands_ = + internalGetLoadDemands().build(LoadDemandsDefaultEntryHolder.defaultEntry); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.penaltyCost_ = penaltyCost_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + allowedVehicleIndices_.makeImmutable(); + result.allowedVehicleIndices_ = allowedVehicleIndices_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + costsPerVehicle_.makeImmutable(); + result.costsPerVehicle_ = costsPerVehicle_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + costsPerVehicleIndices_.makeImmutable(); + result.costsPerVehicleIndices_ = costsPerVehicleIndices_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pickupToDeliveryRelativeDetourLimit_ = pickupToDeliveryRelativeDetourLimit_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pickupToDeliveryAbsoluteDetourLimit_ = + pickupToDeliveryAbsoluteDetourLimitBuilder_ == null + ? pickupToDeliveryAbsoluteDetourLimit_ + : pickupToDeliveryAbsoluteDetourLimitBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.pickupToDeliveryTimeLimit_ = + pickupToDeliveryTimeLimitBuilder_ == null + ? pickupToDeliveryTimeLimit_ + : pickupToDeliveryTimeLimitBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.shipmentType_ = shipmentType_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.label_ = label_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.ignore_ = ignore_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.maps.routeoptimization.v1.Shipment) { + return mergeFrom((com.google.maps.routeoptimization.v1.Shipment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Shipment other) { + if (other == com.google.maps.routeoptimization.v1.Shipment.getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (pickupsBuilder_ == null) { + if (!other.pickups_.isEmpty()) { + if (pickups_.isEmpty()) { + pickups_ = other.pickups_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePickupsIsMutable(); + pickups_.addAll(other.pickups_); + } + onChanged(); + } + } else { + if (!other.pickups_.isEmpty()) { + if (pickupsBuilder_.isEmpty()) { + pickupsBuilder_.dispose(); + pickupsBuilder_ = null; + pickups_ = other.pickups_; + bitField0_ = (bitField0_ & ~0x00000002); + pickupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPickupsFieldBuilder() + : null; + } else { + pickupsBuilder_.addAllMessages(other.pickups_); + } + } + } + if (deliveriesBuilder_ == null) { + if (!other.deliveries_.isEmpty()) { + if (deliveries_.isEmpty()) { + deliveries_ = other.deliveries_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureDeliveriesIsMutable(); + deliveries_.addAll(other.deliveries_); + } + onChanged(); + } + } else { + if (!other.deliveries_.isEmpty()) { + if (deliveriesBuilder_.isEmpty()) { + deliveriesBuilder_.dispose(); + deliveriesBuilder_ = null; + deliveries_ = other.deliveries_; + bitField0_ = (bitField0_ & ~0x00000004); + deliveriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDeliveriesFieldBuilder() + : null; + } else { + deliveriesBuilder_.addAllMessages(other.deliveries_); + } + } + } + internalGetMutableLoadDemands().mergeFrom(other.internalGetLoadDemands()); + bitField0_ |= 0x00000008; + if (other.hasPenaltyCost()) { + setPenaltyCost(other.getPenaltyCost()); + } + if (!other.allowedVehicleIndices_.isEmpty()) { + if (allowedVehicleIndices_.isEmpty()) { + allowedVehicleIndices_ = other.allowedVehicleIndices_; + allowedVehicleIndices_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureAllowedVehicleIndicesIsMutable(); + allowedVehicleIndices_.addAll(other.allowedVehicleIndices_); + } + onChanged(); + } + if (!other.costsPerVehicle_.isEmpty()) { + if (costsPerVehicle_.isEmpty()) { + costsPerVehicle_ = other.costsPerVehicle_; + costsPerVehicle_.makeImmutable(); + bitField0_ |= 0x00000040; + } else { + ensureCostsPerVehicleIsMutable(); + costsPerVehicle_.addAll(other.costsPerVehicle_); + } + onChanged(); + } + if (!other.costsPerVehicleIndices_.isEmpty()) { + if (costsPerVehicleIndices_.isEmpty()) { + costsPerVehicleIndices_ = other.costsPerVehicleIndices_; + costsPerVehicleIndices_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureCostsPerVehicleIndicesIsMutable(); + costsPerVehicleIndices_.addAll(other.costsPerVehicleIndices_); + } + onChanged(); + } + if (other.hasPickupToDeliveryRelativeDetourLimit()) { + setPickupToDeliveryRelativeDetourLimit(other.getPickupToDeliveryRelativeDetourLimit()); + } + if (other.hasPickupToDeliveryAbsoluteDetourLimit()) { + mergePickupToDeliveryAbsoluteDetourLimit(other.getPickupToDeliveryAbsoluteDetourLimit()); + } + if (other.hasPickupToDeliveryTimeLimit()) { + mergePickupToDeliveryTimeLimit(other.getPickupToDeliveryTimeLimit()); + } + if (!other.getShipmentType().isEmpty()) { + shipmentType_ = other.shipmentType_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.getIgnore() != false) { + setIgnore(other.getIgnore()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.maps.routeoptimization.v1.Shipment.VisitRequest m = + input.readMessage( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.parser(), + extensionRegistry); + if (pickupsBuilder_ == null) { + ensurePickupsIsMutable(); + pickups_.add(m); + } else { + pickupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.maps.routeoptimization.v1.Shipment.VisitRequest m = + input.readMessage( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.parser(), + extensionRegistry); + if (deliveriesBuilder_ == null) { + ensureDeliveriesIsMutable(); + deliveries_.add(m); + } else { + deliveriesBuilder_.addMessage(m); + } + break; + } // case 18 + case 33: + { + penaltyCost_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 33 + case 40: + { + int v = input.readInt32(); + ensureAllowedVehicleIndicesIsMutable(); + allowedVehicleIndices_.addInt(v); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAllowedVehicleIndicesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + allowedVehicleIndices_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 42 + case 49: + { + double v = input.readDouble(); + ensureCostsPerVehicleIsMutable(); + costsPerVehicle_.addDouble(v); + break; + } // case 49 + case 50: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureCostsPerVehicleIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + costsPerVehicle_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 50 + case 56: + { + int v = input.readInt32(); + ensureCostsPerVehicleIndicesIsMutable(); + costsPerVehicleIndices_.addInt(v); + break; + } // case 56 + case 58: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureCostsPerVehicleIndicesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + costsPerVehicleIndices_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 58 + case 65: + { + pickupToDeliveryRelativeDetourLimit_ = input.readDouble(); + bitField0_ |= 0x00000100; + break; + } // case 65 + case 74: + { + input.readMessage( + getPickupToDeliveryAbsoluteDetourLimitFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + input.readMessage( + getPickupToDeliveryTimeLimitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + shipmentType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + label_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 98 + case 104: + { + ignore_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 104 + case 114: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands__ = + input.readMessage( + LoadDemandsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLoadDemands() + .ensureBuilderMap() + .put(loadDemands__.getKey(), loadDemands__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 114 + case 130: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The user-defined display name of the shipment.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 16; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user-defined display name of the shipment.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 16; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user-defined display name of the shipment.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 16; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The user-defined display name of the shipment.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 16; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The user-defined display name of the shipment.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 16; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List pickups_ = + java.util.Collections.emptyList(); + + private void ensurePickupsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + pickups_ = + new java.util.ArrayList( + pickups_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.Shipment.VisitRequest, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder, + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + pickupsBuilder_; + + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public java.util.List + getPickupsList() { + if (pickupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pickups_); + } else { + return pickupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public int getPickupsCount() { + if (pickupsBuilder_ == null) { + return pickups_.size(); + } else { + return pickupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getPickups(int index) { + if (pickupsBuilder_ == null) { + return pickups_.get(index); + } else { + return pickupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder setPickups( + int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) { + if (pickupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePickupsIsMutable(); + pickups_.set(index, value); + onChanged(); + } else { + pickupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder setPickups( + int index, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) { + if (pickupsBuilder_ == null) { + ensurePickupsIsMutable(); + pickups_.set(index, builderForValue.build()); + onChanged(); + } else { + pickupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder addPickups(com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) { + if (pickupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePickupsIsMutable(); + pickups_.add(value); + onChanged(); + } else { + pickupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder addPickups( + int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) { + if (pickupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePickupsIsMutable(); + pickups_.add(index, value); + onChanged(); + } else { + pickupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder addPickups( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) { + if (pickupsBuilder_ == null) { + ensurePickupsIsMutable(); + pickups_.add(builderForValue.build()); + onChanged(); + } else { + pickupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder addPickups( + int index, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) { + if (pickupsBuilder_ == null) { + ensurePickupsIsMutable(); + pickups_.add(index, builderForValue.build()); + onChanged(); + } else { + pickupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder addAllPickups( + java.lang.Iterable + values) { + if (pickupsBuilder_ == null) { + ensurePickupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pickups_); + onChanged(); + } else { + pickupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder clearPickups() { + if (pickupsBuilder_ == null) { + pickups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + pickupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public Builder removePickups(int index) { + if (pickupsBuilder_ == null) { + ensurePickupsIsMutable(); + pickups_.remove(index); + onChanged(); + } else { + pickupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder getPickupsBuilder( + int index) { + return getPickupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getPickupsOrBuilder( + int index) { + if (pickupsBuilder_ == null) { + return pickups_.get(index); + } else { + return pickupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + getPickupsOrBuilderList() { + if (pickupsBuilder_ != null) { + return pickupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pickups_); + } + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder addPickupsBuilder() { + return getPickupsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder addPickupsBuilder( + int index) { + return getPickupsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Set of pickup alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the deliveries.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + public java.util.List + getPickupsBuilderList() { + return getPickupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.Shipment.VisitRequest, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder, + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + getPickupsFieldBuilder() { + if (pickupsBuilder_ == null) { + pickupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.Shipment.VisitRequest, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder, + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>( + pickups_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + pickups_ = null; + } + return pickupsBuilder_; + } + + private java.util.List deliveries_ = + java.util.Collections.emptyList(); + + private void ensureDeliveriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + deliveries_ = + new java.util.ArrayList( + deliveries_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.Shipment.VisitRequest, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder, + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + deliveriesBuilder_; + + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public java.util.List + getDeliveriesList() { + if (deliveriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(deliveries_); + } else { + return deliveriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public int getDeliveriesCount() { + if (deliveriesBuilder_ == null) { + return deliveries_.size(); + } else { + return deliveriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDeliveries(int index) { + if (deliveriesBuilder_ == null) { + return deliveries_.get(index); + } else { + return deliveriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder setDeliveries( + int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) { + if (deliveriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeliveriesIsMutable(); + deliveries_.set(index, value); + onChanged(); + } else { + deliveriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder setDeliveries( + int index, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) { + if (deliveriesBuilder_ == null) { + ensureDeliveriesIsMutable(); + deliveries_.set(index, builderForValue.build()); + onChanged(); + } else { + deliveriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder addDeliveries(com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) { + if (deliveriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeliveriesIsMutable(); + deliveries_.add(value); + onChanged(); + } else { + deliveriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder addDeliveries( + int index, com.google.maps.routeoptimization.v1.Shipment.VisitRequest value) { + if (deliveriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeliveriesIsMutable(); + deliveries_.add(index, value); + onChanged(); + } else { + deliveriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder addDeliveries( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) { + if (deliveriesBuilder_ == null) { + ensureDeliveriesIsMutable(); + deliveries_.add(builderForValue.build()); + onChanged(); + } else { + deliveriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder addDeliveries( + int index, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder builderForValue) { + if (deliveriesBuilder_ == null) { + ensureDeliveriesIsMutable(); + deliveries_.add(index, builderForValue.build()); + onChanged(); + } else { + deliveriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder addAllDeliveries( + java.lang.Iterable + values) { + if (deliveriesBuilder_ == null) { + ensureDeliveriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deliveries_); + onChanged(); + } else { + deliveriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder clearDeliveries() { + if (deliveriesBuilder_ == null) { + deliveries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + deliveriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public Builder removeDeliveries(int index) { + if (deliveriesBuilder_ == null) { + ensureDeliveriesIsMutable(); + deliveries_.remove(index); + onChanged(); + } else { + deliveriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder getDeliveriesBuilder( + int index) { + return getDeliveriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder + getDeliveriesOrBuilder(int index) { + if (deliveriesBuilder_ == null) { + return deliveries_.get(index); + } else { + return deliveriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + getDeliveriesOrBuilderList() { + if (deliveriesBuilder_ != null) { + return deliveriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deliveries_); + } + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder + addDeliveriesBuilder() { + return getDeliveriesFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder addDeliveriesBuilder( + int index) { + return getDeliveriesFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Set of delivery alternatives associated to the shipment. If not specified,
+     * the vehicle only needs to visit a location corresponding to the pickups.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + public java.util.List + getDeliveriesBuilderList() { + return getDeliveriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.Shipment.VisitRequest, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder, + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder> + getDeliveriesFieldBuilder() { + if (deliveriesBuilder_ == null) { + deliveriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.Shipment.VisitRequest, + com.google.maps.routeoptimization.v1.Shipment.VisitRequest.Builder, + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder>( + deliveries_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + deliveries_ = null; + } + return deliveriesBuilder_; + } + + private static final class LoadDemandsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load> { + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load build( + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder val) { + if (val instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + return (com.google.maps.routeoptimization.v1.Shipment.Load) val; + } + return ((com.google.maps.routeoptimization.v1.Shipment.Load.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + defaultEntry() { + return LoadDemandsDefaultEntryHolder.defaultEntry; + } + }; + + private static final LoadDemandsConverter loadDemandsConverter = new LoadDemandsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + loadDemands_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + internalGetLoadDemands() { + if (loadDemands_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter); + } + return loadDemands_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + internalGetMutableLoadDemands() { + if (loadDemands_ == null) { + loadDemands_ = new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return loadDemands_; + } + + public int getLoadDemandsCount() { + return internalGetLoadDemands().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public boolean containsLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadDemands().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadDemands() { + return getLoadDemandsMap(); + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public java.util.Map + getLoadDemandsMap() { + return internalGetLoadDemands().getImmutableMap(); + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load + getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableLoadDemands().ensureBuilderMap(); + return map.containsKey(key) ? loadDemandsConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableLoadDemands().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return loadDemandsConverter.build(map.get(key)); + } + + public Builder clearLoadDemands() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableLoadDemands().clear(); + return this; + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + public Builder removeLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLoadDemands().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableLoadDemands() { + bitField0_ |= 0x00000008; + return internalGetMutableLoadDemands().ensureMessageMap(); + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + public Builder putLoadDemands( + java.lang.String key, com.google.maps.routeoptimization.v1.Shipment.Load value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLoadDemands().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + public Builder putAllLoadDemands( + java.util.Map + values) { + for (java.util.Map.Entry + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableLoadDemands().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * Load demands of the shipment (for example weight, volume, number of
+     * pallets etc). The keys in the map should be identifiers describing the type
+     * of the corresponding load, ideally also including the units.
+     * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+     * If a given key does not appear in the map, the corresponding load is
+     * considered as null.
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + public com.google.maps.routeoptimization.v1.Shipment.Load.Builder putLoadDemandsBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableLoadDemands().ensureBuilderMap(); + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + entry = ((com.google.maps.routeoptimization.v1.Shipment.Load) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.maps.routeoptimization.v1.Shipment.Load.Builder) entry; + } + + private double penaltyCost_; + /** + * + * + *
+     * If the shipment is not completed, this penalty is added to the overall
+     * cost of the routes. A shipment is considered completed if one of its pickup
+     * and delivery alternatives is visited. The cost may be expressed in the
+     * same unit used for all other cost-related fields in the model and must be
+     * positive.
+     *
+     * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+     * i.e. the shipment must be completed.
+     * 
+ * + * optional double penalty_cost = 4; + * + * @return Whether the penaltyCost field is set. + */ + @java.lang.Override + public boolean hasPenaltyCost() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * If the shipment is not completed, this penalty is added to the overall
+     * cost of the routes. A shipment is considered completed if one of its pickup
+     * and delivery alternatives is visited. The cost may be expressed in the
+     * same unit used for all other cost-related fields in the model and must be
+     * positive.
+     *
+     * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+     * i.e. the shipment must be completed.
+     * 
+ * + * optional double penalty_cost = 4; + * + * @return The penaltyCost. + */ + @java.lang.Override + public double getPenaltyCost() { + return penaltyCost_; + } + /** + * + * + *
+     * If the shipment is not completed, this penalty is added to the overall
+     * cost of the routes. A shipment is considered completed if one of its pickup
+     * and delivery alternatives is visited. The cost may be expressed in the
+     * same unit used for all other cost-related fields in the model and must be
+     * positive.
+     *
+     * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+     * i.e. the shipment must be completed.
+     * 
+ * + * optional double penalty_cost = 4; + * + * @param value The penaltyCost to set. + * @return This builder for chaining. + */ + public Builder setPenaltyCost(double value) { + + penaltyCost_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * If the shipment is not completed, this penalty is added to the overall
+     * cost of the routes. A shipment is considered completed if one of its pickup
+     * and delivery alternatives is visited. The cost may be expressed in the
+     * same unit used for all other cost-related fields in the model and must be
+     * positive.
+     *
+     * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+     * i.e. the shipment must be completed.
+     * 
+ * + * optional double penalty_cost = 4; + * + * @return This builder for chaining. + */ + public Builder clearPenaltyCost() { + bitField0_ = (bitField0_ & ~0x00000010); + penaltyCost_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList allowedVehicleIndices_ = emptyIntList(); + + private void ensureAllowedVehicleIndicesIsMutable() { + if (!allowedVehicleIndices_.isModifiable()) { + allowedVehicleIndices_ = makeMutableCopy(allowedVehicleIndices_); + } + bitField0_ |= 0x00000020; + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return A list containing the allowedVehicleIndices. + */ + public java.util.List getAllowedVehicleIndicesList() { + allowedVehicleIndices_.makeImmutable(); + return allowedVehicleIndices_; + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return The count of allowedVehicleIndices. + */ + public int getAllowedVehicleIndicesCount() { + return allowedVehicleIndices_.size(); + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @param index The index of the element to return. + * @return The allowedVehicleIndices at the given index. + */ + public int getAllowedVehicleIndices(int index) { + return allowedVehicleIndices_.getInt(index); + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @param index The index to set the value at. + * @param value The allowedVehicleIndices to set. + * @return This builder for chaining. + */ + public Builder setAllowedVehicleIndices(int index, int value) { + + ensureAllowedVehicleIndicesIsMutable(); + allowedVehicleIndices_.setInt(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @param value The allowedVehicleIndices to add. + * @return This builder for chaining. + */ + public Builder addAllowedVehicleIndices(int value) { + + ensureAllowedVehicleIndicesIsMutable(); + allowedVehicleIndices_.addInt(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @param values The allowedVehicleIndices to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedVehicleIndices( + java.lang.Iterable values) { + ensureAllowedVehicleIndicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedVehicleIndices_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The set of vehicles that may perform this shipment. If empty, all vehicles
+     * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+     * `vehicles` list.
+     * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return This builder for chaining. + */ + public Builder clearAllowedVehicleIndices() { + allowedVehicleIndices_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList costsPerVehicle_ = emptyDoubleList(); + + private void ensureCostsPerVehicleIsMutable() { + if (!costsPerVehicle_.isModifiable()) { + costsPerVehicle_ = makeMutableCopy(costsPerVehicle_); + } + bitField0_ |= 0x00000040; + } + + private void ensureCostsPerVehicleIsMutable(int capacity) { + if (!costsPerVehicle_.isModifiable()) { + costsPerVehicle_ = makeMutableCopy(costsPerVehicle_, capacity); + } + bitField0_ |= 0x00000040; + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return A list containing the costsPerVehicle. + */ + public java.util.List getCostsPerVehicleList() { + costsPerVehicle_.makeImmutable(); + return costsPerVehicle_; + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return The count of costsPerVehicle. + */ + public int getCostsPerVehicleCount() { + return costsPerVehicle_.size(); + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @param index The index of the element to return. + * @return The costsPerVehicle at the given index. + */ + public double getCostsPerVehicle(int index) { + return costsPerVehicle_.getDouble(index); + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @param index The index to set the value at. + * @param value The costsPerVehicle to set. + * @return This builder for chaining. + */ + public Builder setCostsPerVehicle(int index, double value) { + + ensureCostsPerVehicleIsMutable(); + costsPerVehicle_.setDouble(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @param value The costsPerVehicle to add. + * @return This builder for chaining. + */ + public Builder addCostsPerVehicle(double value) { + + ensureCostsPerVehicleIsMutable(); + costsPerVehicle_.addDouble(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @param values The costsPerVehicle to add. + * @return This builder for chaining. + */ + public Builder addAllCostsPerVehicle(java.lang.Iterable values) { + ensureCostsPerVehicleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, costsPerVehicle_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the cost that is incurred when this shipment is delivered by each
+     * vehicle. If specified, it must have EITHER:
+     *
+     *   * the same number of elements as `costs_per_vehicle_indices`.
+     *     `costs_per_vehicle[i]` corresponds to vehicle
+     *     `costs_per_vehicle_indices[i]` of the model.
+     *   * the same number of elements as there are vehicles in the model. The
+     *     i-th element corresponds to vehicle #i of the model.
+     *
+     * These costs must be in the same unit as `penalty_cost` and must not be
+     * negative. Leave this field empty, if there are no such costs.
+     * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return This builder for chaining. + */ + public Builder clearCostsPerVehicle() { + costsPerVehicle_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList costsPerVehicleIndices_ = emptyIntList(); + + private void ensureCostsPerVehicleIndicesIsMutable() { + if (!costsPerVehicleIndices_.isModifiable()) { + costsPerVehicleIndices_ = makeMutableCopy(costsPerVehicleIndices_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return A list containing the costsPerVehicleIndices. + */ + public java.util.List getCostsPerVehicleIndicesList() { + costsPerVehicleIndices_.makeImmutable(); + return costsPerVehicleIndices_; + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return The count of costsPerVehicleIndices. + */ + public int getCostsPerVehicleIndicesCount() { + return costsPerVehicleIndices_.size(); + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @param index The index of the element to return. + * @return The costsPerVehicleIndices at the given index. + */ + public int getCostsPerVehicleIndices(int index) { + return costsPerVehicleIndices_.getInt(index); + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @param index The index to set the value at. + * @param value The costsPerVehicleIndices to set. + * @return This builder for chaining. + */ + public Builder setCostsPerVehicleIndices(int index, int value) { + + ensureCostsPerVehicleIndicesIsMutable(); + costsPerVehicleIndices_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @param value The costsPerVehicleIndices to add. + * @return This builder for chaining. + */ + public Builder addCostsPerVehicleIndices(int value) { + + ensureCostsPerVehicleIndicesIsMutable(); + costsPerVehicleIndices_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @param values The costsPerVehicleIndices to add. + * @return This builder for chaining. + */ + public Builder addAllCostsPerVehicleIndices( + java.lang.Iterable values) { + ensureCostsPerVehicleIndicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, costsPerVehicleIndices_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+     * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+     * index may not be specified more than once. If a vehicle is excluded from
+     * `costs_per_vehicle_indices`, its cost is zero.
+     * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return This builder for chaining. + */ + public Builder clearCostsPerVehicleIndices() { + costsPerVehicleIndices_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + private double pickupToDeliveryRelativeDetourLimit_; + /** + * + * + *
+     * Specifies the maximum relative detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_relative_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return Whether the pickupToDeliveryRelativeDetourLimit field is set. + */ + @java.lang.Override + public boolean hasPickupToDeliveryRelativeDetourLimit() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Specifies the maximum relative detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_relative_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return The pickupToDeliveryRelativeDetourLimit. + */ + @java.lang.Override + public double getPickupToDeliveryRelativeDetourLimit() { + return pickupToDeliveryRelativeDetourLimit_; + } + /** + * + * + *
+     * Specifies the maximum relative detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_relative_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @param value The pickupToDeliveryRelativeDetourLimit to set. + * @return This builder for chaining. + */ + public Builder setPickupToDeliveryRelativeDetourLimit(double value) { + + pickupToDeliveryRelativeDetourLimit_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum relative detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_relative_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return This builder for chaining. + */ + public Builder clearPickupToDeliveryRelativeDetourLimit() { + bitField0_ = (bitField0_ & ~0x00000100); + pickupToDeliveryRelativeDetourLimit_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Duration pickupToDeliveryAbsoluteDetourLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + pickupToDeliveryAbsoluteDetourLimitBuilder_; + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * + * @return Whether the pickupToDeliveryAbsoluteDetourLimit field is set. + */ + public boolean hasPickupToDeliveryAbsoluteDetourLimit() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * + * @return The pickupToDeliveryAbsoluteDetourLimit. + */ + public com.google.protobuf.Duration getPickupToDeliveryAbsoluteDetourLimit() { + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) { + return pickupToDeliveryAbsoluteDetourLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryAbsoluteDetourLimit_; + } else { + return pickupToDeliveryAbsoluteDetourLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + public Builder setPickupToDeliveryAbsoluteDetourLimit(com.google.protobuf.Duration value) { + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pickupToDeliveryAbsoluteDetourLimit_ = value; + } else { + pickupToDeliveryAbsoluteDetourLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + public Builder setPickupToDeliveryAbsoluteDetourLimit( + com.google.protobuf.Duration.Builder builderForValue) { + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) { + pickupToDeliveryAbsoluteDetourLimit_ = builderForValue.build(); + } else { + pickupToDeliveryAbsoluteDetourLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + public Builder mergePickupToDeliveryAbsoluteDetourLimit(com.google.protobuf.Duration value) { + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && pickupToDeliveryAbsoluteDetourLimit_ != null + && pickupToDeliveryAbsoluteDetourLimit_ + != com.google.protobuf.Duration.getDefaultInstance()) { + getPickupToDeliveryAbsoluteDetourLimitBuilder().mergeFrom(value); + } else { + pickupToDeliveryAbsoluteDetourLimit_ = value; + } + } else { + pickupToDeliveryAbsoluteDetourLimitBuilder_.mergeFrom(value); + } + if (pickupToDeliveryAbsoluteDetourLimit_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + public Builder clearPickupToDeliveryAbsoluteDetourLimit() { + bitField0_ = (bitField0_ & ~0x00000200); + pickupToDeliveryAbsoluteDetourLimit_ = null; + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ != null) { + pickupToDeliveryAbsoluteDetourLimitBuilder_.dispose(); + pickupToDeliveryAbsoluteDetourLimitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + public com.google.protobuf.Duration.Builder getPickupToDeliveryAbsoluteDetourLimitBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getPickupToDeliveryAbsoluteDetourLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + public com.google.protobuf.DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder() { + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ != null) { + return pickupToDeliveryAbsoluteDetourLimitBuilder_.getMessageOrBuilder(); + } else { + return pickupToDeliveryAbsoluteDetourLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryAbsoluteDetourLimit_; + } + } + /** + * + * + *
+     * Specifies the maximum absolute detour time compared to the shortest path
+     * from pickup to delivery. If specified, it must be nonnegative, and the
+     * shipment must contain at least a pickup and a delivery.
+     *
+     * For example, let t be the shortest time taken to go from the selected
+     * pickup alternative directly to the selected delivery alternative. Then
+     * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+     *
+     * ```
+     * start_time(delivery) - start_time(pickup) <=
+     * t + pickup_to_delivery_absolute_detour_limit
+     * ```
+     *
+     * If both relative and absolute limits are specified on the same shipment,
+     * the more constraining limit is used for each possible pickup/delivery pair.
+     * As of 2017/10, detours are only supported when travel durations do not
+     * depend on vehicles.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getPickupToDeliveryAbsoluteDetourLimitFieldBuilder() { + if (pickupToDeliveryAbsoluteDetourLimitBuilder_ == null) { + pickupToDeliveryAbsoluteDetourLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPickupToDeliveryAbsoluteDetourLimit(), getParentForChildren(), isClean()); + pickupToDeliveryAbsoluteDetourLimit_ = null; + } + return pickupToDeliveryAbsoluteDetourLimitBuilder_; + } + + private com.google.protobuf.Duration pickupToDeliveryTimeLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + pickupToDeliveryTimeLimitBuilder_; + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * + * @return Whether the pickupToDeliveryTimeLimit field is set. + */ + public boolean hasPickupToDeliveryTimeLimit() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * + * @return The pickupToDeliveryTimeLimit. + */ + public com.google.protobuf.Duration getPickupToDeliveryTimeLimit() { + if (pickupToDeliveryTimeLimitBuilder_ == null) { + return pickupToDeliveryTimeLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryTimeLimit_; + } else { + return pickupToDeliveryTimeLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + public Builder setPickupToDeliveryTimeLimit(com.google.protobuf.Duration value) { + if (pickupToDeliveryTimeLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pickupToDeliveryTimeLimit_ = value; + } else { + pickupToDeliveryTimeLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + public Builder setPickupToDeliveryTimeLimit( + com.google.protobuf.Duration.Builder builderForValue) { + if (pickupToDeliveryTimeLimitBuilder_ == null) { + pickupToDeliveryTimeLimit_ = builderForValue.build(); + } else { + pickupToDeliveryTimeLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + public Builder mergePickupToDeliveryTimeLimit(com.google.protobuf.Duration value) { + if (pickupToDeliveryTimeLimitBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && pickupToDeliveryTimeLimit_ != null + && pickupToDeliveryTimeLimit_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPickupToDeliveryTimeLimitBuilder().mergeFrom(value); + } else { + pickupToDeliveryTimeLimit_ = value; + } + } else { + pickupToDeliveryTimeLimitBuilder_.mergeFrom(value); + } + if (pickupToDeliveryTimeLimit_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + public Builder clearPickupToDeliveryTimeLimit() { + bitField0_ = (bitField0_ & ~0x00000400); + pickupToDeliveryTimeLimit_ = null; + if (pickupToDeliveryTimeLimitBuilder_ != null) { + pickupToDeliveryTimeLimitBuilder_.dispose(); + pickupToDeliveryTimeLimitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + public com.google.protobuf.Duration.Builder getPickupToDeliveryTimeLimitBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getPickupToDeliveryTimeLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + public com.google.protobuf.DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder() { + if (pickupToDeliveryTimeLimitBuilder_ != null) { + return pickupToDeliveryTimeLimitBuilder_.getMessageOrBuilder(); + } else { + return pickupToDeliveryTimeLimit_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pickupToDeliveryTimeLimit_; + } + } + /** + * + * + *
+     * Specifies the maximum duration from start of pickup to start of delivery of
+     * a shipment. If specified, it must be nonnegative, and the shipment must
+     * contain at least a pickup and a delivery. This does not depend on which
+     * alternatives are selected for pickup and delivery, nor on vehicle speed.
+     * This can be specified alongside maximum detour constraints: the solution
+     * will respect both specifications.
+     * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getPickupToDeliveryTimeLimitFieldBuilder() { + if (pickupToDeliveryTimeLimitBuilder_ == null) { + pickupToDeliveryTimeLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPickupToDeliveryTimeLimit(), getParentForChildren(), isClean()); + pickupToDeliveryTimeLimit_ = null; + } + return pickupToDeliveryTimeLimitBuilder_; + } + + private java.lang.Object shipmentType_ = ""; + /** + * + * + *
+     * Non-empty string specifying a "type" for this shipment.
+     * This feature can be used to define incompatibilities or requirements
+     * between `shipment_types` (see `shipment_type_incompatibilities` and
+     * `shipment_type_requirements` in `ShipmentModel`).
+     *
+     * Differs from `visit_types` which is specified for a single visit: All
+     * pickup/deliveries belonging to the same shipment share the same
+     * `shipment_type`.
+     * 
+ * + * string shipment_type = 11; + * + * @return The shipmentType. + */ + public java.lang.String getShipmentType() { + java.lang.Object ref = shipmentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shipmentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Non-empty string specifying a "type" for this shipment.
+     * This feature can be used to define incompatibilities or requirements
+     * between `shipment_types` (see `shipment_type_incompatibilities` and
+     * `shipment_type_requirements` in `ShipmentModel`).
+     *
+     * Differs from `visit_types` which is specified for a single visit: All
+     * pickup/deliveries belonging to the same shipment share the same
+     * `shipment_type`.
+     * 
+ * + * string shipment_type = 11; + * + * @return The bytes for shipmentType. + */ + public com.google.protobuf.ByteString getShipmentTypeBytes() { + java.lang.Object ref = shipmentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shipmentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Non-empty string specifying a "type" for this shipment.
+     * This feature can be used to define incompatibilities or requirements
+     * between `shipment_types` (see `shipment_type_incompatibilities` and
+     * `shipment_type_requirements` in `ShipmentModel`).
+     *
+     * Differs from `visit_types` which is specified for a single visit: All
+     * pickup/deliveries belonging to the same shipment share the same
+     * `shipment_type`.
+     * 
+ * + * string shipment_type = 11; + * + * @param value The shipmentType to set. + * @return This builder for chaining. + */ + public Builder setShipmentType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + shipmentType_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Non-empty string specifying a "type" for this shipment.
+     * This feature can be used to define incompatibilities or requirements
+     * between `shipment_types` (see `shipment_type_incompatibilities` and
+     * `shipment_type_requirements` in `ShipmentModel`).
+     *
+     * Differs from `visit_types` which is specified for a single visit: All
+     * pickup/deliveries belonging to the same shipment share the same
+     * `shipment_type`.
+     * 
+ * + * string shipment_type = 11; + * + * @return This builder for chaining. + */ + public Builder clearShipmentType() { + shipmentType_ = getDefaultInstance().getShipmentType(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Non-empty string specifying a "type" for this shipment.
+     * This feature can be used to define incompatibilities or requirements
+     * between `shipment_types` (see `shipment_type_incompatibilities` and
+     * `shipment_type_requirements` in `ShipmentModel`).
+     *
+     * Differs from `visit_types` which is specified for a single visit: All
+     * pickup/deliveries belonging to the same shipment share the same
+     * `shipment_type`.
+     * 
+ * + * string shipment_type = 11; + * + * @param value The bytes for shipmentType to set. + * @return This builder for chaining. + */ + public Builder setShipmentTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + shipmentType_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+     * Specifies a label for this shipment. This label is reported in the response
+     * in the `shipment_label` of the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 12; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies a label for this shipment. This label is reported in the response
+     * in the `shipment_label` of the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 12; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies a label for this shipment. This label is reported in the response
+     * in the `shipment_label` of the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 12; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + label_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a label for this shipment. This label is reported in the response
+     * in the `shipment_label` of the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 12; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + label_ = getDefaultInstance().getLabel(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a label for this shipment. This label is reported in the response
+     * in the `shipment_label` of the corresponding
+     * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+     * 
+ * + * string label = 12; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + label_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private boolean ignore_; + /** + * + * + *
+     * If true, skip this shipment, but don't apply a `penalty_cost`.
+     *
+     * Ignoring a shipment results in a validation error when there are any
+     * `shipment_type_requirements` in the model.
+     *
+     * Ignoring a shipment that is performed in `injected_first_solution_routes`
+     * or `injected_solution_constraint` is permitted; the solver removes the
+     * related pickup/delivery visits from the performing route.
+     * `precedence_rules` that reference ignored shipments will also be ignored.
+     * 
+ * + * bool ignore = 13; + * + * @return The ignore. + */ + @java.lang.Override + public boolean getIgnore() { + return ignore_; + } + /** + * + * + *
+     * If true, skip this shipment, but don't apply a `penalty_cost`.
+     *
+     * Ignoring a shipment results in a validation error when there are any
+     * `shipment_type_requirements` in the model.
+     *
+     * Ignoring a shipment that is performed in `injected_first_solution_routes`
+     * or `injected_solution_constraint` is permitted; the solver removes the
+     * related pickup/delivery visits from the performing route.
+     * `precedence_rules` that reference ignored shipments will also be ignored.
+     * 
+ * + * bool ignore = 13; + * + * @param value The ignore to set. + * @return This builder for chaining. + */ + public Builder setIgnore(boolean value) { + + ignore_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, skip this shipment, but don't apply a `penalty_cost`.
+     *
+     * Ignoring a shipment results in a validation error when there are any
+     * `shipment_type_requirements` in the model.
+     *
+     * Ignoring a shipment that is performed in `injected_first_solution_routes`
+     * or `injected_solution_constraint` is permitted; the solver removes the
+     * related pickup/delivery visits from the performing route.
+     * `precedence_rules` that reference ignored shipments will also be ignored.
+     * 
+ * + * bool ignore = 13; + * + * @return This builder for chaining. + */ + public Builder clearIgnore() { + bitField0_ = (bitField0_ & ~0x00002000); + ignore_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Shipment) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Shipment) + private static final com.google.maps.routeoptimization.v1.Shipment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Shipment(); + } + + public static com.google.maps.routeoptimization.v1.Shipment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Shipment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentModel.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentModel.java new file mode 100644 index 000000000000..8f62eb8d6d6a --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentModel.java @@ -0,0 +1,12262 @@ +/* + * 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.3 +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; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentModelOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentModelOrBuilder.java new file mode 100644 index 000000000000..ed799e86ad46 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentModelOrBuilder.java @@ -0,0 +1,1257 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface ShipmentModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentModel) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Set of shipments which must be performed in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + java.util.List getShipmentsList(); + /** + * + * + *
+   * Set of shipments which must be performed in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + com.google.maps.routeoptimization.v1.Shipment getShipments(int index); + /** + * + * + *
+   * Set of shipments which must be performed in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + int getShipmentsCount(); + /** + * + * + *
+   * Set of shipments which must be performed in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + java.util.List + getShipmentsOrBuilderList(); + /** + * + * + *
+   * Set of shipments which must be performed in the model.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + com.google.maps.routeoptimization.v1.ShipmentOrBuilder getShipmentsOrBuilder(int index); + + /** + * + * + *
+   * Set of vehicles which can be used to perform visits.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + java.util.List getVehiclesList(); + /** + * + * + *
+   * Set of vehicles which can be used to perform visits.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + com.google.maps.routeoptimization.v1.Vehicle getVehicles(int index); + /** + * + * + *
+   * Set of vehicles which can be used to perform visits.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + int getVehiclesCount(); + /** + * + * + *
+   * Set of vehicles which can be used to perform visits.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + java.util.List + getVehiclesOrBuilderList(); + /** + * + * + *
+   * Set of vehicles which can be used to perform visits.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + com.google.maps.routeoptimization.v1.VehicleOrBuilder getVehiclesOrBuilder(int index); + + /** + * + * + *
+   * 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. + */ + boolean hasMaxActiveVehicles(); + /** + * + * + *
+   * 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. + */ + int getMaxActiveVehicles(); + + /** + * + * + *
+   * 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. + */ + boolean hasGlobalStartTime(); + /** + * + * + *
+   * 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. + */ + com.google.protobuf.Timestamp getGlobalStartTime(); + /** + * + * + *
+   * 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; + */ + com.google.protobuf.TimestampOrBuilder getGlobalStartTimeOrBuilder(); + + /** + * + * + *
+   * 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. + */ + boolean hasGlobalEndTime(); + /** + * + * + *
+   * 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. + */ + com.google.protobuf.Timestamp getGlobalEndTime(); + /** + * + * + *
+   * 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; + */ + com.google.protobuf.TimestampOrBuilder getGlobalEndTimeOrBuilder(); + + /** + * + * + *
+   * 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. + */ + double getGlobalDurationCostPerHour(); + + /** + * + * + *
+   * 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.util.List + getDurationDistanceMatricesList(); + /** + * + * + *
+   * 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; + * + */ + com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + getDurationDistanceMatrices(int 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; + * + */ + int getDurationDistanceMatricesCount(); + /** + * + * + *
+   * 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.util.List< + ? extends + com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder> + getDurationDistanceMatricesOrBuilderList(); + /** + * + * + *
+   * 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; + * + */ + com.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrixOrBuilder + getDurationDistanceMatricesOrBuilder(int 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; + * + * @return A list containing the durationDistanceMatrixSrcTags. + */ + java.util.List getDurationDistanceMatrixSrcTagsList(); + /** + * + * + *
+   * 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. + */ + int getDurationDistanceMatrixSrcTagsCount(); + /** + * + * + *
+   * 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. + */ + java.lang.String getDurationDistanceMatrixSrcTags(int 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. + */ + com.google.protobuf.ByteString getDurationDistanceMatrixSrcTagsBytes(int 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; + * + * @return A list containing the durationDistanceMatrixDstTags. + */ + java.util.List getDurationDistanceMatrixDstTagsList(); + /** + * + * + *
+   * 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. + */ + int getDurationDistanceMatrixDstTagsCount(); + /** + * + * + *
+   * 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. + */ + java.lang.String getDurationDistanceMatrixDstTags(int 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. + */ + com.google.protobuf.ByteString getDurationDistanceMatrixDstTagsBytes(int index); + + /** + * + * + *
+   * Transition attributes added to the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * + */ + java.util.List + getTransitionAttributesList(); + /** + * + * + *
+   * Transition attributes added to the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * + */ + com.google.maps.routeoptimization.v1.TransitionAttributes getTransitionAttributes(int index); + /** + * + * + *
+   * Transition attributes added to the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * + */ + int getTransitionAttributesCount(); + /** + * + * + *
+   * Transition attributes added to the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * + */ + java.util.List + getTransitionAttributesOrBuilderList(); + /** + * + * + *
+   * Transition attributes added to the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * + */ + com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder + getTransitionAttributesOrBuilder(int index); + + /** + * + * + *
+   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * + */ + java.util.List + getShipmentTypeIncompatibilitiesList(); + /** + * + * + *
+   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * + */ + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility getShipmentTypeIncompatibilities( + int index); + /** + * + * + *
+   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * + */ + int getShipmentTypeIncompatibilitiesCount(); + /** + * + * + *
+   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * + */ + java.util.List< + ? extends com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder> + getShipmentTypeIncompatibilitiesOrBuilderList(); + /** + * + * + *
+   * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * + */ + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder + getShipmentTypeIncompatibilitiesOrBuilder(int index); + + /** + * + * + *
+   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * + */ + java.util.List + getShipmentTypeRequirementsList(); + /** + * + * + *
+   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * + */ + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement getShipmentTypeRequirements( + int index); + /** + * + * + *
+   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * + */ + int getShipmentTypeRequirementsCount(); + /** + * + * + *
+   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * + */ + java.util.List + getShipmentTypeRequirementsOrBuilderList(); + /** + * + * + *
+   * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * + */ + com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder + getShipmentTypeRequirementsOrBuilder(int index); + + /** + * + * + *
+   * Set of precedence rules which must be enforced in the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * + */ + java.util.List + getPrecedenceRulesList(); + /** + * + * + *
+   * Set of precedence rules which must be enforced in the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * + */ + com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule getPrecedenceRules(int index); + /** + * + * + *
+   * Set of precedence rules which must be enforced in the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * + */ + int getPrecedenceRulesCount(); + /** + * + * + *
+   * Set of precedence rules which must be enforced in the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * + */ + java.util.List< + ? extends com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder> + getPrecedenceRulesOrBuilderList(); + /** + * + * + *
+   * Set of precedence rules which must be enforced in the model.
+   * 
+ * + * + * repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * + */ + com.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRuleOrBuilder + getPrecedenceRulesOrBuilder(int index); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentOrBuilder.java new file mode 100644 index 000000000000..2c25b0897710 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentOrBuilder.java @@ -0,0 +1,736 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface ShipmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Shipment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The user-defined display name of the shipment.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 16; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The user-defined display name of the shipment.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 16; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + java.util.List getPickupsList(); + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + com.google.maps.routeoptimization.v1.Shipment.VisitRequest getPickups(int index); + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + int getPickupsCount(); + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + java.util.List + getPickupsOrBuilderList(); + /** + * + * + *
+   * Set of pickup alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the deliveries.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getPickupsOrBuilder( + int index); + + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + java.util.List getDeliveriesList(); + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + com.google.maps.routeoptimization.v1.Shipment.VisitRequest getDeliveries(int index); + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + int getDeliveriesCount(); + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + java.util.List + getDeliveriesOrBuilderList(); + /** + * + * + *
+   * Set of delivery alternatives associated to the shipment. If not specified,
+   * the vehicle only needs to visit a location corresponding to the pickups.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + com.google.maps.routeoptimization.v1.Shipment.VisitRequestOrBuilder getDeliveriesOrBuilder( + int index); + + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + int getLoadDemandsCount(); + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + boolean containsLoadDemands(java.lang.String key); + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getLoadDemands(); + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + java.util.Map + getLoadDemandsMap(); + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue); + /** + * + * + *
+   * Load demands of the shipment (for example weight, volume, number of
+   * pallets etc). The keys in the map should be identifiers describing the type
+   * of the corresponding load, ideally also including the units.
+   * For example: "weight_kg", "volume_gallons", "pallet_count", etc.
+   * If a given key does not appear in the map, the corresponding load is
+   * considered as null.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 14; + * + */ + com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(java.lang.String key); + + /** + * + * + *
+   * If the shipment is not completed, this penalty is added to the overall
+   * cost of the routes. A shipment is considered completed if one of its pickup
+   * and delivery alternatives is visited. The cost may be expressed in the
+   * same unit used for all other cost-related fields in the model and must be
+   * positive.
+   *
+   * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+   * i.e. the shipment must be completed.
+   * 
+ * + * optional double penalty_cost = 4; + * + * @return Whether the penaltyCost field is set. + */ + boolean hasPenaltyCost(); + /** + * + * + *
+   * If the shipment is not completed, this penalty is added to the overall
+   * cost of the routes. A shipment is considered completed if one of its pickup
+   * and delivery alternatives is visited. The cost may be expressed in the
+   * same unit used for all other cost-related fields in the model and must be
+   * positive.
+   *
+   * *IMPORTANT*: If this penalty is not specified, it is considered infinite,
+   * i.e. the shipment must be completed.
+   * 
+ * + * optional double penalty_cost = 4; + * + * @return The penaltyCost. + */ + double getPenaltyCost(); + + /** + * + * + *
+   * The set of vehicles that may perform this shipment. If empty, all vehicles
+   * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+   * `vehicles` list.
+   * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return A list containing the allowedVehicleIndices. + */ + java.util.List getAllowedVehicleIndicesList(); + /** + * + * + *
+   * The set of vehicles that may perform this shipment. If empty, all vehicles
+   * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+   * `vehicles` list.
+   * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @return The count of allowedVehicleIndices. + */ + int getAllowedVehicleIndicesCount(); + /** + * + * + *
+   * The set of vehicles that may perform this shipment. If empty, all vehicles
+   * may perform it. Vehicles are given by their index in the `ShipmentModel`'s
+   * `vehicles` list.
+   * 
+ * + * repeated int32 allowed_vehicle_indices = 5; + * + * @param index The index of the element to return. + * @return The allowedVehicleIndices at the given index. + */ + int getAllowedVehicleIndices(int index); + + /** + * + * + *
+   * Specifies the cost that is incurred when this shipment is delivered by each
+   * vehicle. If specified, it must have EITHER:
+   *
+   *   * the same number of elements as `costs_per_vehicle_indices`.
+   *     `costs_per_vehicle[i]` corresponds to vehicle
+   *     `costs_per_vehicle_indices[i]` of the model.
+   *   * the same number of elements as there are vehicles in the model. The
+   *     i-th element corresponds to vehicle #i of the model.
+   *
+   * These costs must be in the same unit as `penalty_cost` and must not be
+   * negative. Leave this field empty, if there are no such costs.
+   * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return A list containing the costsPerVehicle. + */ + java.util.List getCostsPerVehicleList(); + /** + * + * + *
+   * Specifies the cost that is incurred when this shipment is delivered by each
+   * vehicle. If specified, it must have EITHER:
+   *
+   *   * the same number of elements as `costs_per_vehicle_indices`.
+   *     `costs_per_vehicle[i]` corresponds to vehicle
+   *     `costs_per_vehicle_indices[i]` of the model.
+   *   * the same number of elements as there are vehicles in the model. The
+   *     i-th element corresponds to vehicle #i of the model.
+   *
+   * These costs must be in the same unit as `penalty_cost` and must not be
+   * negative. Leave this field empty, if there are no such costs.
+   * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @return The count of costsPerVehicle. + */ + int getCostsPerVehicleCount(); + /** + * + * + *
+   * Specifies the cost that is incurred when this shipment is delivered by each
+   * vehicle. If specified, it must have EITHER:
+   *
+   *   * the same number of elements as `costs_per_vehicle_indices`.
+   *     `costs_per_vehicle[i]` corresponds to vehicle
+   *     `costs_per_vehicle_indices[i]` of the model.
+   *   * the same number of elements as there are vehicles in the model. The
+   *     i-th element corresponds to vehicle #i of the model.
+   *
+   * These costs must be in the same unit as `penalty_cost` and must not be
+   * negative. Leave this field empty, if there are no such costs.
+   * 
+ * + * repeated double costs_per_vehicle = 6; + * + * @param index The index of the element to return. + * @return The costsPerVehicle at the given index. + */ + double getCostsPerVehicle(int index); + + /** + * + * + *
+   * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+   * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+   * index may not be specified more than once. If a vehicle is excluded from
+   * `costs_per_vehicle_indices`, its cost is zero.
+   * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return A list containing the costsPerVehicleIndices. + */ + java.util.List getCostsPerVehicleIndicesList(); + /** + * + * + *
+   * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+   * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+   * index may not be specified more than once. If a vehicle is excluded from
+   * `costs_per_vehicle_indices`, its cost is zero.
+   * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @return The count of costsPerVehicleIndices. + */ + int getCostsPerVehicleIndicesCount(); + /** + * + * + *
+   * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
+   * it must have the same number of elements as `costs_per_vehicle`. A vehicle
+   * index may not be specified more than once. If a vehicle is excluded from
+   * `costs_per_vehicle_indices`, its cost is zero.
+   * 
+ * + * repeated int32 costs_per_vehicle_indices = 7; + * + * @param index The index of the element to return. + * @return The costsPerVehicleIndices at the given index. + */ + int getCostsPerVehicleIndices(int index); + + /** + * + * + *
+   * Specifies the maximum relative detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_relative_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return Whether the pickupToDeliveryRelativeDetourLimit field is set. + */ + boolean hasPickupToDeliveryRelativeDetourLimit(); + /** + * + * + *
+   * Specifies the maximum relative detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_relative_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * optional double pickup_to_delivery_relative_detour_limit = 8; + * + * @return The pickupToDeliveryRelativeDetourLimit. + */ + double getPickupToDeliveryRelativeDetourLimit(); + + /** + * + * + *
+   * Specifies the maximum absolute detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * t + pickup_to_delivery_absolute_detour_limit
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * + * @return Whether the pickupToDeliveryAbsoluteDetourLimit field is set. + */ + boolean hasPickupToDeliveryAbsoluteDetourLimit(); + /** + * + * + *
+   * Specifies the maximum absolute detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * t + pickup_to_delivery_absolute_detour_limit
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * + * @return The pickupToDeliveryAbsoluteDetourLimit. + */ + com.google.protobuf.Duration getPickupToDeliveryAbsoluteDetourLimit(); + /** + * + * + *
+   * Specifies the maximum absolute detour time compared to the shortest path
+   * from pickup to delivery. If specified, it must be nonnegative, and the
+   * shipment must contain at least a pickup and a delivery.
+   *
+   * For example, let t be the shortest time taken to go from the selected
+   * pickup alternative directly to the selected delivery alternative. Then
+   * setting `pickup_to_delivery_absolute_detour_limit` enforces:
+   *
+   * ```
+   * start_time(delivery) - start_time(pickup) <=
+   * t + pickup_to_delivery_absolute_detour_limit
+   * ```
+   *
+   * If both relative and absolute limits are specified on the same shipment,
+   * the more constraining limit is used for each possible pickup/delivery pair.
+   * As of 2017/10, detours are only supported when travel durations do not
+   * depend on vehicles.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + com.google.protobuf.DurationOrBuilder getPickupToDeliveryAbsoluteDetourLimitOrBuilder(); + + /** + * + * + *
+   * Specifies the maximum duration from start of pickup to start of delivery of
+   * a shipment. If specified, it must be nonnegative, and the shipment must
+   * contain at least a pickup and a delivery. This does not depend on which
+   * alternatives are selected for pickup and delivery, nor on vehicle speed.
+   * This can be specified alongside maximum detour constraints: the solution
+   * will respect both specifications.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * + * @return Whether the pickupToDeliveryTimeLimit field is set. + */ + boolean hasPickupToDeliveryTimeLimit(); + /** + * + * + *
+   * Specifies the maximum duration from start of pickup to start of delivery of
+   * a shipment. If specified, it must be nonnegative, and the shipment must
+   * contain at least a pickup and a delivery. This does not depend on which
+   * alternatives are selected for pickup and delivery, nor on vehicle speed.
+   * This can be specified alongside maximum detour constraints: the solution
+   * will respect both specifications.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * + * @return The pickupToDeliveryTimeLimit. + */ + com.google.protobuf.Duration getPickupToDeliveryTimeLimit(); + /** + * + * + *
+   * Specifies the maximum duration from start of pickup to start of delivery of
+   * a shipment. If specified, it must be nonnegative, and the shipment must
+   * contain at least a pickup and a delivery. This does not depend on which
+   * alternatives are selected for pickup and delivery, nor on vehicle speed.
+   * This can be specified alongside maximum detour constraints: the solution
+   * will respect both specifications.
+   * 
+ * + * .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + com.google.protobuf.DurationOrBuilder getPickupToDeliveryTimeLimitOrBuilder(); + + /** + * + * + *
+   * Non-empty string specifying a "type" for this shipment.
+   * This feature can be used to define incompatibilities or requirements
+   * between `shipment_types` (see `shipment_type_incompatibilities` and
+   * `shipment_type_requirements` in `ShipmentModel`).
+   *
+   * Differs from `visit_types` which is specified for a single visit: All
+   * pickup/deliveries belonging to the same shipment share the same
+   * `shipment_type`.
+   * 
+ * + * string shipment_type = 11; + * + * @return The shipmentType. + */ + java.lang.String getShipmentType(); + /** + * + * + *
+   * Non-empty string specifying a "type" for this shipment.
+   * This feature can be used to define incompatibilities or requirements
+   * between `shipment_types` (see `shipment_type_incompatibilities` and
+   * `shipment_type_requirements` in `ShipmentModel`).
+   *
+   * Differs from `visit_types` which is specified for a single visit: All
+   * pickup/deliveries belonging to the same shipment share the same
+   * `shipment_type`.
+   * 
+ * + * string shipment_type = 11; + * + * @return The bytes for shipmentType. + */ + com.google.protobuf.ByteString getShipmentTypeBytes(); + + /** + * + * + *
+   * Specifies a label for this shipment. This label is reported in the response
+   * in the `shipment_label` of the corresponding
+   * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+   * 
+ * + * string label = 12; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+   * Specifies a label for this shipment. This label is reported in the response
+   * in the `shipment_label` of the corresponding
+   * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit].
+   * 
+ * + * string label = 12; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); + + /** + * + * + *
+   * If true, skip this shipment, but don't apply a `penalty_cost`.
+   *
+   * Ignoring a shipment results in a validation error when there are any
+   * `shipment_type_requirements` in the model.
+   *
+   * Ignoring a shipment that is performed in `injected_first_solution_routes`
+   * or `injected_solution_constraint` is permitted; the solver removes the
+   * related pickup/delivery visits from the performing route.
+   * `precedence_rules` that reference ignored shipments will also be ignored.
+   * 
+ * + * bool ignore = 13; + * + * @return The ignore. + */ + boolean getIgnore(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentRoute.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentRoute.java new file mode 100644 index 000000000000..2a1be8b1ace2 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentRoute.java @@ -0,0 +1,13154 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * A vehicle's route can be decomposed, along the time axis, like this (we
+ * assume there are n visits):
+ * ```
+ *   |            |            |          |       |  T[2], |        |      |
+ *   | Transition |  Visit #0  |          |       |  V[2], |        |      |
+ *   |     #0     |    aka     |   T[1]   |  V[1] |  ...   | V[n-1] | T[n] |
+ *   |  aka T[0]  |    V[0]    |          |       | V[n-2],|        |      |
+ *   |            |            |          |       | T[n-1] |        |      |
+ *   ^            ^            ^          ^       ^        ^        ^      ^
+ * vehicle    V[0].start   V[0].end     V[1].   V[1].    V[n].    V[n]. vehicle
+ *  start     (arrival)   (departure)   start   end      start    end     end
+ * ```
+ * Note that we make a difference between:
+ *
+ * * "punctual events", such as the vehicle start and end and each visit's start
+ *   and end (aka arrival and departure). They happen at a given second.
+ * * "time intervals", such as the visits themselves, and the transition between
+ *   visits. Though time intervals can sometimes have zero duration, i.e. start
+ *   and end at the same second, they often have a positive duration.
+ *
+ * Invariants:
+ *
+ * * If there are n visits, there are n+1 transitions.
+ * * A visit is always surrounded by a transition before it (same index) and a
+ *   transition after it (index + 1).
+ * * The vehicle start is always followed by transition #0.
+ * * The vehicle end is always preceded by transition #n.
+ *
+ * Zooming in, here is what happens during a `Transition` and a `Visit`:
+ * ```
+ * ---+-------------------------------------+-----------------------------+-->
+ *    |           TRANSITION[i]             |           VISIT[i]          |
+ *    |                                     |                             |
+ *    |  * TRAVEL: the vehicle moves from   |      PERFORM the visit:     |
+ *    |    VISIT[i-1].departure_location to |                             |
+ *    |    VISIT[i].arrival_location, which |  * Spend some time:         |
+ *    |    takes a given travel duration    |    the "visit duration".    |
+ *    |    and distance                     |                             |
+ *    |                                     |  * Load or unload           |
+ *    |  * BREAKS: the driver may have      |    some quantities from the |
+ *    |    breaks (e.g. lunch break).       |    vehicle: the "demand".   |
+ *    |                                     |                             |
+ *    |  * WAIT: the driver/vehicle does    |                             |
+ *    |    nothing. This can happen for     |                             |
+ *    |    many reasons, for example when   |                             |
+ *    |    the vehicle reaches the next     |                             |
+ *    |    event's destination before the   |                             |
+ *    |    start of its time window         |                             |
+ *    |                                     |                             |
+ *    |  * DELAY: *right before* the next   |                             |
+ *    |    arrival. E.g. the vehicle and/or |                             |
+ *    |    driver spends time unloading.    |                             |
+ *    |                                     |                             |
+ * ---+-------------------------------------+-----------------------------+-->
+ *    ^                                     ^                             ^
+ * V[i-1].end                           V[i].start                    V[i].end
+ * ```
+ * Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged
+ * during a transition.
+ *
+ * * They don't overlap.
+ * * The DELAY is unique and *must* be a contiguous period of time right
+ *   before the next visit (or vehicle end). Thus, it suffice to know the
+ *   delay duration to know its start and end time.
+ * * The BREAKS are contiguous, non-overlapping periods of time. The
+ *   response specifies the start time and duration of each break.
+ * * TRAVEL and WAIT are "preemptable": they can be interrupted several times
+ *   during this transition. Clients can assume that travel happens "as soon as
+ *   possible" and that "wait" fills the remaining time.
+ *
+ * A (complex) example:
+ * ```
+ *                                TRANSITION[i]
+ * --++-----+-----------------------------------------------------------++-->
+ *   ||     |       |           |       |           |         |         ||
+ *   ||  T  |   B   |     T     |       |     B     |         |    D    ||
+ *   ||  r  |   r   |     r     |   W   |     r     |    W    |    e    ||
+ *   ||  a  |   e   |     a     |   a   |     e     |    a    |    l    ||
+ *   ||  v  |   a   |     v     |   i   |     a     |    i    |    a    ||
+ *   ||  e  |   k   |     e     |   t   |     k     |    t    |    y    ||
+ *   ||  l  |       |     l     |       |           |         |         ||
+ *   ||     |       |           |       |           |         |         ||
+ * --++-----------------------------------------------------------------++-->
+ * ```
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute} + */ +public final class ShipmentRoute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentRoute) + ShipmentRouteOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShipmentRoute.newBuilder() to construct. + private ShipmentRoute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ShipmentRoute() { + vehicleLabel_ = ""; + visits_ = java.util.Collections.emptyList(); + transitions_ = java.util.Collections.emptyList(); + breaks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ShipmentRoute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 17: + return internalGetRouteCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder.class); + } + + public interface VisitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentRoute.Visit) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Index of the `shipments` field in the source
+     * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel].
+     * 
+ * + * int32 shipment_index = 1; + * + * @return The shipmentIndex. + */ + int getShipmentIndex(); + + /** + * + * + *
+     * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
+     * corresponds to a delivery.
+     * 
+ * + * bool is_pickup = 2; + * + * @return The isPickup. + */ + boolean getIsPickup(); + + /** + * + * + *
+     * Index of `VisitRequest` in either the pickup or delivery field of the
+     * `Shipment` (see `is_pickup`).
+     * 
+ * + * int32 visit_request_index = 3; + * + * @return The visitRequestIndex. + */ + int getVisitRequestIndex(); + + /** + * + * + *
+     * Time at which the visit starts. Note that the vehicle may arrive earlier
+     * than this at the visit location. Times are consistent with the
+     * `ShipmentModel`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+     * Time at which the visit starts. Note that the vehicle may arrive earlier
+     * than this at the visit location. Times are consistent with the
+     * `ShipmentModel`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+     * Time at which the visit starts. Note that the vehicle may arrive earlier
+     * than this at the visit location. Times are consistent with the
+     * `ShipmentModel`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + int getLoadDemandsCount(); + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + boolean containsLoadDemands(java.lang.String key); + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getLoadDemands(); + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + java.util.Map + getLoadDemandsMap(); + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue); + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow(java.lang.String key); + + /** + * + * + *
+     * Extra detour time due to the shipments visited on the route before the
+     * visit and to the potential waiting time induced by time windows.
+     * If the visit is a delivery, the detour is computed from the corresponding
+     * pickup visit and is equal to:
+     * ```
+     * start_time(delivery) - start_time(pickup)
+     * - (duration(pickup) + travel duration from the pickup location
+     * to the delivery location).
+     * ```
+     * Otherwise, it is computed from the vehicle `start_location` and is equal
+     * to:
+     * ```
+     * start_time - vehicle_start_time - travel duration from
+     * the vehicle's `start_location` to the visit.
+     * ```
+     * 
+ * + * .google.protobuf.Duration detour = 6; + * + * @return Whether the detour field is set. + */ + boolean hasDetour(); + /** + * + * + *
+     * Extra detour time due to the shipments visited on the route before the
+     * visit and to the potential waiting time induced by time windows.
+     * If the visit is a delivery, the detour is computed from the corresponding
+     * pickup visit and is equal to:
+     * ```
+     * start_time(delivery) - start_time(pickup)
+     * - (duration(pickup) + travel duration from the pickup location
+     * to the delivery location).
+     * ```
+     * Otherwise, it is computed from the vehicle `start_location` and is equal
+     * to:
+     * ```
+     * start_time - vehicle_start_time - travel duration from
+     * the vehicle's `start_location` to the visit.
+     * ```
+     * 
+ * + * .google.protobuf.Duration detour = 6; + * + * @return The detour. + */ + com.google.protobuf.Duration getDetour(); + /** + * + * + *
+     * Extra detour time due to the shipments visited on the route before the
+     * visit and to the potential waiting time induced by time windows.
+     * If the visit is a delivery, the detour is computed from the corresponding
+     * pickup visit and is equal to:
+     * ```
+     * start_time(delivery) - start_time(pickup)
+     * - (duration(pickup) + travel duration from the pickup location
+     * to the delivery location).
+     * ```
+     * Otherwise, it is computed from the vehicle `start_location` and is equal
+     * to:
+     * ```
+     * start_time - vehicle_start_time - travel duration from
+     * the vehicle's `start_location` to the visit.
+     * ```
+     * 
+ * + * .google.protobuf.Duration detour = 6; + */ + com.google.protobuf.DurationOrBuilder getDetourOrBuilder(); + + /** + * + * + *
+     * Copy of the corresponding `Shipment.label`, if specified in the
+     * `Shipment`.
+     * 
+ * + * string shipment_label = 7; + * + * @return The shipmentLabel. + */ + java.lang.String getShipmentLabel(); + /** + * + * + *
+     * Copy of the corresponding `Shipment.label`, if specified in the
+     * `Shipment`.
+     * 
+ * + * string shipment_label = 7; + * + * @return The bytes for shipmentLabel. + */ + com.google.protobuf.ByteString getShipmentLabelBytes(); + + /** + * + * + *
+     * Copy of the corresponding
+     * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+     * if specified in the `VisitRequest`.
+     * 
+ * + * string visit_label = 8; + * + * @return The visitLabel. + */ + java.lang.String getVisitLabel(); + /** + * + * + *
+     * Copy of the corresponding
+     * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+     * if specified in the `VisitRequest`.
+     * 
+ * + * string visit_label = 8; + * + * @return The bytes for visitLabel. + */ + com.google.protobuf.ByteString getVisitLabelBytes(); + } + /** + * + * + *
+   * A visit performed during a route. This visit corresponds to a pickup or a
+   * delivery of a `Shipment`.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.Visit} + */ + public static final class Visit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentRoute.Visit) + VisitOrBuilder { + private static final long serialVersionUID = 0L; + // Use Visit.newBuilder() to construct. + private Visit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Visit() { + shipmentLabel_ = ""; + visitLabel_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Visit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder.class); + } + + private int bitField0_; + public static final int SHIPMENT_INDEX_FIELD_NUMBER = 1; + private int shipmentIndex_ = 0; + /** + * + * + *
+     * Index of the `shipments` field in the source
+     * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel].
+     * 
+ * + * int32 shipment_index = 1; + * + * @return The shipmentIndex. + */ + @java.lang.Override + public int getShipmentIndex() { + return shipmentIndex_; + } + + public static final int IS_PICKUP_FIELD_NUMBER = 2; + private boolean isPickup_ = false; + /** + * + * + *
+     * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
+     * corresponds to a delivery.
+     * 
+ * + * bool is_pickup = 2; + * + * @return The isPickup. + */ + @java.lang.Override + public boolean getIsPickup() { + return isPickup_; + } + + public static final int VISIT_REQUEST_INDEX_FIELD_NUMBER = 3; + private int visitRequestIndex_ = 0; + /** + * + * + *
+     * Index of `VisitRequest` in either the pickup or delivery field of the
+     * `Shipment` (see `is_pickup`).
+     * 
+ * + * int32 visit_request_index = 3; + * + * @return The visitRequestIndex. + */ + @java.lang.Override + public int getVisitRequestIndex() { + return visitRequestIndex_; + } + + public static final int START_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+     * Time at which the visit starts. Note that the vehicle may arrive earlier
+     * than this at the visit location. Times are consistent with the
+     * `ShipmentModel`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Time at which the visit starts. Note that the vehicle may arrive earlier
+     * than this at the visit location. Times are consistent with the
+     * `ShipmentModel`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+     * Time at which the visit starts. Note that the vehicle may arrive earlier
+     * than this at the visit location. Times are consistent with the
+     * `ShipmentModel`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int LOAD_DEMANDS_FIELD_NUMBER = 11; + + private static final class LoadDemandsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_LoadDemandsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.maps.routeoptimization.v1.Shipment.Load.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + internalGetLoadDemands() { + if (loadDemands_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LoadDemandsDefaultEntryHolder.defaultEntry); + } + return loadDemands_; + } + + public int getLoadDemandsCount() { + return internalGetLoadDemands().getMap().size(); + } + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public boolean containsLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadDemands().getMap().containsKey(key); + } + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadDemands() { + return getLoadDemandsMap(); + } + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public java.util.Map + getLoadDemandsMap() { + return internalGetLoadDemands().getMap(); + } + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load + getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadDemands().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Total visit load demand as the sum of the shipment and the visit request
+     * `load_demands`. The values are negative if the visit is a delivery.
+     * Demands are reported for the same types as the
+     * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+     * (see this field).
+     * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadDemands().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DETOUR_FIELD_NUMBER = 6; + private com.google.protobuf.Duration detour_; + /** + * + * + *
+     * Extra detour time due to the shipments visited on the route before the
+     * visit and to the potential waiting time induced by time windows.
+     * If the visit is a delivery, the detour is computed from the corresponding
+     * pickup visit and is equal to:
+     * ```
+     * start_time(delivery) - start_time(pickup)
+     * - (duration(pickup) + travel duration from the pickup location
+     * to the delivery location).
+     * ```
+     * Otherwise, it is computed from the vehicle `start_location` and is equal
+     * to:
+     * ```
+     * start_time - vehicle_start_time - travel duration from
+     * the vehicle's `start_location` to the visit.
+     * ```
+     * 
+ * + * .google.protobuf.Duration detour = 6; + * + * @return Whether the detour field is set. + */ + @java.lang.Override + public boolean hasDetour() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Extra detour time due to the shipments visited on the route before the
+     * visit and to the potential waiting time induced by time windows.
+     * If the visit is a delivery, the detour is computed from the corresponding
+     * pickup visit and is equal to:
+     * ```
+     * start_time(delivery) - start_time(pickup)
+     * - (duration(pickup) + travel duration from the pickup location
+     * to the delivery location).
+     * ```
+     * Otherwise, it is computed from the vehicle `start_location` and is equal
+     * to:
+     * ```
+     * start_time - vehicle_start_time - travel duration from
+     * the vehicle's `start_location` to the visit.
+     * ```
+     * 
+ * + * .google.protobuf.Duration detour = 6; + * + * @return The detour. + */ + @java.lang.Override + public com.google.protobuf.Duration getDetour() { + return detour_ == null ? com.google.protobuf.Duration.getDefaultInstance() : detour_; + } + /** + * + * + *
+     * Extra detour time due to the shipments visited on the route before the
+     * visit and to the potential waiting time induced by time windows.
+     * If the visit is a delivery, the detour is computed from the corresponding
+     * pickup visit and is equal to:
+     * ```
+     * start_time(delivery) - start_time(pickup)
+     * - (duration(pickup) + travel duration from the pickup location
+     * to the delivery location).
+     * ```
+     * Otherwise, it is computed from the vehicle `start_location` and is equal
+     * to:
+     * ```
+     * start_time - vehicle_start_time - travel duration from
+     * the vehicle's `start_location` to the visit.
+     * ```
+     * 
+ * + * .google.protobuf.Duration detour = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDetourOrBuilder() { + return detour_ == null ? com.google.protobuf.Duration.getDefaultInstance() : detour_; + } + + public static final int SHIPMENT_LABEL_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object shipmentLabel_ = ""; + /** + * + * + *
+     * Copy of the corresponding `Shipment.label`, if specified in the
+     * `Shipment`.
+     * 
+ * + * string shipment_label = 7; + * + * @return The shipmentLabel. + */ + @java.lang.Override + public java.lang.String getShipmentLabel() { + java.lang.Object ref = shipmentLabel_; + 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(); + shipmentLabel_ = s; + return s; + } + } + /** + * + * + *
+     * Copy of the corresponding `Shipment.label`, if specified in the
+     * `Shipment`.
+     * 
+ * + * string shipment_label = 7; + * + * @return The bytes for shipmentLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getShipmentLabelBytes() { + java.lang.Object ref = shipmentLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shipmentLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VISIT_LABEL_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object visitLabel_ = ""; + /** + * + * + *
+     * Copy of the corresponding
+     * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+     * if specified in the `VisitRequest`.
+     * 
+ * + * string visit_label = 8; + * + * @return The visitLabel. + */ + @java.lang.Override + public java.lang.String getVisitLabel() { + java.lang.Object ref = visitLabel_; + 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(); + visitLabel_ = s; + return s; + } + } + /** + * + * + *
+     * Copy of the corresponding
+     * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+     * if specified in the `VisitRequest`.
+     * 
+ * + * string visit_label = 8; + * + * @return The bytes for visitLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVisitLabelBytes() { + java.lang.Object ref = visitLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (shipmentIndex_ != 0) { + output.writeInt32(1, shipmentIndex_); + } + if (isPickup_ != false) { + output.writeBool(2, isPickup_); + } + if (visitRequestIndex_ != 0) { + output.writeInt32(3, visitRequestIndex_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getDetour()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shipmentLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, shipmentLabel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, visitLabel_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLoadDemands(), LoadDemandsDefaultEntryHolder.defaultEntry, 11); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (shipmentIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, shipmentIndex_); + } + if (isPickup_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isPickup_); + } + if (visitRequestIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, visitRequestIndex_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDetour()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(shipmentLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, shipmentLabel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, visitLabel_); + } + for (java.util.Map.Entry + entry : internalGetLoadDemands().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands__ = + LoadDemandsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, loadDemands__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.Visit)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit other = + (com.google.maps.routeoptimization.v1.ShipmentRoute.Visit) obj; + + if (getShipmentIndex() != other.getShipmentIndex()) return false; + if (getIsPickup() != other.getIsPickup()) return false; + if (getVisitRequestIndex() != other.getVisitRequestIndex()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (!internalGetLoadDemands().equals(other.internalGetLoadDemands())) return false; + if (hasDetour() != other.hasDetour()) return false; + if (hasDetour()) { + if (!getDetour().equals(other.getDetour())) return false; + } + if (!getShipmentLabel().equals(other.getShipmentLabel())) return false; + if (!getVisitLabel().equals(other.getVisitLabel())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SHIPMENT_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getShipmentIndex(); + hash = (37 * hash) + IS_PICKUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsPickup()); + hash = (37 * hash) + VISIT_REQUEST_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getVisitRequestIndex(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (!internalGetLoadDemands().getMap().isEmpty()) { + hash = (37 * hash) + LOAD_DEMANDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLoadDemands().hashCode(); + } + if (hasDetour()) { + hash = (37 * hash) + DETOUR_FIELD_NUMBER; + hash = (53 * hash) + getDetour().hashCode(); + } + hash = (37 * hash) + SHIPMENT_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getShipmentLabel().hashCode(); + hash = (37 * hash) + VISIT_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getVisitLabel().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit 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.ShipmentRoute.Visit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit 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.ShipmentRoute.Visit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit 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.ShipmentRoute.Visit parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit 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.ShipmentRoute.Visit parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit 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.ShipmentRoute.Visit 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.ShipmentRoute.Visit 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.ShipmentRoute.Visit 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 visit performed during a route. This visit corresponds to a pickup or a
+     * delivery of a `Shipment`.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.Visit} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentRoute.Visit) + com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetMutableLoadDemands(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Visit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getDetourFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + shipmentIndex_ = 0; + isPickup_ = false; + visitRequestIndex_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + internalGetMutableLoadDemands().clear(); + detour_ = null; + if (detourBuilder_ != null) { + detourBuilder_.dispose(); + detourBuilder_ = null; + } + shipmentLabel_ = ""; + visitLabel_ = ""; + 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_ShipmentRoute_Visit_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit build() { + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit result = + new com.google.maps.routeoptimization.v1.ShipmentRoute.Visit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.ShipmentRoute.Visit result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.shipmentIndex_ = shipmentIndex_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.isPickup_ = isPickup_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.visitRequestIndex_ = visitRequestIndex_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.loadDemands_ = + internalGetLoadDemands().build(LoadDemandsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.detour_ = detourBuilder_ == null ? detour_ : detourBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.shipmentLabel_ = shipmentLabel_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.visitLabel_ = visitLabel_; + } + 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.ShipmentRoute.Visit) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentRoute.Visit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.ShipmentRoute.Visit other) { + if (other == com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.getDefaultInstance()) + return this; + if (other.getShipmentIndex() != 0) { + setShipmentIndex(other.getShipmentIndex()); + } + if (other.getIsPickup() != false) { + setIsPickup(other.getIsPickup()); + } + if (other.getVisitRequestIndex() != 0) { + setVisitRequestIndex(other.getVisitRequestIndex()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + internalGetMutableLoadDemands().mergeFrom(other.internalGetLoadDemands()); + bitField0_ |= 0x00000010; + if (other.hasDetour()) { + mergeDetour(other.getDetour()); + } + if (!other.getShipmentLabel().isEmpty()) { + shipmentLabel_ = other.shipmentLabel_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getVisitLabel().isEmpty()) { + visitLabel_ = other.visitLabel_; + bitField0_ |= 0x00000080; + 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 8: + { + shipmentIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + isPickup_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + visitRequestIndex_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 50: + { + input.readMessage(getDetourFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + shipmentLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + visitLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 90: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + loadDemands__ = + input.readMessage( + LoadDemandsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLoadDemands() + .ensureBuilderMap() + .put(loadDemands__.getKey(), loadDemands__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 90 + 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 shipmentIndex_; + /** + * + * + *
+       * Index of the `shipments` field in the source
+       * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel].
+       * 
+ * + * int32 shipment_index = 1; + * + * @return The shipmentIndex. + */ + @java.lang.Override + public int getShipmentIndex() { + return shipmentIndex_; + } + /** + * + * + *
+       * Index of the `shipments` field in the source
+       * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel].
+       * 
+ * + * int32 shipment_index = 1; + * + * @param value The shipmentIndex to set. + * @return This builder for chaining. + */ + public Builder setShipmentIndex(int value) { + + shipmentIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Index of the `shipments` field in the source
+       * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel].
+       * 
+ * + * int32 shipment_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearShipmentIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + shipmentIndex_ = 0; + onChanged(); + return this; + } + + private boolean isPickup_; + /** + * + * + *
+       * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
+       * corresponds to a delivery.
+       * 
+ * + * bool is_pickup = 2; + * + * @return The isPickup. + */ + @java.lang.Override + public boolean getIsPickup() { + return isPickup_; + } + /** + * + * + *
+       * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
+       * corresponds to a delivery.
+       * 
+ * + * bool is_pickup = 2; + * + * @param value The isPickup to set. + * @return This builder for chaining. + */ + public Builder setIsPickup(boolean value) { + + isPickup_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
+       * corresponds to a delivery.
+       * 
+ * + * bool is_pickup = 2; + * + * @return This builder for chaining. + */ + public Builder clearIsPickup() { + bitField0_ = (bitField0_ & ~0x00000002); + isPickup_ = false; + onChanged(); + return this; + } + + private int visitRequestIndex_; + /** + * + * + *
+       * Index of `VisitRequest` in either the pickup or delivery field of the
+       * `Shipment` (see `is_pickup`).
+       * 
+ * + * int32 visit_request_index = 3; + * + * @return The visitRequestIndex. + */ + @java.lang.Override + public int getVisitRequestIndex() { + return visitRequestIndex_; + } + /** + * + * + *
+       * Index of `VisitRequest` in either the pickup or delivery field of the
+       * `Shipment` (see `is_pickup`).
+       * 
+ * + * int32 visit_request_index = 3; + * + * @param value The visitRequestIndex to set. + * @return This builder for chaining. + */ + public Builder setVisitRequestIndex(int value) { + + visitRequestIndex_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Index of `VisitRequest` in either the pickup or delivery field of the
+       * `Shipment` (see `is_pickup`).
+       * 
+ * + * int32 visit_request_index = 3; + * + * @return This builder for chaining. + */ + public Builder clearVisitRequestIndex() { + bitField0_ = (bitField0_ & ~0x00000004); + visitRequestIndex_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000008); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + /** + * + * + *
+       * Time at which the visit starts. Note that the vehicle may arrive earlier
+       * than this at the visit location. Times are consistent with the
+       * `ShipmentModel`.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private static final class LoadDemandsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load> { + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load build( + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder val) { + if (val instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + return (com.google.maps.routeoptimization.v1.Shipment.Load) val; + } + return ((com.google.maps.routeoptimization.v1.Shipment.Load.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + defaultEntry() { + return LoadDemandsDefaultEntryHolder.defaultEntry; + } + }; + + private static final LoadDemandsConverter loadDemandsConverter = new LoadDemandsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + loadDemands_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + internalGetLoadDemands() { + if (loadDemands_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter); + } + return loadDemands_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder, + com.google.maps.routeoptimization.v1.Shipment.Load, + com.google.maps.routeoptimization.v1.Shipment.Load.Builder> + internalGetMutableLoadDemands() { + if (loadDemands_ == null) { + loadDemands_ = new com.google.protobuf.MapFieldBuilder<>(loadDemandsConverter); + } + bitField0_ |= 0x00000010; + onChanged(); + return loadDemands_; + } + + public int getLoadDemandsCount() { + return internalGetLoadDemands().ensureBuilderMap().size(); + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public boolean containsLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadDemands().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getLoadDemandsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadDemands() { + return getLoadDemandsMap(); + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public java.util.Map + getLoadDemandsMap() { + return internalGetLoadDemands().getImmutableMap(); + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Shipment.Load + getLoadDemandsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Shipment.Load defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableLoadDemands().ensureBuilderMap(); + return map.containsKey(key) ? loadDemandsConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Shipment.Load getLoadDemandsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableLoadDemands().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return loadDemandsConverter.build(map.get(key)); + } + + public Builder clearLoadDemands() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableLoadDemands().clear(); + return this; + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + public Builder removeLoadDemands(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLoadDemands().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableLoadDemands() { + bitField0_ |= 0x00000010; + return internalGetMutableLoadDemands().ensureMessageMap(); + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + public Builder putLoadDemands( + java.lang.String key, com.google.maps.routeoptimization.v1.Shipment.Load value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLoadDemands().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + public Builder putAllLoadDemands( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.Shipment.Load> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableLoadDemands().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+       * Total visit load demand as the sum of the shipment and the visit request
+       * `load_demands`. The values are negative if the visit is a delivery.
+       * Demands are reported for the same types as the
+       * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition]
+       * (see this field).
+       * 
+ * + * map<string, .google.maps.routeoptimization.v1.Shipment.Load> load_demands = 11; + * + */ + public com.google.maps.routeoptimization.v1.Shipment.Load.Builder + putLoadDemandsBuilderIfAbsent(java.lang.String key) { + java.util.Map + builderMap = internalGetMutableLoadDemands().ensureBuilderMap(); + com.google.maps.routeoptimization.v1.Shipment.LoadOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.maps.routeoptimization.v1.Shipment.Load.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.maps.routeoptimization.v1.Shipment.Load) { + entry = ((com.google.maps.routeoptimization.v1.Shipment.Load) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.maps.routeoptimization.v1.Shipment.Load.Builder) entry; + } + + private com.google.protobuf.Duration detour_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + detourBuilder_; + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + * + * @return Whether the detour field is set. + */ + public boolean hasDetour() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + * + * @return The detour. + */ + public com.google.protobuf.Duration getDetour() { + if (detourBuilder_ == null) { + return detour_ == null ? com.google.protobuf.Duration.getDefaultInstance() : detour_; + } else { + return detourBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + public Builder setDetour(com.google.protobuf.Duration value) { + if (detourBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + detour_ = value; + } else { + detourBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + public Builder setDetour(com.google.protobuf.Duration.Builder builderForValue) { + if (detourBuilder_ == null) { + detour_ = builderForValue.build(); + } else { + detourBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + public Builder mergeDetour(com.google.protobuf.Duration value) { + if (detourBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && detour_ != null + && detour_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDetourBuilder().mergeFrom(value); + } else { + detour_ = value; + } + } else { + detourBuilder_.mergeFrom(value); + } + if (detour_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + public Builder clearDetour() { + bitField0_ = (bitField0_ & ~0x00000020); + detour_ = null; + if (detourBuilder_ != null) { + detourBuilder_.dispose(); + detourBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + public com.google.protobuf.Duration.Builder getDetourBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDetourFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + public com.google.protobuf.DurationOrBuilder getDetourOrBuilder() { + if (detourBuilder_ != null) { + return detourBuilder_.getMessageOrBuilder(); + } else { + return detour_ == null ? com.google.protobuf.Duration.getDefaultInstance() : detour_; + } + } + /** + * + * + *
+       * Extra detour time due to the shipments visited on the route before the
+       * visit and to the potential waiting time induced by time windows.
+       * If the visit is a delivery, the detour is computed from the corresponding
+       * pickup visit and is equal to:
+       * ```
+       * start_time(delivery) - start_time(pickup)
+       * - (duration(pickup) + travel duration from the pickup location
+       * to the delivery location).
+       * ```
+       * Otherwise, it is computed from the vehicle `start_location` and is equal
+       * to:
+       * ```
+       * start_time - vehicle_start_time - travel duration from
+       * the vehicle's `start_location` to the visit.
+       * ```
+       * 
+ * + * .google.protobuf.Duration detour = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDetourFieldBuilder() { + if (detourBuilder_ == null) { + detourBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDetour(), getParentForChildren(), isClean()); + detour_ = null; + } + return detourBuilder_; + } + + private java.lang.Object shipmentLabel_ = ""; + /** + * + * + *
+       * Copy of the corresponding `Shipment.label`, if specified in the
+       * `Shipment`.
+       * 
+ * + * string shipment_label = 7; + * + * @return The shipmentLabel. + */ + public java.lang.String getShipmentLabel() { + java.lang.Object ref = shipmentLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shipmentLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Copy of the corresponding `Shipment.label`, if specified in the
+       * `Shipment`.
+       * 
+ * + * string shipment_label = 7; + * + * @return The bytes for shipmentLabel. + */ + public com.google.protobuf.ByteString getShipmentLabelBytes() { + java.lang.Object ref = shipmentLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shipmentLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Copy of the corresponding `Shipment.label`, if specified in the
+       * `Shipment`.
+       * 
+ * + * string shipment_label = 7; + * + * @param value The shipmentLabel to set. + * @return This builder for chaining. + */ + public Builder setShipmentLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + shipmentLabel_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Copy of the corresponding `Shipment.label`, if specified in the
+       * `Shipment`.
+       * 
+ * + * string shipment_label = 7; + * + * @return This builder for chaining. + */ + public Builder clearShipmentLabel() { + shipmentLabel_ = getDefaultInstance().getShipmentLabel(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+       * Copy of the corresponding `Shipment.label`, if specified in the
+       * `Shipment`.
+       * 
+ * + * string shipment_label = 7; + * + * @param value The bytes for shipmentLabel to set. + * @return This builder for chaining. + */ + public Builder setShipmentLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + shipmentLabel_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object visitLabel_ = ""; + /** + * + * + *
+       * Copy of the corresponding
+       * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+       * if specified in the `VisitRequest`.
+       * 
+ * + * string visit_label = 8; + * + * @return The visitLabel. + */ + public java.lang.String getVisitLabel() { + java.lang.Object ref = visitLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visitLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Copy of the corresponding
+       * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+       * if specified in the `VisitRequest`.
+       * 
+ * + * string visit_label = 8; + * + * @return The bytes for visitLabel. + */ + public com.google.protobuf.ByteString getVisitLabelBytes() { + java.lang.Object ref = visitLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + visitLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Copy of the corresponding
+       * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+       * if specified in the `VisitRequest`.
+       * 
+ * + * string visit_label = 8; + * + * @param value The visitLabel to set. + * @return This builder for chaining. + */ + public Builder setVisitLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + visitLabel_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * Copy of the corresponding
+       * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+       * if specified in the `VisitRequest`.
+       * 
+ * + * string visit_label = 8; + * + * @return This builder for chaining. + */ + public Builder clearVisitLabel() { + visitLabel_ = getDefaultInstance().getVisitLabel(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+       * Copy of the corresponding
+       * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label],
+       * if specified in the `VisitRequest`.
+       * 
+ * + * string visit_label = 8; + * + * @param value The bytes for visitLabel to set. + * @return This builder for chaining. + */ + public Builder setVisitLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + visitLabel_ = value; + bitField0_ |= 0x00000080; + 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.ShipmentRoute.Visit) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentRoute.Visit) + private static final com.google.maps.routeoptimization.v1.ShipmentRoute.Visit DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentRoute.Visit(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Visit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Visit 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.ShipmentRoute.Visit getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TransitionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentRoute.Transition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Travel duration during this transition.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 1; + * + * @return Whether the travelDuration field is set. + */ + boolean hasTravelDuration(); + /** + * + * + *
+     * Travel duration during this transition.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 1; + * + * @return The travelDuration. + */ + com.google.protobuf.Duration getTravelDuration(); + /** + * + * + *
+     * Travel duration during this transition.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + com.google.protobuf.DurationOrBuilder getTravelDurationOrBuilder(); + + /** + * + * + *
+     * Distance traveled during the transition.
+     * 
+ * + * double travel_distance_meters = 2; + * + * @return The travelDistanceMeters. + */ + double getTravelDistanceMeters(); + + /** + * + * + *
+     * When traffic is requested via
+     * [OptimizeToursRequest.consider_road_traffic]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+     * and the traffic info couldn't be retrieved for a `Transition`, this
+     * boolean is set to true. This may be temporary (rare hiccup in the
+     * realtime traffic servers) or permanent (no data for this location).
+     * 
+ * + * bool traffic_info_unavailable = 3; + * + * @return The trafficInfoUnavailable. + */ + boolean getTrafficInfoUnavailable(); + + /** + * + * + *
+     * Sum of the delay durations applied to this transition. If any, the delay
+     * starts exactly `delay_duration` seconds before the next event (visit or
+     * vehicle end). See
+     * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return Whether the delayDuration field is set. + */ + boolean hasDelayDuration(); + /** + * + * + *
+     * Sum of the delay durations applied to this transition. If any, the delay
+     * starts exactly `delay_duration` seconds before the next event (visit or
+     * vehicle end). See
+     * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return The delayDuration. + */ + com.google.protobuf.Duration getDelayDuration(); + /** + * + * + *
+     * Sum of the delay durations applied to this transition. If any, the delay
+     * starts exactly `delay_duration` seconds before the next event (visit or
+     * vehicle end). See
+     * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getDelayDurationOrBuilder(); + + /** + * + * + *
+     * Sum of the duration of the breaks occurring during this transition, if
+     * any. Details about each break's start time and duration are stored in
+     * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return Whether the breakDuration field is set. + */ + boolean hasBreakDuration(); + /** + * + * + *
+     * Sum of the duration of the breaks occurring during this transition, if
+     * any. Details about each break's start time and duration are stored in
+     * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return The breakDuration. + */ + com.google.protobuf.Duration getBreakDuration(); + /** + * + * + *
+     * Sum of the duration of the breaks occurring during this transition, if
+     * any. Details about each break's start time and duration are stored in
+     * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getBreakDurationOrBuilder(); + + /** + * + * + *
+     * Time spent waiting during this transition. Wait duration corresponds to
+     * idle time and does not include break time. Also note that this wait time
+     * may be split into several non-contiguous intervals.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 6; + * + * @return Whether the waitDuration field is set. + */ + boolean hasWaitDuration(); + /** + * + * + *
+     * Time spent waiting during this transition. Wait duration corresponds to
+     * idle time and does not include break time. Also note that this wait time
+     * may be split into several non-contiguous intervals.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 6; + * + * @return The waitDuration. + */ + com.google.protobuf.Duration getWaitDuration(); + /** + * + * + *
+     * Time spent waiting during this transition. Wait duration corresponds to
+     * idle time and does not include break time. Also note that this wait time
+     * may be split into several non-contiguous intervals.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + com.google.protobuf.DurationOrBuilder getWaitDurationOrBuilder(); + + /** + * + * + *
+     * Total duration of the transition, provided for convenience. It is equal
+     * to:
+     *
+     * * next visit `start_time` (or `vehicle_end_time` if this is the last
+     * transition) - this transition's `start_time`;
+     * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+     * additionally holds: `total_duration = travel_duration + delay_duration
+     * + break_duration + wait_duration`.
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return Whether the totalDuration field is set. + */ + boolean hasTotalDuration(); + /** + * + * + *
+     * Total duration of the transition, provided for convenience. It is equal
+     * to:
+     *
+     * * next visit `start_time` (or `vehicle_end_time` if this is the last
+     * transition) - this transition's `start_time`;
+     * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+     * additionally holds: `total_duration = travel_duration + delay_duration
+     * + break_duration + wait_duration`.
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return The totalDuration. + */ + com.google.protobuf.Duration getTotalDuration(); + /** + * + * + *
+     * Total duration of the transition, provided for convenience. It is equal
+     * to:
+     *
+     * * next visit `start_time` (or `vehicle_end_time` if this is the last
+     * transition) - this transition's `start_time`;
+     * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+     * additionally holds: `total_duration = travel_duration + delay_duration
+     * + break_duration + wait_duration`.
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + com.google.protobuf.DurationOrBuilder getTotalDurationOrBuilder(); + + /** + * + * + *
+     * Start time of this transition.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 8; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+     * Start time of this transition.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 8; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+     * Start time of this transition.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+     * The encoded polyline representation of the route followed during the
+     * transition.
+     * This field is only populated if [populate_transition_polylines]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + * + * @return Whether the routePolyline field is set. + */ + boolean hasRoutePolyline(); + /** + * + * + *
+     * The encoded polyline representation of the route followed during the
+     * transition.
+     * This field is only populated if [populate_transition_polylines]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + * + * @return The routePolyline. + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline getRoutePolyline(); + /** + * + * + *
+     * The encoded polyline representation of the route followed during the
+     * transition.
+     * This field is only populated if [populate_transition_polylines]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder + getRoutePolylineOrBuilder(); + + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + int getVehicleLoadsCount(); + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + boolean containsVehicleLoads(java.lang.String key); + /** Use {@link #getVehicleLoadsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getVehicleLoads(); + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + java.util.Map + getVehicleLoadsMap(); + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getVehicleLoadsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad defaultValue); + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getVehicleLoadsOrThrow( + java.lang.String key); + } + /** + * + * + *
+   * Transition between two events on the route. See the description of
+   * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+   *
+   * If the vehicle does not have a `start_location` and/or `end_location`, the
+   * corresponding travel metrics are 0.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.Transition} + */ + public static final class Transition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentRoute.Transition) + TransitionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Transition.newBuilder() to construct. + private Transition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Transition() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Transition(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetVehicleLoads(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder.class); + } + + private int bitField0_; + public static final int TRAVEL_DURATION_FIELD_NUMBER = 1; + private com.google.protobuf.Duration travelDuration_; + /** + * + * + *
+     * Travel duration during this transition.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 1; + * + * @return Whether the travelDuration field is set. + */ + @java.lang.Override + public boolean hasTravelDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Travel duration during this transition.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 1; + * + * @return The travelDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getTravelDuration() { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } + /** + * + * + *
+     * Travel duration during this transition.
+     * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTravelDurationOrBuilder() { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } + + public static final int TRAVEL_DISTANCE_METERS_FIELD_NUMBER = 2; + private double travelDistanceMeters_ = 0D; + /** + * + * + *
+     * Distance traveled during the transition.
+     * 
+ * + * double travel_distance_meters = 2; + * + * @return The travelDistanceMeters. + */ + @java.lang.Override + public double getTravelDistanceMeters() { + return travelDistanceMeters_; + } + + public static final int TRAFFIC_INFO_UNAVAILABLE_FIELD_NUMBER = 3; + private boolean trafficInfoUnavailable_ = false; + /** + * + * + *
+     * When traffic is requested via
+     * [OptimizeToursRequest.consider_road_traffic]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+     * and the traffic info couldn't be retrieved for a `Transition`, this
+     * boolean is set to true. This may be temporary (rare hiccup in the
+     * realtime traffic servers) or permanent (no data for this location).
+     * 
+ * + * bool traffic_info_unavailable = 3; + * + * @return The trafficInfoUnavailable. + */ + @java.lang.Override + public boolean getTrafficInfoUnavailable() { + return trafficInfoUnavailable_; + } + + public static final int DELAY_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration delayDuration_; + /** + * + * + *
+     * Sum of the delay durations applied to this transition. If any, the delay
+     * starts exactly `delay_duration` seconds before the next event (visit or
+     * vehicle end). See
+     * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return Whether the delayDuration field is set. + */ + @java.lang.Override + public boolean hasDelayDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Sum of the delay durations applied to this transition. If any, the delay
+     * starts exactly `delay_duration` seconds before the next event (visit or
+     * vehicle end). See
+     * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return The delayDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelayDuration() { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } + /** + * + * + *
+     * Sum of the delay durations applied to this transition. If any, the delay
+     * starts exactly `delay_duration` seconds before the next event (visit or
+     * vehicle end). See
+     * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+     * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayDurationOrBuilder() { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } + + public static final int BREAK_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration breakDuration_; + /** + * + * + *
+     * Sum of the duration of the breaks occurring during this transition, if
+     * any. Details about each break's start time and duration are stored in
+     * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return Whether the breakDuration field is set. + */ + @java.lang.Override + public boolean hasBreakDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Sum of the duration of the breaks occurring during this transition, if
+     * any. Details about each break's start time and duration are stored in
+     * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return The breakDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getBreakDuration() { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } + /** + * + * + *
+     * Sum of the duration of the breaks occurring during this transition, if
+     * any. Details about each break's start time and duration are stored in
+     * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+     * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBreakDurationOrBuilder() { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } + + public static final int WAIT_DURATION_FIELD_NUMBER = 6; + private com.google.protobuf.Duration waitDuration_; + /** + * + * + *
+     * Time spent waiting during this transition. Wait duration corresponds to
+     * idle time and does not include break time. Also note that this wait time
+     * may be split into several non-contiguous intervals.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 6; + * + * @return Whether the waitDuration field is set. + */ + @java.lang.Override + public boolean hasWaitDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Time spent waiting during this transition. Wait duration corresponds to
+     * idle time and does not include break time. Also note that this wait time
+     * may be split into several non-contiguous intervals.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 6; + * + * @return The waitDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getWaitDuration() { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } + /** + * + * + *
+     * Time spent waiting during this transition. Wait duration corresponds to
+     * idle time and does not include break time. Also note that this wait time
+     * may be split into several non-contiguous intervals.
+     * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getWaitDurationOrBuilder() { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } + + public static final int TOTAL_DURATION_FIELD_NUMBER = 7; + private com.google.protobuf.Duration totalDuration_; + /** + * + * + *
+     * Total duration of the transition, provided for convenience. It is equal
+     * to:
+     *
+     * * next visit `start_time` (or `vehicle_end_time` if this is the last
+     * transition) - this transition's `start_time`;
+     * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+     * additionally holds: `total_duration = travel_duration + delay_duration
+     * + break_duration + wait_duration`.
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return Whether the totalDuration field is set. + */ + @java.lang.Override + public boolean hasTotalDuration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Total duration of the transition, provided for convenience. It is equal
+     * to:
+     *
+     * * next visit `start_time` (or `vehicle_end_time` if this is the last
+     * transition) - this transition's `start_time`;
+     * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+     * additionally holds: `total_duration = travel_duration + delay_duration
+     * + break_duration + wait_duration`.
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return The totalDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalDuration() { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } + /** + * + * + *
+     * Total duration of the transition, provided for convenience. It is equal
+     * to:
+     *
+     * * next visit `start_time` (or `vehicle_end_time` if this is the last
+     * transition) - this transition's `start_time`;
+     * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+     * additionally holds: `total_duration = travel_duration + delay_duration
+     * + break_duration + wait_duration`.
+     * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalDurationOrBuilder() { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } + + public static final int START_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+     * Start time of this transition.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 8; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Start time of this transition.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 8; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+     * Start time of this transition.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int ROUTE_POLYLINE_FIELD_NUMBER = 9; + private com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline routePolyline_; + /** + * + * + *
+     * The encoded polyline representation of the route followed during the
+     * transition.
+     * This field is only populated if [populate_transition_polylines]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + * + * @return Whether the routePolyline field is set. + */ + @java.lang.Override + public boolean hasRoutePolyline() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The encoded polyline representation of the route followed during the
+     * transition.
+     * This field is only populated if [populate_transition_polylines]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + * + * @return The routePolyline. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline getRoutePolyline() { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.getDefaultInstance() + : routePolyline_; + } + /** + * + * + *
+     * The encoded polyline representation of the route followed during the
+     * transition.
+     * This field is only populated if [populate_transition_polylines]
+     * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder + getRoutePolylineOrBuilder() { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.getDefaultInstance() + : routePolyline_; + } + + public static final int VEHICLE_LOADS_FIELD_NUMBER = 11; + + private static final class VehicleLoadsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_VehicleLoadsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + vehicleLoads_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + internalGetVehicleLoads() { + if (vehicleLoads_ == null) { + return com.google.protobuf.MapField.emptyMapField( + VehicleLoadsDefaultEntryHolder.defaultEntry); + } + return vehicleLoads_; + } + + public int getVehicleLoadsCount() { + return internalGetVehicleLoads().getMap().size(); + } + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public boolean containsVehicleLoads(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVehicleLoads().getMap().containsKey(key); + } + /** Use {@link #getVehicleLoadsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getVehicleLoads() { + return getVehicleLoadsMap(); + } + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getVehicleLoadsMap() { + return internalGetVehicleLoads().getMap(); + } + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + getVehicleLoadsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + map = internalGetVehicleLoads().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Vehicle loads during this transition, for each type that either appears
+     * in this vehicle's
+     * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+     * or that have non-zero
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * on some shipment performed on this route.
+     *
+     * The loads during the first transition are the starting loads of the
+     * vehicle route. Then, after each visit, the visit's `load_demands` are
+     * either added or subtracted to get the next transition's loads, depending
+     * on whether the visit was a pickup or a delivery.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getVehicleLoadsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + map = internalGetVehicleLoads().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTravelDuration()); + } + if (java.lang.Double.doubleToRawLongBits(travelDistanceMeters_) != 0) { + output.writeDouble(2, travelDistanceMeters_); + } + if (trafficInfoUnavailable_ != false) { + output.writeBool(3, trafficInfoUnavailable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getDelayDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getBreakDuration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getWaitDuration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getTotalDuration()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(8, getStartTime()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(9, getRoutePolyline()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetVehicleLoads(), VehicleLoadsDefaultEntryHolder.defaultEntry, 11); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTravelDuration()); + } + if (java.lang.Double.doubleToRawLongBits(travelDistanceMeters_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, travelDistanceMeters_); + } + if (trafficInfoUnavailable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, trafficInfoUnavailable_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDelayDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getBreakDuration()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getWaitDuration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTotalDuration()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getStartTime()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getRoutePolyline()); + } + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + entry : internalGetVehicleLoads().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + vehicleLoads__ = + VehicleLoadsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, vehicleLoads__); + } + 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.ShipmentRoute.Transition)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition other = + (com.google.maps.routeoptimization.v1.ShipmentRoute.Transition) obj; + + if (hasTravelDuration() != other.hasTravelDuration()) return false; + if (hasTravelDuration()) { + if (!getTravelDuration().equals(other.getTravelDuration())) return false; + } + if (java.lang.Double.doubleToLongBits(getTravelDistanceMeters()) + != java.lang.Double.doubleToLongBits(other.getTravelDistanceMeters())) return false; + if (getTrafficInfoUnavailable() != other.getTrafficInfoUnavailable()) return false; + if (hasDelayDuration() != other.hasDelayDuration()) return false; + if (hasDelayDuration()) { + if (!getDelayDuration().equals(other.getDelayDuration())) return false; + } + if (hasBreakDuration() != other.hasBreakDuration()) return false; + if (hasBreakDuration()) { + if (!getBreakDuration().equals(other.getBreakDuration())) return false; + } + if (hasWaitDuration() != other.hasWaitDuration()) return false; + if (hasWaitDuration()) { + if (!getWaitDuration().equals(other.getWaitDuration())) return false; + } + if (hasTotalDuration() != other.hasTotalDuration()) return false; + if (hasTotalDuration()) { + if (!getTotalDuration().equals(other.getTotalDuration())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasRoutePolyline() != other.hasRoutePolyline()) return false; + if (hasRoutePolyline()) { + if (!getRoutePolyline().equals(other.getRoutePolyline())) return false; + } + if (!internalGetVehicleLoads().equals(other.internalGetVehicleLoads())) 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 (hasTravelDuration()) { + hash = (37 * hash) + TRAVEL_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getTravelDuration().hashCode(); + } + hash = (37 * hash) + TRAVEL_DISTANCE_METERS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getTravelDistanceMeters())); + hash = (37 * hash) + TRAFFIC_INFO_UNAVAILABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTrafficInfoUnavailable()); + if (hasDelayDuration()) { + hash = (37 * hash) + DELAY_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDelayDuration().hashCode(); + } + if (hasBreakDuration()) { + hash = (37 * hash) + BREAK_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getBreakDuration().hashCode(); + } + if (hasWaitDuration()) { + hash = (37 * hash) + WAIT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getWaitDuration().hashCode(); + } + if (hasTotalDuration()) { + hash = (37 * hash) + TOTAL_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getTotalDuration().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasRoutePolyline()) { + hash = (37 * hash) + ROUTE_POLYLINE_FIELD_NUMBER; + hash = (53 * hash) + getRoutePolyline().hashCode(); + } + if (!internalGetVehicleLoads().getMap().isEmpty()) { + hash = (37 * hash) + VEHICLE_LOADS_FIELD_NUMBER; + hash = (53 * hash) + internalGetVehicleLoads().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition 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.ShipmentRoute.Transition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition 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.ShipmentRoute.Transition parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition 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.ShipmentRoute.Transition parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition 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.ShipmentRoute.Transition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition 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.ShipmentRoute.Transition 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.ShipmentRoute.Transition 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.ShipmentRoute.Transition 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; + } + /** + * + * + *
+     * Transition between two events on the route. See the description of
+     * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+     *
+     * If the vehicle does not have a `start_location` and/or `end_location`, the
+     * corresponding travel metrics are 0.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.Transition} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentRoute.Transition) + com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetVehicleLoads(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetMutableVehicleLoads(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Transition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTravelDurationFieldBuilder(); + getDelayDurationFieldBuilder(); + getBreakDurationFieldBuilder(); + getWaitDurationFieldBuilder(); + getTotalDurationFieldBuilder(); + getStartTimeFieldBuilder(); + getRoutePolylineFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + travelDuration_ = null; + if (travelDurationBuilder_ != null) { + travelDurationBuilder_.dispose(); + travelDurationBuilder_ = null; + } + travelDistanceMeters_ = 0D; + trafficInfoUnavailable_ = false; + delayDuration_ = null; + if (delayDurationBuilder_ != null) { + delayDurationBuilder_.dispose(); + delayDurationBuilder_ = null; + } + breakDuration_ = null; + if (breakDurationBuilder_ != null) { + breakDurationBuilder_.dispose(); + breakDurationBuilder_ = null; + } + waitDuration_ = null; + if (waitDurationBuilder_ != null) { + waitDurationBuilder_.dispose(); + waitDurationBuilder_ = null; + } + totalDuration_ = null; + if (totalDurationBuilder_ != null) { + totalDurationBuilder_.dispose(); + totalDurationBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + routePolyline_ = null; + if (routePolylineBuilder_ != null) { + routePolylineBuilder_.dispose(); + routePolylineBuilder_ = null; + } + internalGetMutableVehicleLoads().clear(); + 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_ShipmentRoute_Transition_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition build() { + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition result = + new com.google.maps.routeoptimization.v1.ShipmentRoute.Transition(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.travelDuration_ = + travelDurationBuilder_ == null ? travelDuration_ : travelDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.travelDistanceMeters_ = travelDistanceMeters_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trafficInfoUnavailable_ = trafficInfoUnavailable_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.delayDuration_ = + delayDurationBuilder_ == null ? delayDuration_ : delayDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.breakDuration_ = + breakDurationBuilder_ == null ? breakDuration_ : breakDurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.waitDuration_ = + waitDurationBuilder_ == null ? waitDuration_ : waitDurationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.totalDuration_ = + totalDurationBuilder_ == null ? totalDuration_ : totalDurationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.routePolyline_ = + routePolylineBuilder_ == null ? routePolyline_ : routePolylineBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.vehicleLoads_ = + internalGetVehicleLoads().build(VehicleLoadsDefaultEntryHolder.defaultEntry); + } + 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.ShipmentRoute.Transition) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentRoute.Transition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition other) { + if (other + == com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.getDefaultInstance()) + return this; + if (other.hasTravelDuration()) { + mergeTravelDuration(other.getTravelDuration()); + } + if (other.getTravelDistanceMeters() != 0D) { + setTravelDistanceMeters(other.getTravelDistanceMeters()); + } + if (other.getTrafficInfoUnavailable() != false) { + setTrafficInfoUnavailable(other.getTrafficInfoUnavailable()); + } + if (other.hasDelayDuration()) { + mergeDelayDuration(other.getDelayDuration()); + } + if (other.hasBreakDuration()) { + mergeBreakDuration(other.getBreakDuration()); + } + if (other.hasWaitDuration()) { + mergeWaitDuration(other.getWaitDuration()); + } + if (other.hasTotalDuration()) { + mergeTotalDuration(other.getTotalDuration()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasRoutePolyline()) { + mergeRoutePolyline(other.getRoutePolyline()); + } + internalGetMutableVehicleLoads().mergeFrom(other.internalGetVehicleLoads()); + bitField0_ |= 0x00000200; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getTravelDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: + { + travelDistanceMeters_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 24: + { + trafficInfoUnavailable_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(getDelayDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getBreakDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getWaitDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getTotalDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(getRoutePolylineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 90: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + vehicleLoads__ = + input.readMessage( + VehicleLoadsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableVehicleLoads() + .ensureBuilderMap() + .put(vehicleLoads__.getKey(), vehicleLoads__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration travelDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + travelDurationBuilder_; + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + * + * @return Whether the travelDuration field is set. + */ + public boolean hasTravelDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + * + * @return The travelDuration. + */ + public com.google.protobuf.Duration getTravelDuration() { + if (travelDurationBuilder_ == null) { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } else { + return travelDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + public Builder setTravelDuration(com.google.protobuf.Duration value) { + if (travelDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelDuration_ = value; + } else { + travelDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + public Builder setTravelDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (travelDurationBuilder_ == null) { + travelDuration_ = builderForValue.build(); + } else { + travelDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + public Builder mergeTravelDuration(com.google.protobuf.Duration value) { + if (travelDurationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && travelDuration_ != null + && travelDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTravelDurationBuilder().mergeFrom(value); + } else { + travelDuration_ = value; + } + } else { + travelDurationBuilder_.mergeFrom(value); + } + if (travelDuration_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + public Builder clearTravelDuration() { + bitField0_ = (bitField0_ & ~0x00000001); + travelDuration_ = null; + if (travelDurationBuilder_ != null) { + travelDurationBuilder_.dispose(); + travelDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + public com.google.protobuf.Duration.Builder getTravelDurationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTravelDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + public com.google.protobuf.DurationOrBuilder getTravelDurationOrBuilder() { + if (travelDurationBuilder_ != null) { + return travelDurationBuilder_.getMessageOrBuilder(); + } else { + return travelDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : travelDuration_; + } + } + /** + * + * + *
+       * Travel duration during this transition.
+       * 
+ * + * .google.protobuf.Duration travel_duration = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTravelDurationFieldBuilder() { + if (travelDurationBuilder_ == null) { + travelDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTravelDuration(), getParentForChildren(), isClean()); + travelDuration_ = null; + } + return travelDurationBuilder_; + } + + private double travelDistanceMeters_; + /** + * + * + *
+       * Distance traveled during the transition.
+       * 
+ * + * double travel_distance_meters = 2; + * + * @return The travelDistanceMeters. + */ + @java.lang.Override + public double getTravelDistanceMeters() { + return travelDistanceMeters_; + } + /** + * + * + *
+       * Distance traveled during the transition.
+       * 
+ * + * double travel_distance_meters = 2; + * + * @param value The travelDistanceMeters to set. + * @return This builder for chaining. + */ + public Builder setTravelDistanceMeters(double value) { + + travelDistanceMeters_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Distance traveled during the transition.
+       * 
+ * + * double travel_distance_meters = 2; + * + * @return This builder for chaining. + */ + public Builder clearTravelDistanceMeters() { + bitField0_ = (bitField0_ & ~0x00000002); + travelDistanceMeters_ = 0D; + onChanged(); + return this; + } + + private boolean trafficInfoUnavailable_; + /** + * + * + *
+       * When traffic is requested via
+       * [OptimizeToursRequest.consider_road_traffic]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+       * and the traffic info couldn't be retrieved for a `Transition`, this
+       * boolean is set to true. This may be temporary (rare hiccup in the
+       * realtime traffic servers) or permanent (no data for this location).
+       * 
+ * + * bool traffic_info_unavailable = 3; + * + * @return The trafficInfoUnavailable. + */ + @java.lang.Override + public boolean getTrafficInfoUnavailable() { + return trafficInfoUnavailable_; + } + /** + * + * + *
+       * When traffic is requested via
+       * [OptimizeToursRequest.consider_road_traffic]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+       * and the traffic info couldn't be retrieved for a `Transition`, this
+       * boolean is set to true. This may be temporary (rare hiccup in the
+       * realtime traffic servers) or permanent (no data for this location).
+       * 
+ * + * bool traffic_info_unavailable = 3; + * + * @param value The trafficInfoUnavailable to set. + * @return This builder for chaining. + */ + public Builder setTrafficInfoUnavailable(boolean value) { + + trafficInfoUnavailable_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * When traffic is requested via
+       * [OptimizeToursRequest.consider_road_traffic]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+       * and the traffic info couldn't be retrieved for a `Transition`, this
+       * boolean is set to true. This may be temporary (rare hiccup in the
+       * realtime traffic servers) or permanent (no data for this location).
+       * 
+ * + * bool traffic_info_unavailable = 3; + * + * @return This builder for chaining. + */ + public Builder clearTrafficInfoUnavailable() { + bitField0_ = (bitField0_ & ~0x00000004); + trafficInfoUnavailable_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Duration delayDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayDurationBuilder_; + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return Whether the delayDuration field is set. + */ + public boolean hasDelayDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + * + * @return The delayDuration. + */ + public com.google.protobuf.Duration getDelayDuration() { + if (delayDurationBuilder_ == null) { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } else { + return delayDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder setDelayDuration(com.google.protobuf.Duration value) { + if (delayDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delayDuration_ = value; + } else { + delayDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder setDelayDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (delayDurationBuilder_ == null) { + delayDuration_ = builderForValue.build(); + } else { + delayDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder mergeDelayDuration(com.google.protobuf.Duration value) { + if (delayDurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && delayDuration_ != null + && delayDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayDurationBuilder().mergeFrom(value); + } else { + delayDuration_ = value; + } + } else { + delayDurationBuilder_.mergeFrom(value); + } + if (delayDuration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public Builder clearDelayDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + delayDuration_ = null; + if (delayDurationBuilder_ != null) { + delayDurationBuilder_.dispose(); + delayDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public com.google.protobuf.Duration.Builder getDelayDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDelayDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getDelayDurationOrBuilder() { + if (delayDurationBuilder_ != null) { + return delayDurationBuilder_.getMessageOrBuilder(); + } else { + return delayDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : delayDuration_; + } + } + /** + * + * + *
+       * Sum of the delay durations applied to this transition. If any, the delay
+       * starts exactly `delay_duration` seconds before the next event (visit or
+       * vehicle end). See
+       * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay].
+       * 
+ * + * .google.protobuf.Duration delay_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayDurationFieldBuilder() { + if (delayDurationBuilder_ == null) { + delayDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelayDuration(), getParentForChildren(), isClean()); + delayDuration_ = null; + } + return delayDurationBuilder_; + } + + private com.google.protobuf.Duration breakDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + breakDurationBuilder_; + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return Whether the breakDuration field is set. + */ + public boolean hasBreakDuration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + * + * @return The breakDuration. + */ + public com.google.protobuf.Duration getBreakDuration() { + if (breakDurationBuilder_ == null) { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } else { + return breakDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder setBreakDuration(com.google.protobuf.Duration value) { + if (breakDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + breakDuration_ = value; + } else { + breakDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder setBreakDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (breakDurationBuilder_ == null) { + breakDuration_ = builderForValue.build(); + } else { + breakDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder mergeBreakDuration(com.google.protobuf.Duration value) { + if (breakDurationBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && breakDuration_ != null + && breakDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBreakDurationBuilder().mergeFrom(value); + } else { + breakDuration_ = value; + } + } else { + breakDurationBuilder_.mergeFrom(value); + } + if (breakDuration_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public Builder clearBreakDuration() { + bitField0_ = (bitField0_ & ~0x00000010); + breakDuration_ = null; + if (breakDurationBuilder_ != null) { + breakDurationBuilder_.dispose(); + breakDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public com.google.protobuf.Duration.Builder getBreakDurationBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBreakDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getBreakDurationOrBuilder() { + if (breakDurationBuilder_ != null) { + return breakDurationBuilder_.getMessageOrBuilder(); + } else { + return breakDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : breakDuration_; + } + } + /** + * + * + *
+       * Sum of the duration of the breaks occurring during this transition, if
+       * any. Details about each break's start time and duration are stored in
+       * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks].
+       * 
+ * + * .google.protobuf.Duration break_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getBreakDurationFieldBuilder() { + if (breakDurationBuilder_ == null) { + breakDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBreakDuration(), getParentForChildren(), isClean()); + breakDuration_ = null; + } + return breakDurationBuilder_; + } + + private com.google.protobuf.Duration waitDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + waitDurationBuilder_; + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + * + * @return Whether the waitDuration field is set. + */ + public boolean hasWaitDuration() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + * + * @return The waitDuration. + */ + public com.google.protobuf.Duration getWaitDuration() { + if (waitDurationBuilder_ == null) { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } else { + return waitDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + public Builder setWaitDuration(com.google.protobuf.Duration value) { + if (waitDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + waitDuration_ = value; + } else { + waitDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + public Builder setWaitDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (waitDurationBuilder_ == null) { + waitDuration_ = builderForValue.build(); + } else { + waitDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + public Builder mergeWaitDuration(com.google.protobuf.Duration value) { + if (waitDurationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && waitDuration_ != null + && waitDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getWaitDurationBuilder().mergeFrom(value); + } else { + waitDuration_ = value; + } + } else { + waitDurationBuilder_.mergeFrom(value); + } + if (waitDuration_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + public Builder clearWaitDuration() { + bitField0_ = (bitField0_ & ~0x00000020); + waitDuration_ = null; + if (waitDurationBuilder_ != null) { + waitDurationBuilder_.dispose(); + waitDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + public com.google.protobuf.Duration.Builder getWaitDurationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getWaitDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + public com.google.protobuf.DurationOrBuilder getWaitDurationOrBuilder() { + if (waitDurationBuilder_ != null) { + return waitDurationBuilder_.getMessageOrBuilder(); + } else { + return waitDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : waitDuration_; + } + } + /** + * + * + *
+       * Time spent waiting during this transition. Wait duration corresponds to
+       * idle time and does not include break time. Also note that this wait time
+       * may be split into several non-contiguous intervals.
+       * 
+ * + * .google.protobuf.Duration wait_duration = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getWaitDurationFieldBuilder() { + if (waitDurationBuilder_ == null) { + waitDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getWaitDuration(), getParentForChildren(), isClean()); + waitDuration_ = null; + } + return waitDurationBuilder_; + } + + private com.google.protobuf.Duration totalDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + totalDurationBuilder_; + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return Whether the totalDuration field is set. + */ + public boolean hasTotalDuration() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + * + * @return The totalDuration. + */ + public com.google.protobuf.Duration getTotalDuration() { + if (totalDurationBuilder_ == null) { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } else { + return totalDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder setTotalDuration(com.google.protobuf.Duration value) { + if (totalDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalDuration_ = value; + } else { + totalDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder setTotalDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (totalDurationBuilder_ == null) { + totalDuration_ = builderForValue.build(); + } else { + totalDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder mergeTotalDuration(com.google.protobuf.Duration value) { + if (totalDurationBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && totalDuration_ != null + && totalDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTotalDurationBuilder().mergeFrom(value); + } else { + totalDuration_ = value; + } + } else { + totalDurationBuilder_.mergeFrom(value); + } + if (totalDuration_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public Builder clearTotalDuration() { + bitField0_ = (bitField0_ & ~0x00000040); + totalDuration_ = null; + if (totalDurationBuilder_ != null) { + totalDurationBuilder_.dispose(); + totalDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public com.google.protobuf.Duration.Builder getTotalDurationBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getTotalDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + public com.google.protobuf.DurationOrBuilder getTotalDurationOrBuilder() { + if (totalDurationBuilder_ != null) { + return totalDurationBuilder_.getMessageOrBuilder(); + } else { + return totalDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalDuration_; + } + } + /** + * + * + *
+       * Total duration of the transition, provided for convenience. It is equal
+       * to:
+       *
+       * * next visit `start_time` (or `vehicle_end_time` if this is the last
+       * transition) - this transition's `start_time`;
+       * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
+       * additionally holds: `total_duration = travel_duration + delay_duration
+       * + break_duration + wait_duration`.
+       * 
+ * + * .google.protobuf.Duration total_duration = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTotalDurationFieldBuilder() { + if (totalDurationBuilder_ == null) { + totalDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTotalDuration(), getParentForChildren(), isClean()); + totalDuration_ = null; + } + return totalDurationBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000080); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + /** + * + * + *
+       * Start time of this transition.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline routePolyline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder> + routePolylineBuilder_; + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + * + * @return Whether the routePolyline field is set. + */ + public boolean hasRoutePolyline() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + * + * @return The routePolyline. + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline getRoutePolyline() { + if (routePolylineBuilder_ == null) { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance() + : routePolyline_; + } else { + return routePolylineBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + public Builder setRoutePolyline( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline value) { + if (routePolylineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routePolyline_ = value; + } else { + routePolylineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + public Builder setRoutePolyline( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder + builderForValue) { + if (routePolylineBuilder_ == null) { + routePolyline_ = builderForValue.build(); + } else { + routePolylineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + public Builder mergeRoutePolyline( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline value) { + if (routePolylineBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && routePolyline_ != null + && routePolyline_ + != com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance()) { + getRoutePolylineBuilder().mergeFrom(value); + } else { + routePolyline_ = value; + } + } else { + routePolylineBuilder_.mergeFrom(value); + } + if (routePolyline_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + public Builder clearRoutePolyline() { + bitField0_ = (bitField0_ & ~0x00000100); + routePolyline_ = null; + if (routePolylineBuilder_ != null) { + routePolylineBuilder_.dispose(); + routePolylineBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder + getRoutePolylineBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getRoutePolylineFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder + getRoutePolylineOrBuilder() { + if (routePolylineBuilder_ != null) { + return routePolylineBuilder_.getMessageOrBuilder(); + } else { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance() + : routePolyline_; + } + } + /** + * + * + *
+       * The encoded polyline representation of the route followed during the
+       * transition.
+       * This field is only populated if [populate_transition_polylines]
+       * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines]
+       * is set to true.
+       * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder> + getRoutePolylineFieldBuilder() { + if (routePolylineBuilder_ == null) { + routePolylineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder>( + getRoutePolyline(), getParentForChildren(), isClean()); + routePolyline_ = null; + } + return routePolylineBuilder_; + } + + private static final class VehicleLoadsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> { + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad build( + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder val) { + if (val instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) { + return (com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) val; + } + return ((com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder) val) + .build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + defaultEntry() { + return VehicleLoadsDefaultEntryHolder.defaultEntry; + } + }; + + private static final VehicleLoadsConverter vehicleLoadsConverter = + new VehicleLoadsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder> + vehicleLoads_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder> + internalGetVehicleLoads() { + if (vehicleLoads_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(vehicleLoadsConverter); + } + return vehicleLoads_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder> + internalGetMutableVehicleLoads() { + if (vehicleLoads_ == null) { + vehicleLoads_ = new com.google.protobuf.MapFieldBuilder<>(vehicleLoadsConverter); + } + bitField0_ |= 0x00000200; + onChanged(); + return vehicleLoads_; + } + + public int getVehicleLoadsCount() { + return internalGetVehicleLoads().ensureBuilderMap().size(); + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public boolean containsVehicleLoads(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVehicleLoads().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getVehicleLoadsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getVehicleLoads() { + return getVehicleLoadsMap(); + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getVehicleLoadsMap() { + return internalGetVehicleLoads().getImmutableMap(); + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + getVehicleLoadsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder> + map = internalGetMutableVehicleLoads().ensureBuilderMap(); + return map.containsKey(key) ? vehicleLoadsConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad getVehicleLoadsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder> + map = internalGetMutableVehicleLoads().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return vehicleLoadsConverter.build(map.get(key)); + } + + public Builder clearVehicleLoads() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableVehicleLoads().clear(); + return this; + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + public Builder removeVehicleLoads(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableVehicleLoads().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + getMutableVehicleLoads() { + bitField0_ |= 0x00000200; + return internalGetMutableVehicleLoads().ensureMessageMap(); + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + public Builder putVehicleLoads( + java.lang.String key, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableVehicleLoads().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + public Builder putAllVehicleLoads( + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableVehicleLoads().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+       * Vehicle loads during this transition, for each type that either appears
+       * in this vehicle's
+       * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits],
+       * or that have non-zero
+       * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+       * on some shipment performed on this route.
+       *
+       * The loads during the first transition are the starting loads of the
+       * vehicle route. Then, after each visit, the visit's `load_demands` are
+       * either added or subtracted to get the next transition's loads, depending
+       * on whether the visit was a pickup or a delivery.
+       * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad> vehicle_loads = 11; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder + putVehicleLoadsBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder> + builderMap = internalGetMutableVehicleLoads().ensureBuilderMap(); + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder entry = + builderMap.get(key); + if (entry == null) { + entry = com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) { + entry = + ((com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder) entry; + } + + @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.ShipmentRoute.Transition) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentRoute.Transition) + private static final com.google.maps.routeoptimization.v1.ShipmentRoute.Transition + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentRoute.Transition(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Transition + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Transition 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.ShipmentRoute.Transition + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface VehicleLoadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The amount of load on the vehicle, for the given type. The unit of load
+     * is usually indicated by the type. See
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads].
+     * 
+ * + * int64 amount = 1; + * + * @return The amount. + */ + long getAmount(); + } + /** + * + * + *
+   * Reports the actual load of the vehicle at some point along the route,
+   * for a given type (see
+   * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} + */ + public static final class VehicleLoad extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) + VehicleLoadOrBuilder { + private static final long serialVersionUID = 0L; + // Use VehicleLoad.newBuilder() to construct. + private VehicleLoad(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VehicleLoad() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VehicleLoad(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder.class); + } + + public static final int AMOUNT_FIELD_NUMBER = 1; + private long amount_ = 0L; + /** + * + * + *
+     * The amount of load on the vehicle, for the given type. The unit of load
+     * is usually indicated by the type. See
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads].
+     * 
+ * + * int64 amount = 1; + * + * @return The amount. + */ + @java.lang.Override + public long getAmount() { + return amount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (amount_ != 0L) { + output.writeInt64(1, amount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (amount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, amount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad other = + (com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) obj; + + if (getAmount() != other.getAmount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad 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.ShipmentRoute.VehicleLoad 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; + } + /** + * + * + *
+     * Reports the actual load of the vehicle at some point along the route,
+     * for a given type (see
+     * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]).
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_VehicleLoad_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad build() { + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad result = + new com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amount_ = amount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad other) { + if (other + == com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.getDefaultInstance()) + return this; + if (other.getAmount() != 0L) { + setAmount(other.getAmount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + amount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long amount_; + /** + * + * + *
+       * The amount of load on the vehicle, for the given type. The unit of load
+       * is usually indicated by the type. See
+       * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads].
+       * 
+ * + * int64 amount = 1; + * + * @return The amount. + */ + @java.lang.Override + public long getAmount() { + return amount_; + } + /** + * + * + *
+       * The amount of load on the vehicle, for the given type. The unit of load
+       * is usually indicated by the type. See
+       * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads].
+       * 
+ * + * int64 amount = 1; + * + * @param value The amount to set. + * @return This builder for chaining. + */ + public Builder setAmount(long value) { + + amount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The amount of load on the vehicle, for the given type. The unit of load
+       * is usually indicated by the type. See
+       * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads].
+       * 
+ * + * int64 amount = 1; + * + * @return This builder for chaining. + */ + public Builder clearAmount() { + bitField0_ = (bitField0_ & ~0x00000001); + amount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) + private static final com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VehicleLoad 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.ShipmentRoute.VehicleLoad + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EncodedPolylineOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * String representing encoded points of the polyline.
+     * 
+ * + * string points = 1; + * + * @return The points. + */ + java.lang.String getPoints(); + /** + * + * + *
+     * String representing encoded points of the polyline.
+     * 
+ * + * string points = 1; + * + * @return The bytes for points. + */ + com.google.protobuf.ByteString getPointsBytes(); + } + /** + * + * + *
+   * The encoded representation of a polyline. More information on polyline
+   * encoding can be found here:
+   * https://developers.google.com/maps/documentation/utilities/polylinealgorithm
+   * https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} + */ + public static final class EncodedPolyline extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) + EncodedPolylineOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncodedPolyline.newBuilder() to construct. + private EncodedPolyline(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncodedPolyline() { + points_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncodedPolyline(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder.class); + } + + public static final int POINTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object points_ = ""; + /** + * + * + *
+     * String representing encoded points of the polyline.
+     * 
+ * + * string points = 1; + * + * @return The points. + */ + @java.lang.Override + public java.lang.String getPoints() { + java.lang.Object ref = points_; + 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(); + points_ = s; + return s; + } + } + /** + * + * + *
+     * String representing encoded points of the polyline.
+     * 
+ * + * string points = 1; + * + * @return The bytes for points. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPointsBytes() { + java.lang.Object ref = points_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + points_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(points_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, points_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(points_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, points_); + } + 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.ShipmentRoute.EncodedPolyline)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline other = + (com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) obj; + + if (!getPoints().equals(other.getPoints())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + POINTS_FIELD_NUMBER; + hash = (53 * hash) + getPoints().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline 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.ShipmentRoute.EncodedPolyline parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline 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.ShipmentRoute.EncodedPolyline parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline 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.ShipmentRoute.EncodedPolyline parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline 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.ShipmentRoute.EncodedPolyline + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + 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.ShipmentRoute.EncodedPolyline 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.ShipmentRoute.EncodedPolyline 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.ShipmentRoute.EncodedPolyline prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The encoded representation of a polyline. More information on polyline
+     * encoding can be found here:
+     * https://developers.google.com/maps/documentation/utilities/polylinealgorithm
+     * https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_EncodedPolyline_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + points_ = ""; + 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_ShipmentRoute_EncodedPolyline_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline build() { + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline result = + new com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.points_ = points_; + } + } + + @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.ShipmentRoute.EncodedPolyline) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline other) { + if (other + == com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance()) return this; + if (!other.getPoints().isEmpty()) { + points_ = other.points_; + bitField0_ |= 0x00000001; + 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: + { + points_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object points_ = ""; + /** + * + * + *
+       * String representing encoded points of the polyline.
+       * 
+ * + * string points = 1; + * + * @return The points. + */ + public java.lang.String getPoints() { + java.lang.Object ref = points_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + points_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * String representing encoded points of the polyline.
+       * 
+ * + * string points = 1; + * + * @return The bytes for points. + */ + public com.google.protobuf.ByteString getPointsBytes() { + java.lang.Object ref = points_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + points_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * String representing encoded points of the polyline.
+       * 
+ * + * string points = 1; + * + * @param value The points to set. + * @return This builder for chaining. + */ + public Builder setPoints(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + points_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * String representing encoded points of the polyline.
+       * 
+ * + * string points = 1; + * + * @return This builder for chaining. + */ + public Builder clearPoints() { + points_ = getDefaultInstance().getPoints(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * String representing encoded points of the polyline.
+       * 
+ * + * string points = 1; + * + * @param value The bytes for points to set. + * @return This builder for chaining. + */ + public Builder setPointsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + points_ = value; + bitField0_ |= 0x00000001; + 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.ShipmentRoute.EncodedPolyline) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) + private static final com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncodedPolyline 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.ShipmentRoute.EncodedPolyline + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BreakOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentRoute.Break) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Start time of a break.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+     * Start time of a break.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+     * Start time of a break.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+     * Duration of a break.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+     * Duration of a break.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+     * Duration of a break.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + } + /** + * + * + *
+   * Data representing the execution of a break.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.Break} + */ + public static final class Break extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentRoute.Break) + BreakOrBuilder { + private static final long serialVersionUID = 0L; + // Use Break.newBuilder() to construct. + private Break(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Break() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Break(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+     * Start time of a break.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Start time of a break.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+     * Start time of a break.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+     * Duration of a break.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Duration of a break.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+     * Duration of a break.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + } + 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.ShipmentRoute.Break)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentRoute.Break other = + (com.google.maps.routeoptimization.v1.ShipmentRoute.Break) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) 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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break 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.ShipmentRoute.Break parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break 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.ShipmentRoute.Break parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break 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.ShipmentRoute.Break parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break 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.ShipmentRoute.Break parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break 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.ShipmentRoute.Break 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.ShipmentRoute.Break 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.ShipmentRoute.Break 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; + } + /** + * + * + *
+     * Data representing the execution of a break.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute.Break} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentRoute.Break) + com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_Break_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentRoute.Break.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = 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_ShipmentRoute_Break_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentRoute.Break.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break build() { + com.google.maps.routeoptimization.v1.ShipmentRoute.Break result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentRoute.Break result = + new com.google.maps.routeoptimization.v1.ShipmentRoute.Break(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.ShipmentRoute.Break result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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.ShipmentRoute.Break) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentRoute.Break) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.ShipmentRoute.Break other) { + if (other == com.google.maps.routeoptimization.v1.ShipmentRoute.Break.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTime_; + } + } + /** + * + * + *
+       * Start time of a break.
+       * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + if (duration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + /** + * + * + *
+       * Duration of a break.
+       * 
+ * + * .google.protobuf.Duration duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + @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.ShipmentRoute.Break) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentRoute.Break) + private static final com.google.maps.routeoptimization.v1.ShipmentRoute.Break DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentRoute.Break(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute.Break getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Break 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.ShipmentRoute.Break getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int VEHICLE_INDEX_FIELD_NUMBER = 1; + private int vehicleIndex_ = 0; + /** + * + * + *
+   * Vehicle performing the route, identified by its index in the source
+   * `ShipmentModel`.
+   * 
+ * + * int32 vehicle_index = 1; + * + * @return The vehicleIndex. + */ + @java.lang.Override + public int getVehicleIndex() { + return vehicleIndex_; + } + + public static final int VEHICLE_LABEL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object vehicleLabel_ = ""; + /** + * + * + *
+   * Label of the vehicle performing this route, equal to
+   * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+   * 
+ * + * string vehicle_label = 2; + * + * @return The vehicleLabel. + */ + @java.lang.Override + public java.lang.String getVehicleLabel() { + java.lang.Object ref = vehicleLabel_; + 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(); + vehicleLabel_ = s; + return s; + } + } + /** + * + * + *
+   * Label of the vehicle performing this route, equal to
+   * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+   * 
+ * + * string vehicle_label = 2; + * + * @return The bytes for vehicleLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVehicleLabelBytes() { + java.lang.Object ref = vehicleLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vehicleLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VEHICLE_START_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp vehicleStartTime_; + /** + * + * + *
+   * Time at which the vehicle starts its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + * + * @return Whether the vehicleStartTime field is set. + */ + @java.lang.Override + public boolean hasVehicleStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Time at which the vehicle starts its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + * + * @return The vehicleStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVehicleStartTime() { + return vehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleStartTime_; + } + /** + * + * + *
+   * Time at which the vehicle starts its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getVehicleStartTimeOrBuilder() { + return vehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleStartTime_; + } + + public static final int VEHICLE_END_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp vehicleEndTime_; + /** + * + * + *
+   * Time at which the vehicle finishes its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + * + * @return Whether the vehicleEndTime field is set. + */ + @java.lang.Override + public boolean hasVehicleEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Time at which the vehicle finishes its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + * + * @return The vehicleEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVehicleEndTime() { + return vehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleEndTime_; + } + /** + * + * + *
+   * Time at which the vehicle finishes its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getVehicleEndTimeOrBuilder() { + return vehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleEndTime_; + } + + public static final int VISITS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List visits_; + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + @java.lang.Override + public java.util.List getVisitsList() { + return visits_; + } + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + @java.lang.Override + public java.util.List + getVisitsOrBuilderList() { + return visits_; + } + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + @java.lang.Override + public int getVisitsCount() { + return visits_.size(); + } + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit getVisits(int index) { + return visits_.get(index); + } + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder getVisitsOrBuilder( + int index) { + return visits_.get(index); + } + + public static final int TRANSITIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List + transitions_; + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + @java.lang.Override + public java.util.List + getTransitionsList() { + return transitions_; + } + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder> + getTransitionsOrBuilderList() { + return transitions_; + } + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + @java.lang.Override + public int getTransitionsCount() { + return transitions_.size(); + } + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition getTransitions(int index) { + return transitions_.get(index); + } + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder + getTransitionsOrBuilder(int index) { + return transitions_.get(index); + } + + public static final int HAS_TRAFFIC_INFEASIBILITIES_FIELD_NUMBER = 9; + private boolean hasTrafficInfeasibilities_ = false; + /** + * + * + *
+   * When
+   * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+   * is set to true, this field indicates that inconsistencies in route timings
+   * are predicted using traffic-based travel duration estimates. There may be
+   * insufficient time to complete traffic-adjusted travel, delays, and breaks
+   * between visits, before the first visit, or after the last visit, while
+   * still satisfying the visit and vehicle time windows. For example,
+   *
+   * ```
+   *   start_time(previous_visit) + duration(previous_visit) +
+   *   travel_duration(previous_visit, next_visit) > start_time(next_visit)
+   * ```
+   *
+   * Arrival at next_visit will likely happen later than its current
+   * time window due the increased estimate of travel time
+   * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break
+   * may be forced to overlap with a visit due to an increase in travel time
+   * estimates and visit or break time window restrictions.
+   * 
+ * + * bool has_traffic_infeasibilities = 9; + * + * @return The hasTrafficInfeasibilities. + */ + @java.lang.Override + public boolean getHasTrafficInfeasibilities() { + return hasTrafficInfeasibilities_; + } + + public static final int ROUTE_POLYLINE_FIELD_NUMBER = 10; + private com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline routePolyline_; + /** + * + * + *
+   * The encoded polyline representation of the route.
+   * This field is only populated if
+   * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+   * is set to true.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + * + * @return Whether the routePolyline field is set. + */ + @java.lang.Override + public boolean hasRoutePolyline() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The encoded polyline representation of the route.
+   * This field is only populated if
+   * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+   * is set to true.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + * + * @return The routePolyline. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline getRoutePolyline() { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.getDefaultInstance() + : routePolyline_; + } + /** + * + * + *
+   * The encoded polyline representation of the route.
+   * This field is only populated if
+   * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+   * is set to true.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder + getRoutePolylineOrBuilder() { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.getDefaultInstance() + : routePolyline_; + } + + public static final int BREAKS_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private java.util.List breaks_; + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + @java.lang.Override + public java.util.List getBreaksList() { + return breaks_; + } + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + @java.lang.Override + public java.util.List + getBreaksOrBuilderList() { + return breaks_; + } + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + @java.lang.Override + public int getBreaksCount() { + return breaks_.size(); + } + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break getBreaks(int index) { + return breaks_.get(index); + } + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder getBreaksOrBuilder( + int index) { + return breaks_.get(index); + } + + public static final int METRICS_FIELD_NUMBER = 12; + private com.google.maps.routeoptimization.v1.AggregatedMetrics metrics_; + /** + * + * + *
+   * Duration, distance and load metrics for this route. The fields of
+   * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+   * summed over all
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * or
+   * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+   * depending on the context.
+   * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * + * @return Whether the metrics field is set. + */ + @java.lang.Override + public boolean hasMetrics() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Duration, distance and load metrics for this route. The fields of
+   * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+   * summed over all
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * or
+   * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+   * depending on the context.
+   * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * + * @return The metrics. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetrics getMetrics() { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : metrics_; + } + /** + * + * + *
+   * Duration, distance and load metrics for this route. The fields of
+   * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+   * summed over all
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * or
+   * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+   * depending on the context.
+   * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder getMetricsOrBuilder() { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : metrics_; + } + + public static final int ROUTE_COSTS_FIELD_NUMBER = 17; + + private static final class RouteCostsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_RouteCostsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.DOUBLE, + 0D); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField routeCosts_; + + private com.google.protobuf.MapField internalGetRouteCosts() { + if (routeCosts_ == null) { + return com.google.protobuf.MapField.emptyMapField(RouteCostsDefaultEntryHolder.defaultEntry); + } + return routeCosts_; + } + + public int getRouteCostsCount() { + return internalGetRouteCosts().getMap().size(); + } + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public boolean containsRouteCosts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRouteCosts().getMap().containsKey(key); + } + /** Use {@link #getRouteCostsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRouteCosts() { + return getRouteCostsMap(); + } + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public java.util.Map getRouteCostsMap() { + return internalGetRouteCosts().getMap(); + } + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public double getRouteCostsOrDefault(java.lang.String key, double defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRouteCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public double getRouteCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRouteCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ROUTE_TOTAL_COST_FIELD_NUMBER = 18; + private double routeTotalCost_ = 0D; + /** + * + * + *
+   * Total cost of the route. The sum of all costs in the cost map.
+   * 
+ * + * double route_total_cost = 18; + * + * @return The routeTotalCost. + */ + @java.lang.Override + public double getRouteTotalCost() { + return routeTotalCost_; + } + + 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 (vehicleIndex_ != 0) { + output.writeInt32(1, vehicleIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vehicleLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, vehicleLabel_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getVehicleStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getVehicleEndTime()); + } + for (int i = 0; i < visits_.size(); i++) { + output.writeMessage(7, visits_.get(i)); + } + for (int i = 0; i < transitions_.size(); i++) { + output.writeMessage(8, transitions_.get(i)); + } + if (hasTrafficInfeasibilities_ != false) { + output.writeBool(9, hasTrafficInfeasibilities_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getRoutePolyline()); + } + for (int i = 0; i < breaks_.size(); i++) { + output.writeMessage(11, breaks_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(12, getMetrics()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetRouteCosts(), RouteCostsDefaultEntryHolder.defaultEntry, 17); + if (java.lang.Double.doubleToRawLongBits(routeTotalCost_) != 0) { + output.writeDouble(18, routeTotalCost_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (vehicleIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, vehicleIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vehicleLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, vehicleLabel_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getVehicleStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getVehicleEndTime()); + } + for (int i = 0; i < visits_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, visits_.get(i)); + } + for (int i = 0; i < transitions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, transitions_.get(i)); + } + if (hasTrafficInfeasibilities_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, hasTrafficInfeasibilities_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getRoutePolyline()); + } + for (int i = 0; i < breaks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, breaks_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getMetrics()); + } + for (java.util.Map.Entry entry : + internalGetRouteCosts().getMap().entrySet()) { + com.google.protobuf.MapEntry routeCosts__ = + RouteCostsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, routeCosts__); + } + if (java.lang.Double.doubleToRawLongBits(routeTotalCost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(18, routeTotalCost_); + } + 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.ShipmentRoute)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentRoute other = + (com.google.maps.routeoptimization.v1.ShipmentRoute) obj; + + if (getVehicleIndex() != other.getVehicleIndex()) return false; + if (!getVehicleLabel().equals(other.getVehicleLabel())) return false; + if (hasVehicleStartTime() != other.hasVehicleStartTime()) return false; + if (hasVehicleStartTime()) { + if (!getVehicleStartTime().equals(other.getVehicleStartTime())) return false; + } + if (hasVehicleEndTime() != other.hasVehicleEndTime()) return false; + if (hasVehicleEndTime()) { + if (!getVehicleEndTime().equals(other.getVehicleEndTime())) return false; + } + if (!getVisitsList().equals(other.getVisitsList())) return false; + if (!getTransitionsList().equals(other.getTransitionsList())) return false; + if (getHasTrafficInfeasibilities() != other.getHasTrafficInfeasibilities()) return false; + if (hasRoutePolyline() != other.hasRoutePolyline()) return false; + if (hasRoutePolyline()) { + if (!getRoutePolyline().equals(other.getRoutePolyline())) return false; + } + if (!getBreaksList().equals(other.getBreaksList())) return false; + if (hasMetrics() != other.hasMetrics()) return false; + if (hasMetrics()) { + if (!getMetrics().equals(other.getMetrics())) return false; + } + if (!internalGetRouteCosts().equals(other.internalGetRouteCosts())) return false; + if (java.lang.Double.doubleToLongBits(getRouteTotalCost()) + != java.lang.Double.doubleToLongBits(other.getRouteTotalCost())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VEHICLE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getVehicleIndex(); + hash = (37 * hash) + VEHICLE_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getVehicleLabel().hashCode(); + if (hasVehicleStartTime()) { + hash = (37 * hash) + VEHICLE_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getVehicleStartTime().hashCode(); + } + if (hasVehicleEndTime()) { + hash = (37 * hash) + VEHICLE_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getVehicleEndTime().hashCode(); + } + if (getVisitsCount() > 0) { + hash = (37 * hash) + VISITS_FIELD_NUMBER; + hash = (53 * hash) + getVisitsList().hashCode(); + } + if (getTransitionsCount() > 0) { + hash = (37 * hash) + TRANSITIONS_FIELD_NUMBER; + hash = (53 * hash) + getTransitionsList().hashCode(); + } + hash = (37 * hash) + HAS_TRAFFIC_INFEASIBILITIES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHasTrafficInfeasibilities()); + if (hasRoutePolyline()) { + hash = (37 * hash) + ROUTE_POLYLINE_FIELD_NUMBER; + hash = (53 * hash) + getRoutePolyline().hashCode(); + } + if (getBreaksCount() > 0) { + hash = (37 * hash) + BREAKS_FIELD_NUMBER; + hash = (53 * hash) + getBreaksList().hashCode(); + } + if (hasMetrics()) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetrics().hashCode(); + } + if (!internalGetRouteCosts().getMap().isEmpty()) { + hash = (37 * hash) + ROUTE_COSTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetRouteCosts().hashCode(); + } + hash = (37 * hash) + ROUTE_TOTAL_COST_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRouteTotalCost())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute 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.ShipmentRoute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute 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.ShipmentRoute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute 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.ShipmentRoute parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute 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.ShipmentRoute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute 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.ShipmentRoute 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.ShipmentRoute 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.ShipmentRoute 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 vehicle's route can be decomposed, along the time axis, like this (we
+   * assume there are n visits):
+   * ```
+   *   |            |            |          |       |  T[2], |        |      |
+   *   | Transition |  Visit #0  |          |       |  V[2], |        |      |
+   *   |     #0     |    aka     |   T[1]   |  V[1] |  ...   | V[n-1] | T[n] |
+   *   |  aka T[0]  |    V[0]    |          |       | V[n-2],|        |      |
+   *   |            |            |          |       | T[n-1] |        |      |
+   *   ^            ^            ^          ^       ^        ^        ^      ^
+   * vehicle    V[0].start   V[0].end     V[1].   V[1].    V[n].    V[n]. vehicle
+   *  start     (arrival)   (departure)   start   end      start    end     end
+   * ```
+   * Note that we make a difference between:
+   *
+   * * "punctual events", such as the vehicle start and end and each visit's start
+   *   and end (aka arrival and departure). They happen at a given second.
+   * * "time intervals", such as the visits themselves, and the transition between
+   *   visits. Though time intervals can sometimes have zero duration, i.e. start
+   *   and end at the same second, they often have a positive duration.
+   *
+   * Invariants:
+   *
+   * * If there are n visits, there are n+1 transitions.
+   * * A visit is always surrounded by a transition before it (same index) and a
+   *   transition after it (index + 1).
+   * * The vehicle start is always followed by transition #0.
+   * * The vehicle end is always preceded by transition #n.
+   *
+   * Zooming in, here is what happens during a `Transition` and a `Visit`:
+   * ```
+   * ---+-------------------------------------+-----------------------------+-->
+   *    |           TRANSITION[i]             |           VISIT[i]          |
+   *    |                                     |                             |
+   *    |  * TRAVEL: the vehicle moves from   |      PERFORM the visit:     |
+   *    |    VISIT[i-1].departure_location to |                             |
+   *    |    VISIT[i].arrival_location, which |  * Spend some time:         |
+   *    |    takes a given travel duration    |    the "visit duration".    |
+   *    |    and distance                     |                             |
+   *    |                                     |  * Load or unload           |
+   *    |  * BREAKS: the driver may have      |    some quantities from the |
+   *    |    breaks (e.g. lunch break).       |    vehicle: the "demand".   |
+   *    |                                     |                             |
+   *    |  * WAIT: the driver/vehicle does    |                             |
+   *    |    nothing. This can happen for     |                             |
+   *    |    many reasons, for example when   |                             |
+   *    |    the vehicle reaches the next     |                             |
+   *    |    event's destination before the   |                             |
+   *    |    start of its time window         |                             |
+   *    |                                     |                             |
+   *    |  * DELAY: *right before* the next   |                             |
+   *    |    arrival. E.g. the vehicle and/or |                             |
+   *    |    driver spends time unloading.    |                             |
+   *    |                                     |                             |
+   * ---+-------------------------------------+-----------------------------+-->
+   *    ^                                     ^                             ^
+   * V[i-1].end                           V[i].start                    V[i].end
+   * ```
+   * Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged
+   * during a transition.
+   *
+   * * They don't overlap.
+   * * The DELAY is unique and *must* be a contiguous period of time right
+   *   before the next visit (or vehicle end). Thus, it suffice to know the
+   *   delay duration to know its start and end time.
+   * * The BREAKS are contiguous, non-overlapping periods of time. The
+   *   response specifies the start time and duration of each break.
+   * * TRAVEL and WAIT are "preemptable": they can be interrupted several times
+   *   during this transition. Clients can assume that travel happens "as soon as
+   *   possible" and that "wait" fills the remaining time.
+   *
+   * A (complex) example:
+   * ```
+   *                                TRANSITION[i]
+   * --++-----+-----------------------------------------------------------++-->
+   *   ||     |       |           |       |           |         |         ||
+   *   ||  T  |   B   |     T     |       |     B     |         |    D    ||
+   *   ||  r  |   r   |     r     |   W   |     r     |    W    |    e    ||
+   *   ||  a  |   e   |     a     |   a   |     e     |    a    |    l    ||
+   *   ||  v  |   a   |     v     |   i   |     a     |    i    |    a    ||
+   *   ||  e  |   k   |     e     |   t   |     k     |    t    |    y    ||
+   *   ||  l  |       |     l     |       |           |         |         ||
+   *   ||     |       |           |       |           |         |         ||
+   * --++-----------------------------------------------------------------++-->
+   * ```
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentRoute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentRoute) + com.google.maps.routeoptimization.v1.ShipmentRouteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 17: + return internalGetRouteCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 17: + return internalGetMutableRouteCosts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentRoute.class, + com.google.maps.routeoptimization.v1.ShipmentRoute.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentRoute.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVehicleStartTimeFieldBuilder(); + getVehicleEndTimeFieldBuilder(); + getVisitsFieldBuilder(); + getTransitionsFieldBuilder(); + getRoutePolylineFieldBuilder(); + getBreaksFieldBuilder(); + getMetricsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + vehicleIndex_ = 0; + vehicleLabel_ = ""; + vehicleStartTime_ = null; + if (vehicleStartTimeBuilder_ != null) { + vehicleStartTimeBuilder_.dispose(); + vehicleStartTimeBuilder_ = null; + } + vehicleEndTime_ = null; + if (vehicleEndTimeBuilder_ != null) { + vehicleEndTimeBuilder_.dispose(); + vehicleEndTimeBuilder_ = null; + } + if (visitsBuilder_ == null) { + visits_ = java.util.Collections.emptyList(); + } else { + visits_ = null; + visitsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (transitionsBuilder_ == null) { + transitions_ = java.util.Collections.emptyList(); + } else { + transitions_ = null; + transitionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + hasTrafficInfeasibilities_ = false; + routePolyline_ = null; + if (routePolylineBuilder_ != null) { + routePolylineBuilder_.dispose(); + routePolylineBuilder_ = null; + } + if (breaksBuilder_ == null) { + breaks_ = java.util.Collections.emptyList(); + } else { + breaks_ = null; + breaksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + metrics_ = null; + if (metricsBuilder_ != null) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + } + internalGetMutableRouteCosts().clear(); + routeTotalCost_ = 0D; + 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_ShipmentRoute_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute build() { + com.google.maps.routeoptimization.v1.ShipmentRoute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentRoute buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentRoute result = + new com.google.maps.routeoptimization.v1.ShipmentRoute(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.ShipmentRoute result) { + if (visitsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + visits_ = java.util.Collections.unmodifiableList(visits_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.visits_ = visits_; + } else { + result.visits_ = visitsBuilder_.build(); + } + if (transitionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + transitions_ = java.util.Collections.unmodifiableList(transitions_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.transitions_ = transitions_; + } else { + result.transitions_ = transitionsBuilder_.build(); + } + if (breaksBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + breaks_ = java.util.Collections.unmodifiableList(breaks_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.breaks_ = breaks_; + } else { + result.breaks_ = breaksBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.ShipmentRoute result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.vehicleIndex_ = vehicleIndex_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.vehicleLabel_ = vehicleLabel_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.vehicleStartTime_ = + vehicleStartTimeBuilder_ == null ? vehicleStartTime_ : vehicleStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.vehicleEndTime_ = + vehicleEndTimeBuilder_ == null ? vehicleEndTime_ : vehicleEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.hasTrafficInfeasibilities_ = hasTrafficInfeasibilities_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.routePolyline_ = + routePolylineBuilder_ == null ? routePolyline_ : routePolylineBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.metrics_ = metricsBuilder_ == null ? metrics_ : metricsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.routeCosts_ = internalGetRouteCosts(); + result.routeCosts_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.routeTotalCost_ = routeTotalCost_; + } + 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.ShipmentRoute) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentRoute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.ShipmentRoute other) { + if (other == com.google.maps.routeoptimization.v1.ShipmentRoute.getDefaultInstance()) + return this; + if (other.getVehicleIndex() != 0) { + setVehicleIndex(other.getVehicleIndex()); + } + if (!other.getVehicleLabel().isEmpty()) { + vehicleLabel_ = other.vehicleLabel_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasVehicleStartTime()) { + mergeVehicleStartTime(other.getVehicleStartTime()); + } + if (other.hasVehicleEndTime()) { + mergeVehicleEndTime(other.getVehicleEndTime()); + } + if (visitsBuilder_ == null) { + if (!other.visits_.isEmpty()) { + if (visits_.isEmpty()) { + visits_ = other.visits_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureVisitsIsMutable(); + visits_.addAll(other.visits_); + } + onChanged(); + } + } else { + if (!other.visits_.isEmpty()) { + if (visitsBuilder_.isEmpty()) { + visitsBuilder_.dispose(); + visitsBuilder_ = null; + visits_ = other.visits_; + bitField0_ = (bitField0_ & ~0x00000010); + visitsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVisitsFieldBuilder() + : null; + } else { + visitsBuilder_.addAllMessages(other.visits_); + } + } + } + if (transitionsBuilder_ == null) { + if (!other.transitions_.isEmpty()) { + if (transitions_.isEmpty()) { + transitions_ = other.transitions_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTransitionsIsMutable(); + transitions_.addAll(other.transitions_); + } + onChanged(); + } + } else { + if (!other.transitions_.isEmpty()) { + if (transitionsBuilder_.isEmpty()) { + transitionsBuilder_.dispose(); + transitionsBuilder_ = null; + transitions_ = other.transitions_; + bitField0_ = (bitField0_ & ~0x00000020); + transitionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransitionsFieldBuilder() + : null; + } else { + transitionsBuilder_.addAllMessages(other.transitions_); + } + } + } + if (other.getHasTrafficInfeasibilities() != false) { + setHasTrafficInfeasibilities(other.getHasTrafficInfeasibilities()); + } + if (other.hasRoutePolyline()) { + mergeRoutePolyline(other.getRoutePolyline()); + } + if (breaksBuilder_ == null) { + if (!other.breaks_.isEmpty()) { + if (breaks_.isEmpty()) { + breaks_ = other.breaks_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureBreaksIsMutable(); + breaks_.addAll(other.breaks_); + } + onChanged(); + } + } else { + if (!other.breaks_.isEmpty()) { + if (breaksBuilder_.isEmpty()) { + breaksBuilder_.dispose(); + breaksBuilder_ = null; + breaks_ = other.breaks_; + bitField0_ = (bitField0_ & ~0x00000100); + breaksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBreaksFieldBuilder() + : null; + } else { + breaksBuilder_.addAllMessages(other.breaks_); + } + } + } + if (other.hasMetrics()) { + mergeMetrics(other.getMetrics()); + } + internalGetMutableRouteCosts().mergeFrom(other.internalGetRouteCosts()); + bitField0_ |= 0x00000400; + if (other.getRouteTotalCost() != 0D) { + setRouteTotalCost(other.getRouteTotalCost()); + } + 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: + { + vehicleIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + vehicleLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 42: + { + input.readMessage( + getVehicleStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 50: + { + input.readMessage(getVehicleEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 + case 58: + { + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.parser(), + extensionRegistry); + if (visitsBuilder_ == null) { + ensureVisitsIsMutable(); + visits_.add(m); + } else { + visitsBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.parser(), + extensionRegistry); + if (transitionsBuilder_ == null) { + ensureTransitionsIsMutable(); + transitions_.add(m); + } else { + transitionsBuilder_.addMessage(m); + } + break; + } // case 66 + case 72: + { + hasTrafficInfeasibilities_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 72 + case 82: + { + input.readMessage(getRoutePolylineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + com.google.maps.routeoptimization.v1.ShipmentRoute.Break m = + input.readMessage( + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.parser(), + extensionRegistry); + if (breaksBuilder_ == null) { + ensureBreaksIsMutable(); + breaks_.add(m); + } else { + breaksBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: + { + input.readMessage(getMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 98 + case 138: + { + com.google.protobuf.MapEntry routeCosts__ = + input.readMessage( + RouteCostsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableRouteCosts() + .getMutableMap() + .put(routeCosts__.getKey(), routeCosts__.getValue()); + bitField0_ |= 0x00000400; + break; + } // case 138 + case 145: + { + routeTotalCost_ = input.readDouble(); + bitField0_ |= 0x00000800; + break; + } // case 145 + 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 vehicleIndex_; + /** + * + * + *
+     * Vehicle performing the route, identified by its index in the source
+     * `ShipmentModel`.
+     * 
+ * + * int32 vehicle_index = 1; + * + * @return The vehicleIndex. + */ + @java.lang.Override + public int getVehicleIndex() { + return vehicleIndex_; + } + /** + * + * + *
+     * Vehicle performing the route, identified by its index in the source
+     * `ShipmentModel`.
+     * 
+ * + * int32 vehicle_index = 1; + * + * @param value The vehicleIndex to set. + * @return This builder for chaining. + */ + public Builder setVehicleIndex(int value) { + + vehicleIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Vehicle performing the route, identified by its index in the source
+     * `ShipmentModel`.
+     * 
+ * + * int32 vehicle_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearVehicleIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + vehicleIndex_ = 0; + onChanged(); + return this; + } + + private java.lang.Object vehicleLabel_ = ""; + /** + * + * + *
+     * Label of the vehicle performing this route, equal to
+     * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+     * 
+ * + * string vehicle_label = 2; + * + * @return The vehicleLabel. + */ + public java.lang.String getVehicleLabel() { + java.lang.Object ref = vehicleLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vehicleLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Label of the vehicle performing this route, equal to
+     * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+     * 
+ * + * string vehicle_label = 2; + * + * @return The bytes for vehicleLabel. + */ + public com.google.protobuf.ByteString getVehicleLabelBytes() { + java.lang.Object ref = vehicleLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vehicleLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Label of the vehicle performing this route, equal to
+     * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+     * 
+ * + * string vehicle_label = 2; + * + * @param value The vehicleLabel to set. + * @return This builder for chaining. + */ + public Builder setVehicleLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + vehicleLabel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Label of the vehicle performing this route, equal to
+     * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+     * 
+ * + * string vehicle_label = 2; + * + * @return This builder for chaining. + */ + public Builder clearVehicleLabel() { + vehicleLabel_ = getDefaultInstance().getVehicleLabel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Label of the vehicle performing this route, equal to
+     * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+     * 
+ * + * string vehicle_label = 2; + * + * @param value The bytes for vehicleLabel to set. + * @return This builder for chaining. + */ + public Builder setVehicleLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + vehicleLabel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp vehicleStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + vehicleStartTimeBuilder_; + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + * + * @return Whether the vehicleStartTime field is set. + */ + public boolean hasVehicleStartTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + * + * @return The vehicleStartTime. + */ + public com.google.protobuf.Timestamp getVehicleStartTime() { + if (vehicleStartTimeBuilder_ == null) { + return vehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleStartTime_; + } else { + return vehicleStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + public Builder setVehicleStartTime(com.google.protobuf.Timestamp value) { + if (vehicleStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vehicleStartTime_ = value; + } else { + vehicleStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + public Builder setVehicleStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (vehicleStartTimeBuilder_ == null) { + vehicleStartTime_ = builderForValue.build(); + } else { + vehicleStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + public Builder mergeVehicleStartTime(com.google.protobuf.Timestamp value) { + if (vehicleStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && vehicleStartTime_ != null + && vehicleStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getVehicleStartTimeBuilder().mergeFrom(value); + } else { + vehicleStartTime_ = value; + } + } else { + vehicleStartTimeBuilder_.mergeFrom(value); + } + if (vehicleStartTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + public Builder clearVehicleStartTime() { + bitField0_ = (bitField0_ & ~0x00000004); + vehicleStartTime_ = null; + if (vehicleStartTimeBuilder_ != null) { + vehicleStartTimeBuilder_.dispose(); + vehicleStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getVehicleStartTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getVehicleStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getVehicleStartTimeOrBuilder() { + if (vehicleStartTimeBuilder_ != null) { + return vehicleStartTimeBuilder_.getMessageOrBuilder(); + } else { + return vehicleStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleStartTime_; + } + } + /** + * + * + *
+     * Time at which the vehicle starts its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getVehicleStartTimeFieldBuilder() { + if (vehicleStartTimeBuilder_ == null) { + vehicleStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getVehicleStartTime(), getParentForChildren(), isClean()); + vehicleStartTime_ = null; + } + return vehicleStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp vehicleEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + vehicleEndTimeBuilder_; + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + * + * @return Whether the vehicleEndTime field is set. + */ + public boolean hasVehicleEndTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + * + * @return The vehicleEndTime. + */ + public com.google.protobuf.Timestamp getVehicleEndTime() { + if (vehicleEndTimeBuilder_ == null) { + return vehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleEndTime_; + } else { + return vehicleEndTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + public Builder setVehicleEndTime(com.google.protobuf.Timestamp value) { + if (vehicleEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vehicleEndTime_ = value; + } else { + vehicleEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + public Builder setVehicleEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (vehicleEndTimeBuilder_ == null) { + vehicleEndTime_ = builderForValue.build(); + } else { + vehicleEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + public Builder mergeVehicleEndTime(com.google.protobuf.Timestamp value) { + if (vehicleEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && vehicleEndTime_ != null + && vehicleEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getVehicleEndTimeBuilder().mergeFrom(value); + } else { + vehicleEndTime_ = value; + } + } else { + vehicleEndTimeBuilder_.mergeFrom(value); + } + if (vehicleEndTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + public Builder clearVehicleEndTime() { + bitField0_ = (bitField0_ & ~0x00000008); + vehicleEndTime_ = null; + if (vehicleEndTimeBuilder_ != null) { + vehicleEndTimeBuilder_.dispose(); + vehicleEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getVehicleEndTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getVehicleEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getVehicleEndTimeOrBuilder() { + if (vehicleEndTimeBuilder_ != null) { + return vehicleEndTimeBuilder_.getMessageOrBuilder(); + } else { + return vehicleEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : vehicleEndTime_; + } + } + /** + * + * + *
+     * Time at which the vehicle finishes its route.
+     * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getVehicleEndTimeFieldBuilder() { + if (vehicleEndTimeBuilder_ == null) { + vehicleEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getVehicleEndTime(), getParentForChildren(), isClean()); + vehicleEndTime_ = null; + } + return vehicleEndTimeBuilder_; + } + + private java.util.List visits_ = + java.util.Collections.emptyList(); + + private void ensureVisitsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + visits_ = + new java.util.ArrayList( + visits_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder> + visitsBuilder_; + + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public java.util.List + getVisitsList() { + if (visitsBuilder_ == null) { + return java.util.Collections.unmodifiableList(visits_); + } else { + return visitsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public int getVisitsCount() { + if (visitsBuilder_ == null) { + return visits_.size(); + } else { + return visitsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit getVisits(int index) { + if (visitsBuilder_ == null) { + return visits_.get(index); + } else { + return visitsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder setVisits( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Visit value) { + if (visitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisitsIsMutable(); + visits_.set(index, value); + onChanged(); + } else { + visitsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder setVisits( + int index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder builderForValue) { + if (visitsBuilder_ == null) { + ensureVisitsIsMutable(); + visits_.set(index, builderForValue.build()); + onChanged(); + } else { + visitsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder addVisits(com.google.maps.routeoptimization.v1.ShipmentRoute.Visit value) { + if (visitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisitsIsMutable(); + visits_.add(value); + onChanged(); + } else { + visitsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder addVisits( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Visit value) { + if (visitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVisitsIsMutable(); + visits_.add(index, value); + onChanged(); + } else { + visitsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder addVisits( + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder builderForValue) { + if (visitsBuilder_ == null) { + ensureVisitsIsMutable(); + visits_.add(builderForValue.build()); + onChanged(); + } else { + visitsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder addVisits( + int index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder builderForValue) { + if (visitsBuilder_ == null) { + ensureVisitsIsMutable(); + visits_.add(index, builderForValue.build()); + onChanged(); + } else { + visitsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder addAllVisits( + java.lang.Iterable + values) { + if (visitsBuilder_ == null) { + ensureVisitsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, visits_); + onChanged(); + } else { + visitsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder clearVisits() { + if (visitsBuilder_ == null) { + visits_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + visitsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public Builder removeVisits(int index) { + if (visitsBuilder_ == null) { + ensureVisitsIsMutable(); + visits_.remove(index); + onChanged(); + } else { + visitsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder getVisitsBuilder( + int index) { + return getVisitsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder getVisitsOrBuilder( + int index) { + if (visitsBuilder_ == null) { + return visits_.get(index); + } else { + return visitsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder> + getVisitsOrBuilderList() { + if (visitsBuilder_ != null) { + return visitsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(visits_); + } + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder addVisitsBuilder() { + return getVisitsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.getDefaultInstance()); + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder addVisitsBuilder( + int index) { + return getVisitsFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.getDefaultInstance()); + } + /** + * + * + *
+     * Ordered sequence of visits representing a route.
+     * visits[i] is the i-th visit in the route.
+     * If this field is empty, the vehicle is considered as unused.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + public java.util.List + getVisitsBuilderList() { + return getVisitsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder> + getVisitsFieldBuilder() { + if (visitsBuilder_ == null) { + visitsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit, + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder>( + visits_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + visits_ = null; + } + return visitsBuilder_; + } + + private java.util.List + transitions_ = java.util.Collections.emptyList(); + + private void ensureTransitionsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + transitions_ = + new java.util.ArrayList( + transitions_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder> + transitionsBuilder_; + + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public java.util.List + getTransitionsList() { + if (transitionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(transitions_); + } else { + return transitionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public int getTransitionsCount() { + if (transitionsBuilder_ == null) { + return transitions_.size(); + } else { + return transitionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition getTransitions(int index) { + if (transitionsBuilder_ == null) { + return transitions_.get(index); + } else { + return transitionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder setTransitions( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Transition value) { + if (transitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionsIsMutable(); + transitions_.set(index, value); + onChanged(); + } else { + transitionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder setTransitions( + int index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder builderForValue) { + if (transitionsBuilder_ == null) { + ensureTransitionsIsMutable(); + transitions_.set(index, builderForValue.build()); + onChanged(); + } else { + transitionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder addTransitions( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition value) { + if (transitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionsIsMutable(); + transitions_.add(value); + onChanged(); + } else { + transitionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder addTransitions( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Transition value) { + if (transitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransitionsIsMutable(); + transitions_.add(index, value); + onChanged(); + } else { + transitionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder addTransitions( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder builderForValue) { + if (transitionsBuilder_ == null) { + ensureTransitionsIsMutable(); + transitions_.add(builderForValue.build()); + onChanged(); + } else { + transitionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder addTransitions( + int index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder builderForValue) { + if (transitionsBuilder_ == null) { + ensureTransitionsIsMutable(); + transitions_.add(index, builderForValue.build()); + onChanged(); + } else { + transitionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder addAllTransitions( + java.lang.Iterable + values) { + if (transitionsBuilder_ == null) { + ensureTransitionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transitions_); + onChanged(); + } else { + transitionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder clearTransitions() { + if (transitionsBuilder_ == null) { + transitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + transitionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public Builder removeTransitions(int index) { + if (transitionsBuilder_ == null) { + ensureTransitionsIsMutable(); + transitions_.remove(index); + onChanged(); + } else { + transitionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder + getTransitionsBuilder(int index) { + return getTransitionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder + getTransitionsOrBuilder(int index) { + if (transitionsBuilder_ == null) { + return transitions_.get(index); + } else { + return transitionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder> + getTransitionsOrBuilderList() { + if (transitionsBuilder_ != null) { + return transitionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transitions_); + } + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder + addTransitionsBuilder() { + return getTransitionsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.getDefaultInstance()); + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder + addTransitionsBuilder(int index) { + return getTransitionsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.getDefaultInstance()); + } + /** + * + * + *
+     * Ordered list of transitions for the route.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + public java.util.List + getTransitionsBuilderList() { + return getTransitionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder> + getTransitionsFieldBuilder() { + if (transitionsBuilder_ == null) { + transitionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition, + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder>( + transitions_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + transitions_ = null; + } + return transitionsBuilder_; + } + + private boolean hasTrafficInfeasibilities_; + /** + * + * + *
+     * When
+     * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+     * is set to true, this field indicates that inconsistencies in route timings
+     * are predicted using traffic-based travel duration estimates. There may be
+     * insufficient time to complete traffic-adjusted travel, delays, and breaks
+     * between visits, before the first visit, or after the last visit, while
+     * still satisfying the visit and vehicle time windows. For example,
+     *
+     * ```
+     *   start_time(previous_visit) + duration(previous_visit) +
+     *   travel_duration(previous_visit, next_visit) > start_time(next_visit)
+     * ```
+     *
+     * Arrival at next_visit will likely happen later than its current
+     * time window due the increased estimate of travel time
+     * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break
+     * may be forced to overlap with a visit due to an increase in travel time
+     * estimates and visit or break time window restrictions.
+     * 
+ * + * bool has_traffic_infeasibilities = 9; + * + * @return The hasTrafficInfeasibilities. + */ + @java.lang.Override + public boolean getHasTrafficInfeasibilities() { + return hasTrafficInfeasibilities_; + } + /** + * + * + *
+     * When
+     * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+     * is set to true, this field indicates that inconsistencies in route timings
+     * are predicted using traffic-based travel duration estimates. There may be
+     * insufficient time to complete traffic-adjusted travel, delays, and breaks
+     * between visits, before the first visit, or after the last visit, while
+     * still satisfying the visit and vehicle time windows. For example,
+     *
+     * ```
+     *   start_time(previous_visit) + duration(previous_visit) +
+     *   travel_duration(previous_visit, next_visit) > start_time(next_visit)
+     * ```
+     *
+     * Arrival at next_visit will likely happen later than its current
+     * time window due the increased estimate of travel time
+     * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break
+     * may be forced to overlap with a visit due to an increase in travel time
+     * estimates and visit or break time window restrictions.
+     * 
+ * + * bool has_traffic_infeasibilities = 9; + * + * @param value The hasTrafficInfeasibilities to set. + * @return This builder for chaining. + */ + public Builder setHasTrafficInfeasibilities(boolean value) { + + hasTrafficInfeasibilities_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * When
+     * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+     * is set to true, this field indicates that inconsistencies in route timings
+     * are predicted using traffic-based travel duration estimates. There may be
+     * insufficient time to complete traffic-adjusted travel, delays, and breaks
+     * between visits, before the first visit, or after the last visit, while
+     * still satisfying the visit and vehicle time windows. For example,
+     *
+     * ```
+     *   start_time(previous_visit) + duration(previous_visit) +
+     *   travel_duration(previous_visit, next_visit) > start_time(next_visit)
+     * ```
+     *
+     * Arrival at next_visit will likely happen later than its current
+     * time window due the increased estimate of travel time
+     * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break
+     * may be forced to overlap with a visit due to an increase in travel time
+     * estimates and visit or break time window restrictions.
+     * 
+ * + * bool has_traffic_infeasibilities = 9; + * + * @return This builder for chaining. + */ + public Builder clearHasTrafficInfeasibilities() { + bitField0_ = (bitField0_ & ~0x00000040); + hasTrafficInfeasibilities_ = false; + onChanged(); + return this; + } + + private com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline routePolyline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder> + routePolylineBuilder_; + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + * + * @return Whether the routePolyline field is set. + */ + public boolean hasRoutePolyline() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + * + * @return The routePolyline. + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline getRoutePolyline() { + if (routePolylineBuilder_ == null) { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance() + : routePolyline_; + } else { + return routePolylineBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + public Builder setRoutePolyline( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline value) { + if (routePolylineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routePolyline_ = value; + } else { + routePolylineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + public Builder setRoutePolyline( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder + builderForValue) { + if (routePolylineBuilder_ == null) { + routePolyline_ = builderForValue.build(); + } else { + routePolylineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + public Builder mergeRoutePolyline( + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline value) { + if (routePolylineBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && routePolyline_ != null + && routePolyline_ + != com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance()) { + getRoutePolylineBuilder().mergeFrom(value); + } else { + routePolyline_ = value; + } + } else { + routePolylineBuilder_.mergeFrom(value); + } + if (routePolyline_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + public Builder clearRoutePolyline() { + bitField0_ = (bitField0_ & ~0x00000080); + routePolyline_ = null; + if (routePolylineBuilder_ != null) { + routePolylineBuilder_.dispose(); + routePolylineBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder + getRoutePolylineBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getRoutePolylineFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder + getRoutePolylineOrBuilder() { + if (routePolylineBuilder_ != null) { + return routePolylineBuilder_.getMessageOrBuilder(); + } else { + return routePolyline_ == null + ? com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + .getDefaultInstance() + : routePolyline_; + } + } + /** + * + * + *
+     * The encoded polyline representation of the route.
+     * This field is only populated if
+     * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+     * is set to true.
+     * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder> + getRoutePolylineFieldBuilder() { + if (routePolylineBuilder_ == null) { + routePolylineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder>( + getRoutePolyline(), getParentForChildren(), isClean()); + routePolyline_ = null; + } + return routePolylineBuilder_; + } + + private java.util.List breaks_ = + java.util.Collections.emptyList(); + + private void ensureBreaksIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + breaks_ = + new java.util.ArrayList( + breaks_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Break, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder> + breaksBuilder_; + + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public java.util.List + getBreaksList() { + if (breaksBuilder_ == null) { + return java.util.Collections.unmodifiableList(breaks_); + } else { + return breaksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public int getBreaksCount() { + if (breaksBuilder_ == null) { + return breaks_.size(); + } else { + return breaksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break getBreaks(int index) { + if (breaksBuilder_ == null) { + return breaks_.get(index); + } else { + return breaksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder setBreaks( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Break value) { + if (breaksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBreaksIsMutable(); + breaks_.set(index, value); + onChanged(); + } else { + breaksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder setBreaks( + int index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder builderForValue) { + if (breaksBuilder_ == null) { + ensureBreaksIsMutable(); + breaks_.set(index, builderForValue.build()); + onChanged(); + } else { + breaksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder addBreaks(com.google.maps.routeoptimization.v1.ShipmentRoute.Break value) { + if (breaksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBreaksIsMutable(); + breaks_.add(value); + onChanged(); + } else { + breaksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder addBreaks( + int index, com.google.maps.routeoptimization.v1.ShipmentRoute.Break value) { + if (breaksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBreaksIsMutable(); + breaks_.add(index, value); + onChanged(); + } else { + breaksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder addBreaks( + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder builderForValue) { + if (breaksBuilder_ == null) { + ensureBreaksIsMutable(); + breaks_.add(builderForValue.build()); + onChanged(); + } else { + breaksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder addBreaks( + int index, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder builderForValue) { + if (breaksBuilder_ == null) { + ensureBreaksIsMutable(); + breaks_.add(index, builderForValue.build()); + onChanged(); + } else { + breaksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder addAllBreaks( + java.lang.Iterable + values) { + if (breaksBuilder_ == null) { + ensureBreaksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, breaks_); + onChanged(); + } else { + breaksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder clearBreaks() { + if (breaksBuilder_ == null) { + breaks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + breaksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public Builder removeBreaks(int index) { + if (breaksBuilder_ == null) { + ensureBreaksIsMutable(); + breaks_.remove(index); + onChanged(); + } else { + breaksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder getBreaksBuilder( + int index) { + return getBreaksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder getBreaksOrBuilder( + int index) { + if (breaksBuilder_ == null) { + return breaks_.get(index); + } else { + return breaksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder> + getBreaksOrBuilderList() { + if (breaksBuilder_ != null) { + return breaksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(breaks_); + } + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder addBreaksBuilder() { + return getBreaksFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.getDefaultInstance()); + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder addBreaksBuilder( + int index) { + return getBreaksFieldBuilder() + .addBuilder( + index, com.google.maps.routeoptimization.v1.ShipmentRoute.Break.getDefaultInstance()); + } + /** + * + * + *
+     * Breaks scheduled for the vehicle performing this route.
+     * The `breaks` sequence represents time intervals, each starting at the
+     * corresponding `start_time` and lasting `duration` seconds.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + public java.util.List + getBreaksBuilderList() { + return getBreaksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Break, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder> + getBreaksFieldBuilder() { + if (breaksBuilder_ == null) { + breaksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.ShipmentRoute.Break, + com.google.maps.routeoptimization.v1.ShipmentRoute.Break.Builder, + com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder>( + breaks_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean()); + breaks_ = null; + } + return breaksBuilder_; + } + + private com.google.maps.routeoptimization.v1.AggregatedMetrics metrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.AggregatedMetrics, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder, + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder> + metricsBuilder_; + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * + * @return Whether the metrics field is set. + */ + public boolean hasMetrics() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * + * @return The metrics. + */ + public com.google.maps.routeoptimization.v1.AggregatedMetrics getMetrics() { + if (metricsBuilder_ == null) { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : metrics_; + } else { + return metricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + public Builder setMetrics(com.google.maps.routeoptimization.v1.AggregatedMetrics value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metrics_ = value; + } else { + metricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + public Builder setMetrics( + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder builderForValue) { + if (metricsBuilder_ == null) { + metrics_ = builderForValue.build(); + } else { + metricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + public Builder mergeMetrics(com.google.maps.routeoptimization.v1.AggregatedMetrics value) { + if (metricsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && metrics_ != null + && metrics_ + != com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance()) { + getMetricsBuilder().mergeFrom(value); + } else { + metrics_ = value; + } + } else { + metricsBuilder_.mergeFrom(value); + } + if (metrics_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + public Builder clearMetrics() { + bitField0_ = (bitField0_ & ~0x00000200); + metrics_ = null; + if (metricsBuilder_ != null) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + public com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder getMetricsBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + public com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder getMetricsOrBuilder() { + if (metricsBuilder_ != null) { + return metricsBuilder_.getMessageOrBuilder(); + } else { + return metrics_ == null + ? com.google.maps.routeoptimization.v1.AggregatedMetrics.getDefaultInstance() + : metrics_; + } + } + /** + * + * + *
+     * Duration, distance and load metrics for this route. The fields of
+     * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+     * summed over all
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * or
+     * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+     * depending on the context.
+     * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.AggregatedMetrics, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder, + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder> + getMetricsFieldBuilder() { + if (metricsBuilder_ == null) { + metricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.AggregatedMetrics, + com.google.maps.routeoptimization.v1.AggregatedMetrics.Builder, + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder>( + getMetrics(), getParentForChildren(), isClean()); + metrics_ = null; + } + return metricsBuilder_; + } + + private com.google.protobuf.MapField routeCosts_; + + private com.google.protobuf.MapField + internalGetRouteCosts() { + if (routeCosts_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RouteCostsDefaultEntryHolder.defaultEntry); + } + return routeCosts_; + } + + private com.google.protobuf.MapField + internalGetMutableRouteCosts() { + if (routeCosts_ == null) { + routeCosts_ = + com.google.protobuf.MapField.newMapField(RouteCostsDefaultEntryHolder.defaultEntry); + } + if (!routeCosts_.isMutable()) { + routeCosts_ = routeCosts_.copy(); + } + bitField0_ |= 0x00000400; + onChanged(); + return routeCosts_; + } + + public int getRouteCostsCount() { + return internalGetRouteCosts().getMap().size(); + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public boolean containsRouteCosts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRouteCosts().getMap().containsKey(key); + } + /** Use {@link #getRouteCostsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRouteCosts() { + return getRouteCostsMap(); + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public java.util.Map getRouteCostsMap() { + return internalGetRouteCosts().getMap(); + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public double getRouteCostsOrDefault(java.lang.String key, double defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRouteCosts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + @java.lang.Override + public double getRouteCostsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRouteCosts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRouteCosts() { + bitField0_ = (bitField0_ & ~0x00000400); + internalGetMutableRouteCosts().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + public Builder removeRouteCosts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableRouteCosts().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableRouteCosts() { + bitField0_ |= 0x00000400; + return internalGetMutableRouteCosts().getMutableMap(); + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + public Builder putRouteCosts(java.lang.String key, double value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableRouteCosts().getMutableMap().put(key, value); + bitField0_ |= 0x00000400; + return this; + } + /** + * + * + *
+     * Cost of the route, broken down by cost-related request fields.
+     * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+     * "model.shipments.pickups.cost", and the values are the total cost
+     * generated by the corresponding cost field, aggregated over the whole route.
+     * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+     * pickup costs over the route. All costs defined in the model are reported in
+     * detail here with the exception of costs related to TransitionAttributes
+     * that are only reported in an aggregated way as of 2022/01.
+     * 
+ * + * map<string, double> route_costs = 17; + */ + public Builder putAllRouteCosts(java.util.Map values) { + internalGetMutableRouteCosts().getMutableMap().putAll(values); + bitField0_ |= 0x00000400; + return this; + } + + private double routeTotalCost_; + /** + * + * + *
+     * Total cost of the route. The sum of all costs in the cost map.
+     * 
+ * + * double route_total_cost = 18; + * + * @return The routeTotalCost. + */ + @java.lang.Override + public double getRouteTotalCost() { + return routeTotalCost_; + } + /** + * + * + *
+     * Total cost of the route. The sum of all costs in the cost map.
+     * 
+ * + * double route_total_cost = 18; + * + * @param value The routeTotalCost to set. + * @return This builder for chaining. + */ + public Builder setRouteTotalCost(double value) { + + routeTotalCost_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Total cost of the route. The sum of all costs in the cost map.
+     * 
+ * + * double route_total_cost = 18; + * + * @return This builder for chaining. + */ + public Builder clearRouteTotalCost() { + bitField0_ = (bitField0_ & ~0x00000800); + routeTotalCost_ = 0D; + 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.ShipmentRoute) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentRoute) + private static final com.google.maps.routeoptimization.v1.ShipmentRoute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentRoute(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentRoute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShipmentRoute 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.ShipmentRoute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentRouteOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentRouteOrBuilder.java new file mode 100644 index 000000000000..5b46ea407053 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentRouteOrBuilder.java @@ -0,0 +1,553 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface ShipmentRouteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentRoute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Vehicle performing the route, identified by its index in the source
+   * `ShipmentModel`.
+   * 
+ * + * int32 vehicle_index = 1; + * + * @return The vehicleIndex. + */ + int getVehicleIndex(); + + /** + * + * + *
+   * Label of the vehicle performing this route, equal to
+   * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+   * 
+ * + * string vehicle_label = 2; + * + * @return The vehicleLabel. + */ + java.lang.String getVehicleLabel(); + /** + * + * + *
+   * Label of the vehicle performing this route, equal to
+   * `ShipmentModel.vehicles(vehicle_index).label`, if specified.
+   * 
+ * + * string vehicle_label = 2; + * + * @return The bytes for vehicleLabel. + */ + com.google.protobuf.ByteString getVehicleLabelBytes(); + + /** + * + * + *
+   * Time at which the vehicle starts its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + * + * @return Whether the vehicleStartTime field is set. + */ + boolean hasVehicleStartTime(); + /** + * + * + *
+   * Time at which the vehicle starts its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + * + * @return The vehicleStartTime. + */ + com.google.protobuf.Timestamp getVehicleStartTime(); + /** + * + * + *
+   * Time at which the vehicle starts its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_start_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getVehicleStartTimeOrBuilder(); + + /** + * + * + *
+   * Time at which the vehicle finishes its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + * + * @return Whether the vehicleEndTime field is set. + */ + boolean hasVehicleEndTime(); + /** + * + * + *
+   * Time at which the vehicle finishes its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + * + * @return The vehicleEndTime. + */ + com.google.protobuf.Timestamp getVehicleEndTime(); + /** + * + * + *
+   * Time at which the vehicle finishes its route.
+   * 
+ * + * .google.protobuf.Timestamp vehicle_end_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getVehicleEndTimeOrBuilder(); + + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + java.util.List getVisitsList(); + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.Visit getVisits(int index); + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + int getVisitsCount(); + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + java.util.List + getVisitsOrBuilderList(); + /** + * + * + *
+   * Ordered sequence of visits representing a route.
+   * visits[i] is the i-th visit in the route.
+   * If this field is empty, the vehicle is considered as unused.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.VisitOrBuilder getVisitsOrBuilder(int index); + + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + java.util.List + getTransitionsList(); + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.Transition getTransitions(int index); + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + int getTransitionsCount(); + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + java.util.List + getTransitionsOrBuilderList(); + /** + * + * + *
+   * Ordered list of transitions for the route.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.TransitionOrBuilder getTransitionsOrBuilder( + int index); + + /** + * + * + *
+   * When
+   * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic],
+   * is set to true, this field indicates that inconsistencies in route timings
+   * are predicted using traffic-based travel duration estimates. There may be
+   * insufficient time to complete traffic-adjusted travel, delays, and breaks
+   * between visits, before the first visit, or after the last visit, while
+   * still satisfying the visit and vehicle time windows. For example,
+   *
+   * ```
+   *   start_time(previous_visit) + duration(previous_visit) +
+   *   travel_duration(previous_visit, next_visit) > start_time(next_visit)
+   * ```
+   *
+   * Arrival at next_visit will likely happen later than its current
+   * time window due the increased estimate of travel time
+   * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break
+   * may be forced to overlap with a visit due to an increase in travel time
+   * estimates and visit or break time window restrictions.
+   * 
+ * + * bool has_traffic_infeasibilities = 9; + * + * @return The hasTrafficInfeasibilities. + */ + boolean getHasTrafficInfeasibilities(); + + /** + * + * + *
+   * The encoded polyline representation of the route.
+   * This field is only populated if
+   * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+   * is set to true.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + * + * @return Whether the routePolyline field is set. + */ + boolean hasRoutePolyline(); + /** + * + * + *
+   * The encoded polyline representation of the route.
+   * This field is only populated if
+   * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+   * is set to true.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + * + * @return The routePolyline. + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline getRoutePolyline(); + /** + * + * + *
+   * The encoded polyline representation of the route.
+   * This field is only populated if
+   * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines]
+   * is set to true.
+   * 
+ * + * .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolylineOrBuilder + getRoutePolylineOrBuilder(); + + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + java.util.List getBreaksList(); + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.Break getBreaks(int index); + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + int getBreaksCount(); + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + java.util.List + getBreaksOrBuilderList(); + /** + * + * + *
+   * Breaks scheduled for the vehicle performing this route.
+   * The `breaks` sequence represents time intervals, each starting at the
+   * corresponding `start_time` and lasting `duration` seconds.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + com.google.maps.routeoptimization.v1.ShipmentRoute.BreakOrBuilder getBreaksOrBuilder(int index); + + /** + * + * + *
+   * Duration, distance and load metrics for this route. The fields of
+   * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+   * summed over all
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * or
+   * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+   * depending on the context.
+   * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * + * @return Whether the metrics field is set. + */ + boolean hasMetrics(); + /** + * + * + *
+   * Duration, distance and load metrics for this route. The fields of
+   * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+   * summed over all
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * or
+   * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+   * depending on the context.
+   * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * + * @return The metrics. + */ + com.google.maps.routeoptimization.v1.AggregatedMetrics getMetrics(); + /** + * + * + *
+   * Duration, distance and load metrics for this route. The fields of
+   * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are
+   * summed over all
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * or
+   * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits],
+   * depending on the context.
+   * 
+ * + * .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + com.google.maps.routeoptimization.v1.AggregatedMetricsOrBuilder getMetricsOrBuilder(); + + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + int getRouteCostsCount(); + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + boolean containsRouteCosts(java.lang.String key); + /** Use {@link #getRouteCostsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRouteCosts(); + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + java.util.Map getRouteCostsMap(); + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + double getRouteCostsOrDefault(java.lang.String key, double defaultValue); + /** + * + * + *
+   * Cost of the route, broken down by cost-related request fields.
+   * The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
+   * "model.shipments.pickups.cost", and the values are the total cost
+   * generated by the corresponding cost field, aggregated over the whole route.
+   * In other words, costs["model.shipments.pickups.cost"] is the sum of all
+   * pickup costs over the route. All costs defined in the model are reported in
+   * detail here with the exception of costs related to TransitionAttributes
+   * that are only reported in an aggregated way as of 2022/01.
+   * 
+ * + * map<string, double> route_costs = 17; + */ + double getRouteCostsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Total cost of the route. The sum of all costs in the cost map.
+   * 
+ * + * double route_total_cost = 18; + * + * @return The routeTotalCost. + */ + double getRouteTotalCost(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeIncompatibility.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeIncompatibility.java new file mode 100644 index 000000000000..6d801219a092 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeIncompatibility.java @@ -0,0 +1,1105 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Specifies incompatibilties between shipments depending on their
+ * shipment_type. The appearance of incompatible shipments on the same route is
+ * restricted based on the incompatibility mode.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} + */ +public final class ShipmentTypeIncompatibility extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) + ShipmentTypeIncompatibilityOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShipmentTypeIncompatibility.newBuilder() to construct. + private ShipmentTypeIncompatibility(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ShipmentTypeIncompatibility() { + types_ = com.google.protobuf.LazyStringArrayList.emptyList(); + incompatibilityMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ShipmentTypeIncompatibility(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.class, + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder.class); + } + + /** + * + * + *
+   * Modes defining how the appearance of incompatible shipments are restricted
+   * on the same route.
+   * 
+ * + * Protobuf enum {@code + * google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode} + */ + public enum IncompatibilityMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified incompatibility mode. This value should never be used.
+     * 
+ * + * INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + */ + INCOMPATIBILITY_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * In this mode, two shipments with incompatible types can never share the
+     * same vehicle.
+     * 
+ * + * NOT_PERFORMED_BY_SAME_VEHICLE = 1; + */ + NOT_PERFORMED_BY_SAME_VEHICLE(1), + /** + * + * + *
+     * For two shipments with incompatible types with the
+     * `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode:
+     *
+     * * If both are pickups only (no deliveries) or deliveries only (no
+     *   pickups), they cannot share the same vehicle at all.
+     * * If one of the shipments has a delivery and the other a pickup, the two
+     *   shipments can share the same vehicle iff the former shipment is
+     *   delivered before the latter is picked up.
+     * 
+ * + * NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + */ + NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified incompatibility mode. This value should never be used.
+     * 
+ * + * INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + */ + public static final int INCOMPATIBILITY_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * In this mode, two shipments with incompatible types can never share the
+     * same vehicle.
+     * 
+ * + * NOT_PERFORMED_BY_SAME_VEHICLE = 1; + */ + public static final int NOT_PERFORMED_BY_SAME_VEHICLE_VALUE = 1; + /** + * + * + *
+     * For two shipments with incompatible types with the
+     * `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode:
+     *
+     * * If both are pickups only (no deliveries) or deliveries only (no
+     *   pickups), they cannot share the same vehicle at all.
+     * * If one of the shipments has a delivery and the other a pickup, the two
+     *   shipments can share the same vehicle iff the former shipment is
+     *   delivered before the latter is picked up.
+     * 
+ * + * NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + */ + public static final int NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IncompatibilityMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static IncompatibilityMode forNumber(int value) { + switch (value) { + case 0: + return INCOMPATIBILITY_MODE_UNSPECIFIED; + case 1: + return NOT_PERFORMED_BY_SAME_VEHICLE; + case 2: + return NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public IncompatibilityMode findValueByNumber(int number) { + return IncompatibilityMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final IncompatibilityMode[] VALUES = values(); + + public static IncompatibilityMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private IncompatibilityMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode) + } + + public static final int TYPES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList types_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @return A list containing the types. + */ + public com.google.protobuf.ProtocolStringList getTypesList() { + return types_; + } + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @return The count of types. + */ + public int getTypesCount() { + return types_.size(); + } + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + public java.lang.String getTypes(int index) { + return types_.get(index); + } + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + public com.google.protobuf.ByteString getTypesBytes(int index) { + return types_.getByteString(index); + } + + public static final int INCOMPATIBILITY_MODE_FIELD_NUMBER = 2; + private int incompatibilityMode_ = 0; + /** + * + * + *
+   * Mode applied to the incompatibility.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return The enum numeric value on the wire for incompatibilityMode. + */ + @java.lang.Override + public int getIncompatibilityModeValue() { + return incompatibilityMode_; + } + /** + * + * + *
+   * Mode applied to the incompatibility.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return The incompatibilityMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + getIncompatibilityMode() { + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode result = + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + .forNumber(incompatibilityMode_); + return result == null + ? com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + .UNRECOGNIZED + : result; + } + + 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 < types_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, types_.getRaw(i)); + } + if (incompatibilityMode_ + != com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + .INCOMPATIBILITY_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, incompatibilityMode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < types_.size(); i++) { + dataSize += computeStringSizeNoTag(types_.getRaw(i)); + } + size += dataSize; + size += 1 * getTypesList().size(); + } + if (incompatibilityMode_ + != com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + .INCOMPATIBILITY_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, incompatibilityMode_); + } + 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.ShipmentTypeIncompatibility)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility other = + (com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) obj; + + if (!getTypesList().equals(other.getTypesList())) return false; + if (incompatibilityMode_ != other.incompatibilityMode_) 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 (getTypesCount() > 0) { + hash = (37 * hash) + TYPES_FIELD_NUMBER; + hash = (53 * hash) + getTypesList().hashCode(); + } + hash = (37 * hash) + INCOMPATIBILITY_MODE_FIELD_NUMBER; + hash = (53 * hash) + incompatibilityMode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility 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 incompatibilties between shipments depending on their
+   * shipment_type. The appearance of incompatible shipments on the same route is
+   * restricted based on the incompatibility mode.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibilityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeIncompatibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.class, + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + types_ = com.google.protobuf.LazyStringArrayList.emptyList(); + incompatibilityMode_ = 0; + 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_ShipmentTypeIncompatibility_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility build() { + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility result = + new com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + types_.makeImmutable(); + result.types_ = types_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.incompatibilityMode_ = incompatibilityMode_; + } + } + + @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.ShipmentTypeIncompatibility) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility other) { + if (other + == com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.getDefaultInstance()) + return this; + if (!other.types_.isEmpty()) { + if (types_.isEmpty()) { + types_ = other.types_; + bitField0_ |= 0x00000001; + } else { + ensureTypesIsMutable(); + types_.addAll(other.types_); + } + onChanged(); + } + if (other.incompatibilityMode_ != 0) { + setIncompatibilityModeValue(other.getIncompatibilityModeValue()); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTypesIsMutable(); + types_.add(s); + break; + } // case 10 + case 16: + { + incompatibilityMode_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList types_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTypesIsMutable() { + if (!types_.isModifiable()) { + types_ = new com.google.protobuf.LazyStringArrayList(types_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @return A list containing the types. + */ + public com.google.protobuf.ProtocolStringList getTypesList() { + types_.makeImmutable(); + return types_; + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @return The count of types. + */ + public int getTypesCount() { + return types_.size(); + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + public java.lang.String getTypes(int index) { + return types_.get(index); + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + public com.google.protobuf.ByteString getTypesBytes(int index) { + return types_.getByteString(index); + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @param index The index to set the value at. + * @param value The types to set. + * @return This builder for chaining. + */ + public Builder setTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypesIsMutable(); + types_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @param value The types to add. + * @return This builder for chaining. + */ + public Builder addTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypesIsMutable(); + types_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @param values The types to add. + * @return This builder for chaining. + */ + public Builder addAllTypes(java.lang.Iterable values) { + ensureTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, types_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @return This builder for chaining. + */ + public Builder clearTypes() { + types_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * List of incompatible types. Two shipments having different `shipment_types`
+     * among those listed are "incompatible".
+     * 
+ * + * repeated string types = 1; + * + * @param value The bytes of the types to add. + * @return This builder for chaining. + */ + public Builder addTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTypesIsMutable(); + types_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int incompatibilityMode_ = 0; + /** + * + * + *
+     * Mode applied to the incompatibility.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return The enum numeric value on the wire for incompatibilityMode. + */ + @java.lang.Override + public int getIncompatibilityModeValue() { + return incompatibilityMode_; + } + /** + * + * + *
+     * Mode applied to the incompatibility.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @param value The enum numeric value on the wire for incompatibilityMode to set. + * @return This builder for chaining. + */ + public Builder setIncompatibilityModeValue(int value) { + incompatibilityMode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Mode applied to the incompatibility.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return The incompatibilityMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + getIncompatibilityMode() { + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode result = + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + .forNumber(incompatibilityMode_); + return result == null + ? com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Mode applied to the incompatibility.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @param value The incompatibilityMode to set. + * @return This builder for chaining. + */ + public Builder setIncompatibilityMode( + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + incompatibilityMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Mode applied to the incompatibility.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearIncompatibilityMode() { + bitField0_ = (bitField0_ & ~0x00000002); + incompatibilityMode_ = 0; + 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.ShipmentTypeIncompatibility) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) + private static final com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShipmentTypeIncompatibility 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.ShipmentTypeIncompatibility + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeIncompatibilityOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeIncompatibilityOrBuilder.java new file mode 100644 index 000000000000..362b09b1b4db --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeIncompatibilityOrBuilder.java @@ -0,0 +1,111 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface ShipmentTypeIncompatibilityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @return A list containing the types. + */ + java.util.List getTypesList(); + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @return The count of types. + */ + int getTypesCount(); + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + java.lang.String getTypes(int index); + /** + * + * + *
+   * List of incompatible types. Two shipments having different `shipment_types`
+   * among those listed are "incompatible".
+   * 
+ * + * repeated string types = 1; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + com.google.protobuf.ByteString getTypesBytes(int index); + + /** + * + * + *
+   * Mode applied to the incompatibility.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return The enum numeric value on the wire for incompatibilityMode. + */ + int getIncompatibilityModeValue(); + /** + * + * + *
+   * Mode applied to the incompatibility.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * + * + * @return The incompatibilityMode. + */ + com.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + getIncompatibilityMode(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeRequirement.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeRequirement.java new file mode 100644 index 000000000000..938351d20329 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeRequirement.java @@ -0,0 +1,1473 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Specifies requirements between shipments based on their shipment_type.
+ * The specifics of the requirement are defined by the requirement mode.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentTypeRequirement} + */ +public final class ShipmentTypeRequirement extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.ShipmentTypeRequirement) + ShipmentTypeRequirementOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShipmentTypeRequirement.newBuilder() to construct. + private ShipmentTypeRequirement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ShipmentTypeRequirement() { + requiredShipmentTypeAlternatives_ = com.google.protobuf.LazyStringArrayList.emptyList(); + dependentShipmentTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + requirementMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ShipmentTypeRequirement(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.class, + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder.class); + } + + /** + * + * + *
+   * Modes defining the appearance of dependent shipments on a route.
+   * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode} + */ + public enum RequirementMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified requirement mode. This value should never be used.
+     * 
+ * + * REQUIREMENT_MODE_UNSPECIFIED = 0; + */ + REQUIREMENT_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * In this mode, all "dependent" shipments must share the same vehicle as at
+     * least one of their "required" shipments.
+     * 
+ * + * PERFORMED_BY_SAME_VEHICLE = 1; + */ + PERFORMED_BY_SAME_VEHICLE(1), + /** + * + * + *
+     * With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent"
+     * shipments need to have at least one "required" shipment on their vehicle
+     * at the time of their pickup.
+     *
+     * A "dependent" shipment pickup must therefore have either:
+     *
+     * * A delivery-only "required" shipment delivered on the route after, or
+     * * A "required" shipment picked up on the route before it, and if the
+     *   "required" shipment has a delivery, this delivery must be performed
+     *   after the "dependent" shipment's pickup.
+     * 
+ * + * IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + */ + IN_SAME_VEHICLE_AT_PICKUP_TIME(2), + /** + * + * + *
+     * Same as before, except the "dependent" shipments need to have a
+     * "required" shipment on their vehicle at the time of their *delivery*.
+     * 
+ * + * IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + */ + IN_SAME_VEHICLE_AT_DELIVERY_TIME(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified requirement mode. This value should never be used.
+     * 
+ * + * REQUIREMENT_MODE_UNSPECIFIED = 0; + */ + public static final int REQUIREMENT_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * In this mode, all "dependent" shipments must share the same vehicle as at
+     * least one of their "required" shipments.
+     * 
+ * + * PERFORMED_BY_SAME_VEHICLE = 1; + */ + public static final int PERFORMED_BY_SAME_VEHICLE_VALUE = 1; + /** + * + * + *
+     * With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent"
+     * shipments need to have at least one "required" shipment on their vehicle
+     * at the time of their pickup.
+     *
+     * A "dependent" shipment pickup must therefore have either:
+     *
+     * * A delivery-only "required" shipment delivered on the route after, or
+     * * A "required" shipment picked up on the route before it, and if the
+     *   "required" shipment has a delivery, this delivery must be performed
+     *   after the "dependent" shipment's pickup.
+     * 
+ * + * IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + */ + public static final int IN_SAME_VEHICLE_AT_PICKUP_TIME_VALUE = 2; + /** + * + * + *
+     * Same as before, except the "dependent" shipments need to have a
+     * "required" shipment on their vehicle at the time of their *delivery*.
+     * 
+ * + * IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + */ + public static final int IN_SAME_VEHICLE_AT_DELIVERY_TIME_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequirementMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RequirementMode forNumber(int value) { + switch (value) { + case 0: + return REQUIREMENT_MODE_UNSPECIFIED; + case 1: + return PERFORMED_BY_SAME_VEHICLE; + case 2: + return IN_SAME_VEHICLE_AT_PICKUP_TIME; + case 3: + return IN_SAME_VEHICLE_AT_DELIVERY_TIME; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RequirementMode findValueByNumber(int number) { + return RequirementMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RequirementMode[] VALUES = values(); + + public static RequirementMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RequirementMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode) + } + + public static final int REQUIRED_SHIPMENT_TYPE_ALTERNATIVES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList requiredShipmentTypeAlternatives_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return A list containing the requiredShipmentTypeAlternatives. + */ + public com.google.protobuf.ProtocolStringList getRequiredShipmentTypeAlternativesList() { + return requiredShipmentTypeAlternatives_; + } + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return The count of requiredShipmentTypeAlternatives. + */ + public int getRequiredShipmentTypeAlternativesCount() { + return requiredShipmentTypeAlternatives_.size(); + } + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index of the element to return. + * @return The requiredShipmentTypeAlternatives at the given index. + */ + public java.lang.String getRequiredShipmentTypeAlternatives(int index) { + return requiredShipmentTypeAlternatives_.get(index); + } + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index of the value to return. + * @return The bytes of the requiredShipmentTypeAlternatives at the given index. + */ + public com.google.protobuf.ByteString getRequiredShipmentTypeAlternativesBytes(int index) { + return requiredShipmentTypeAlternatives_.getByteString(index); + } + + public static final int DEPENDENT_SHIPMENT_TYPES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dependentShipmentTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return A list containing the dependentShipmentTypes. + */ + public com.google.protobuf.ProtocolStringList getDependentShipmentTypesList() { + return dependentShipmentTypes_; + } + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return The count of dependentShipmentTypes. + */ + public int getDependentShipmentTypesCount() { + return dependentShipmentTypes_.size(); + } + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index of the element to return. + * @return The dependentShipmentTypes at the given index. + */ + public java.lang.String getDependentShipmentTypes(int index) { + return dependentShipmentTypes_.get(index); + } + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the dependentShipmentTypes at the given index. + */ + public com.google.protobuf.ByteString getDependentShipmentTypesBytes(int index) { + return dependentShipmentTypes_.getByteString(index); + } + + public static final int REQUIREMENT_MODE_FIELD_NUMBER = 3; + private int requirementMode_ = 0; + /** + * + * + *
+   * Mode applied to the requirement.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return The enum numeric value on the wire for requirementMode. + */ + @java.lang.Override + public int getRequirementModeValue() { + return requirementMode_; + } + /** + * + * + *
+   * Mode applied to the requirement.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return The requirementMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + getRequirementMode() { + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode result = + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode.forNumber( + requirementMode_); + return result == null + ? com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode.UNRECOGNIZED + : result; + } + + 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 < requiredShipmentTypeAlternatives_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, requiredShipmentTypeAlternatives_.getRaw(i)); + } + for (int i = 0; i < dependentShipmentTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 2, dependentShipmentTypes_.getRaw(i)); + } + if (requirementMode_ + != com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + .REQUIREMENT_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, requirementMode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < requiredShipmentTypeAlternatives_.size(); i++) { + dataSize += computeStringSizeNoTag(requiredShipmentTypeAlternatives_.getRaw(i)); + } + size += dataSize; + size += 1 * getRequiredShipmentTypeAlternativesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < dependentShipmentTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(dependentShipmentTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getDependentShipmentTypesList().size(); + } + if (requirementMode_ + != com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + .REQUIREMENT_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, requirementMode_); + } + 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.ShipmentTypeRequirement)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement other = + (com.google.maps.routeoptimization.v1.ShipmentTypeRequirement) obj; + + if (!getRequiredShipmentTypeAlternativesList() + .equals(other.getRequiredShipmentTypeAlternativesList())) return false; + if (!getDependentShipmentTypesList().equals(other.getDependentShipmentTypesList())) + return false; + if (requirementMode_ != other.requirementMode_) 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 (getRequiredShipmentTypeAlternativesCount() > 0) { + hash = (37 * hash) + REQUIRED_SHIPMENT_TYPE_ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getRequiredShipmentTypeAlternativesList().hashCode(); + } + if (getDependentShipmentTypesCount() > 0) { + hash = (37 * hash) + DEPENDENT_SHIPMENT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getDependentShipmentTypesList().hashCode(); + } + hash = (37 * hash) + REQUIREMENT_MODE_FIELD_NUMBER; + hash = (53 * hash) + requirementMode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement 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.ShipmentTypeRequirement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement 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.ShipmentTypeRequirement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement 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.ShipmentTypeRequirement parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement 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.ShipmentTypeRequirement parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement 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.ShipmentTypeRequirement 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.ShipmentTypeRequirement 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.ShipmentTypeRequirement 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 requirements between shipments based on their shipment_type.
+   * The specifics of the requirement are defined by the requirement mode.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.ShipmentTypeRequirement} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.ShipmentTypeRequirement) + com.google.maps.routeoptimization.v1.ShipmentTypeRequirementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_ShipmentTypeRequirement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.class, + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + requiredShipmentTypeAlternatives_ = com.google.protobuf.LazyStringArrayList.emptyList(); + dependentShipmentTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + requirementMode_ = 0; + 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_ShipmentTypeRequirement_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement build() { + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement buildPartial() { + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement result = + new com.google.maps.routeoptimization.v1.ShipmentTypeRequirement(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + requiredShipmentTypeAlternatives_.makeImmutable(); + result.requiredShipmentTypeAlternatives_ = requiredShipmentTypeAlternatives_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + dependentShipmentTypes_.makeImmutable(); + result.dependentShipmentTypes_ = dependentShipmentTypes_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requirementMode_ = requirementMode_; + } + } + + @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.ShipmentTypeRequirement) { + return mergeFrom((com.google.maps.routeoptimization.v1.ShipmentTypeRequirement) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.ShipmentTypeRequirement other) { + if (other + == com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.getDefaultInstance()) + return this; + if (!other.requiredShipmentTypeAlternatives_.isEmpty()) { + if (requiredShipmentTypeAlternatives_.isEmpty()) { + requiredShipmentTypeAlternatives_ = other.requiredShipmentTypeAlternatives_; + bitField0_ |= 0x00000001; + } else { + ensureRequiredShipmentTypeAlternativesIsMutable(); + requiredShipmentTypeAlternatives_.addAll(other.requiredShipmentTypeAlternatives_); + } + onChanged(); + } + if (!other.dependentShipmentTypes_.isEmpty()) { + if (dependentShipmentTypes_.isEmpty()) { + dependentShipmentTypes_ = other.dependentShipmentTypes_; + bitField0_ |= 0x00000002; + } else { + ensureDependentShipmentTypesIsMutable(); + dependentShipmentTypes_.addAll(other.dependentShipmentTypes_); + } + onChanged(); + } + if (other.requirementMode_ != 0) { + setRequirementModeValue(other.getRequirementModeValue()); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRequiredShipmentTypeAlternativesIsMutable(); + requiredShipmentTypeAlternatives_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDependentShipmentTypesIsMutable(); + dependentShipmentTypes_.add(s); + break; + } // case 18 + case 24: + { + requirementMode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList requiredShipmentTypeAlternatives_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRequiredShipmentTypeAlternativesIsMutable() { + if (!requiredShipmentTypeAlternatives_.isModifiable()) { + requiredShipmentTypeAlternatives_ = + new com.google.protobuf.LazyStringArrayList(requiredShipmentTypeAlternatives_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return A list containing the requiredShipmentTypeAlternatives. + */ + public com.google.protobuf.ProtocolStringList getRequiredShipmentTypeAlternativesList() { + requiredShipmentTypeAlternatives_.makeImmutable(); + return requiredShipmentTypeAlternatives_; + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return The count of requiredShipmentTypeAlternatives. + */ + public int getRequiredShipmentTypeAlternativesCount() { + return requiredShipmentTypeAlternatives_.size(); + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index of the element to return. + * @return The requiredShipmentTypeAlternatives at the given index. + */ + public java.lang.String getRequiredShipmentTypeAlternatives(int index) { + return requiredShipmentTypeAlternatives_.get(index); + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index of the value to return. + * @return The bytes of the requiredShipmentTypeAlternatives at the given index. + */ + public com.google.protobuf.ByteString getRequiredShipmentTypeAlternativesBytes(int index) { + return requiredShipmentTypeAlternatives_.getByteString(index); + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index to set the value at. + * @param value The requiredShipmentTypeAlternatives to set. + * @return This builder for chaining. + */ + public Builder setRequiredShipmentTypeAlternatives(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredShipmentTypeAlternativesIsMutable(); + requiredShipmentTypeAlternatives_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param value The requiredShipmentTypeAlternatives to add. + * @return This builder for chaining. + */ + public Builder addRequiredShipmentTypeAlternatives(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredShipmentTypeAlternativesIsMutable(); + requiredShipmentTypeAlternatives_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param values The requiredShipmentTypeAlternatives to add. + * @return This builder for chaining. + */ + public Builder addAllRequiredShipmentTypeAlternatives( + java.lang.Iterable values) { + ensureRequiredShipmentTypeAlternativesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, requiredShipmentTypeAlternatives_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return This builder for chaining. + */ + public Builder clearRequiredShipmentTypeAlternatives() { + requiredShipmentTypeAlternatives_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * List of alternative shipment types required by the
+     * `dependent_shipment_types`.
+     * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param value The bytes of the requiredShipmentTypeAlternatives to add. + * @return This builder for chaining. + */ + public Builder addRequiredShipmentTypeAlternativesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRequiredShipmentTypeAlternativesIsMutable(); + requiredShipmentTypeAlternatives_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList dependentShipmentTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDependentShipmentTypesIsMutable() { + if (!dependentShipmentTypes_.isModifiable()) { + dependentShipmentTypes_ = + new com.google.protobuf.LazyStringArrayList(dependentShipmentTypes_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return A list containing the dependentShipmentTypes. + */ + public com.google.protobuf.ProtocolStringList getDependentShipmentTypesList() { + dependentShipmentTypes_.makeImmutable(); + return dependentShipmentTypes_; + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return The count of dependentShipmentTypes. + */ + public int getDependentShipmentTypesCount() { + return dependentShipmentTypes_.size(); + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index of the element to return. + * @return The dependentShipmentTypes at the given index. + */ + public java.lang.String getDependentShipmentTypes(int index) { + return dependentShipmentTypes_.get(index); + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the dependentShipmentTypes at the given index. + */ + public com.google.protobuf.ByteString getDependentShipmentTypesBytes(int index) { + return dependentShipmentTypes_.getByteString(index); + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index to set the value at. + * @param value The dependentShipmentTypes to set. + * @return This builder for chaining. + */ + public Builder setDependentShipmentTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependentShipmentTypesIsMutable(); + dependentShipmentTypes_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param value The dependentShipmentTypes to add. + * @return This builder for chaining. + */ + public Builder addDependentShipmentTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependentShipmentTypesIsMutable(); + dependentShipmentTypes_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param values The dependentShipmentTypes to add. + * @return This builder for chaining. + */ + public Builder addAllDependentShipmentTypes(java.lang.Iterable values) { + ensureDependentShipmentTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dependentShipmentTypes_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return This builder for chaining. + */ + public Builder clearDependentShipmentTypes() { + dependentShipmentTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * All shipments with a type in the `dependent_shipment_types` field require
+     * at least one shipment of type `required_shipment_type_alternatives` to be
+     * visited on the same route.
+     *
+     * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+     * are not allowed.
+     * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param value The bytes of the dependentShipmentTypes to add. + * @return This builder for chaining. + */ + public Builder addDependentShipmentTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDependentShipmentTypesIsMutable(); + dependentShipmentTypes_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int requirementMode_ = 0; + /** + * + * + *
+     * Mode applied to the requirement.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return The enum numeric value on the wire for requirementMode. + */ + @java.lang.Override + public int getRequirementModeValue() { + return requirementMode_; + } + /** + * + * + *
+     * Mode applied to the requirement.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @param value The enum numeric value on the wire for requirementMode to set. + * @return This builder for chaining. + */ + public Builder setRequirementModeValue(int value) { + requirementMode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Mode applied to the requirement.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return The requirementMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + getRequirementMode() { + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode result = + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode.forNumber( + requirementMode_); + return result == null + ? com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Mode applied to the requirement.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @param value The requirementMode to set. + * @return This builder for chaining. + */ + public Builder setRequirementMode( + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + requirementMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Mode applied to the requirement.
+     * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearRequirementMode() { + bitField0_ = (bitField0_ & ~0x00000004); + requirementMode_ = 0; + 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.ShipmentTypeRequirement) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.ShipmentTypeRequirement) + private static final com.google.maps.routeoptimization.v1.ShipmentTypeRequirement + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.ShipmentTypeRequirement(); + } + + public static com.google.maps.routeoptimization.v1.ShipmentTypeRequirement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShipmentTypeRequirement 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.ShipmentTypeRequirement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeRequirementOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeRequirementOrBuilder.java new file mode 100644 index 000000000000..48ab5775ffee --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/ShipmentTypeRequirementOrBuilder.java @@ -0,0 +1,181 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface ShipmentTypeRequirementOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.ShipmentTypeRequirement) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return A list containing the requiredShipmentTypeAlternatives. + */ + java.util.List getRequiredShipmentTypeAlternativesList(); + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @return The count of requiredShipmentTypeAlternatives. + */ + int getRequiredShipmentTypeAlternativesCount(); + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index of the element to return. + * @return The requiredShipmentTypeAlternatives at the given index. + */ + java.lang.String getRequiredShipmentTypeAlternatives(int index); + /** + * + * + *
+   * List of alternative shipment types required by the
+   * `dependent_shipment_types`.
+   * 
+ * + * repeated string required_shipment_type_alternatives = 1; + * + * @param index The index of the value to return. + * @return The bytes of the requiredShipmentTypeAlternatives at the given index. + */ + com.google.protobuf.ByteString getRequiredShipmentTypeAlternativesBytes(int index); + + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return A list containing the dependentShipmentTypes. + */ + java.util.List getDependentShipmentTypesList(); + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @return The count of dependentShipmentTypes. + */ + int getDependentShipmentTypesCount(); + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index of the element to return. + * @return The dependentShipmentTypes at the given index. + */ + java.lang.String getDependentShipmentTypes(int index); + /** + * + * + *
+   * All shipments with a type in the `dependent_shipment_types` field require
+   * at least one shipment of type `required_shipment_type_alternatives` to be
+   * visited on the same route.
+   *
+   * NOTE: Chains of requirements such that a `shipment_type` depends on itself
+   * are not allowed.
+   * 
+ * + * repeated string dependent_shipment_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the dependentShipmentTypes at the given index. + */ + com.google.protobuf.ByteString getDependentShipmentTypesBytes(int index); + + /** + * + * + *
+   * Mode applied to the requirement.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return The enum numeric value on the wire for requirementMode. + */ + int getRequirementModeValue(); + /** + * + * + *
+   * Mode applied to the requirement.
+   * 
+ * + * + * .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * + * + * @return The requirementMode. + */ + com.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode getRequirementMode(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/SkippedShipment.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/SkippedShipment.java new file mode 100644 index 000000000000..5ce75389e922 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/SkippedShipment.java @@ -0,0 +1,2636 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Specifies details of unperformed shipments in a solution. For trivial cases
+ * and/or if we are able to identify the cause for skipping, we report the
+ * reason here.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.SkippedShipment} + */ +public final class SkippedShipment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.SkippedShipment) + SkippedShipmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use SkippedShipment.newBuilder() to construct. + private SkippedShipment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SkippedShipment() { + label_ = ""; + reasons_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SkippedShipment(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.SkippedShipment.class, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder.class); + } + + public interface ReasonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.SkippedShipment.Reason) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Refer to the comments of Code.
+     * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+     * Refer to the comments of Code.
+     * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return The code. + */ + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code getCode(); + + /** + * + * + *
+     * If the reason is related to a shipment-vehicle incompatibility, this
+     * field provides the index of one relevant vehicle.
+     * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return Whether the exampleVehicleIndex field is set. + */ + boolean hasExampleVehicleIndex(); + /** + * + * + *
+     * If the reason is related to a shipment-vehicle incompatibility, this
+     * field provides the index of one relevant vehicle.
+     * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return The exampleVehicleIndex. + */ + int getExampleVehicleIndex(); + + /** + * + * + *
+     * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+     * capacity type that is exceeded.
+     * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return The exampleExceededCapacityType. + */ + java.lang.String getExampleExceededCapacityType(); + /** + * + * + *
+     * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+     * capacity type that is exceeded.
+     * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return The bytes for exampleExceededCapacityType. + */ + com.google.protobuf.ByteString getExampleExceededCapacityTypeBytes(); + } + /** + * + * + *
+   * If we can explain why the shipment was skipped, reasons will be listed
+   * here. If the reason is not the same for all vehicles, `reason` will have
+   * more than 1 element. A skipped shipment cannot have duplicate reasons,
+   * i.e. where all fields are the same except for `example_vehicle_index`.
+   * Example:
+   * ```
+   * reasons {
+   *   code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
+   *   example_vehicle_index: 1
+   *   example_exceeded_capacity_type: "Apples"
+   * }
+   * reasons {
+   *   code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
+   *   example_vehicle_index: 3
+   *   example_exceeded_capacity_type: "Pears"
+   * }
+   * reasons {
+   *   code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
+   *   example_vehicle_index: 1
+   * }
+   * ```
+   * The skipped shipment is incompatible with all vehicles. The reasons may
+   * be different for all vehicles but at least one vehicle's "Apples"
+   * capacity would be exceeded (including vehicle 1), at least one vehicle's
+   * "Pears" capacity would be exceeded (including vehicle 3) and at least one
+   * vehicle's distance limit would be exceeded (including vehicle 1).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.SkippedShipment.Reason} + */ + public static final class Reason extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.SkippedShipment.Reason) + ReasonOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reason.newBuilder() to construct. + private Reason(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Reason() { + code_ = 0; + exampleExceededCapacityType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Reason(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.class, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder.class); + } + + /** + * + * + *
+     * Code identifying the reason type. The order here is meaningless. In
+     * particular, it gives no indication of whether a given reason will
+     * appear before another in the solution, if both apply.
+     * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.SkippedShipment.Reason.Code} + */ + public enum Code implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * This should never be used. If we are unable to understand why a
+       * shipment was skipped, we simply return an empty set of reasons.
+       * 
+ * + * CODE_UNSPECIFIED = 0; + */ + CODE_UNSPECIFIED(0), + /** + * + * + *
+       * There is no vehicle in the model making all shipments infeasible.
+       * 
+ * + * NO_VEHICLE = 1; + */ + NO_VEHICLE(1), + /** + * + * + *
+       * The demand of the shipment exceeds a vehicle's capacity for some
+       * capacity types, one of which is `example_exceeded_capacity_type`.
+       * 
+ * + * DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + */ + DEMAND_EXCEEDS_VEHICLE_CAPACITY(2), + /** + * + * + *
+       * The minimum distance necessary to perform this shipment, i.e. from
+       * the vehicle's `start_location` to the shipment's pickup and/or delivery
+       * locations and to the vehicle's end location exceeds the vehicle's
+       * `route_distance_limit`.
+       *
+       * Note that for this computation we use the geodesic distances.
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + */ + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT(3), + /** + * + * + *
+       * The minimum time necessary to perform this shipment, including travel
+       * time, wait time and service time exceeds the vehicle's
+       * `route_duration_limit`.
+       *
+       * Note: travel time is computed in the best-case scenario, namely as
+       * geodesic distance x 36 m/s (roughly 130 km/hour).
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + */ + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT(4), + /** + * + * + *
+       * Same as above but we only compare minimum travel time and the
+       * vehicle's `travel_duration_limit`.
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + */ + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT(5), + /** + * + * + *
+       * The vehicle cannot perform this shipment in the best-case scenario
+       * (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time
+       * computation) if it starts at its earliest start time: the total time
+       * would make the vehicle end after its latest end time.
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + */ + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS(6), + /** + * + * + *
+       * The `allowed_vehicle_indices` field of the shipment is not empty and
+       * this vehicle does not belong to it.
+       * 
+ * + * VEHICLE_NOT_ALLOWED = 7; + */ + VEHICLE_NOT_ALLOWED(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * This should never be used. If we are unable to understand why a
+       * shipment was skipped, we simply return an empty set of reasons.
+       * 
+ * + * CODE_UNSPECIFIED = 0; + */ + public static final int CODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * There is no vehicle in the model making all shipments infeasible.
+       * 
+ * + * NO_VEHICLE = 1; + */ + public static final int NO_VEHICLE_VALUE = 1; + /** + * + * + *
+       * The demand of the shipment exceeds a vehicle's capacity for some
+       * capacity types, one of which is `example_exceeded_capacity_type`.
+       * 
+ * + * DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + */ + public static final int DEMAND_EXCEEDS_VEHICLE_CAPACITY_VALUE = 2; + /** + * + * + *
+       * The minimum distance necessary to perform this shipment, i.e. from
+       * the vehicle's `start_location` to the shipment's pickup and/or delivery
+       * locations and to the vehicle's end location exceeds the vehicle's
+       * `route_distance_limit`.
+       *
+       * Note that for this computation we use the geodesic distances.
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + */ + public static final int CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT_VALUE = 3; + /** + * + * + *
+       * The minimum time necessary to perform this shipment, including travel
+       * time, wait time and service time exceeds the vehicle's
+       * `route_duration_limit`.
+       *
+       * Note: travel time is computed in the best-case scenario, namely as
+       * geodesic distance x 36 m/s (roughly 130 km/hour).
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + */ + public static final int CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT_VALUE = 4; + /** + * + * + *
+       * Same as above but we only compare minimum travel time and the
+       * vehicle's `travel_duration_limit`.
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + */ + public static final int CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT_VALUE = 5; + /** + * + * + *
+       * The vehicle cannot perform this shipment in the best-case scenario
+       * (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time
+       * computation) if it starts at its earliest start time: the total time
+       * would make the vehicle end after its latest end time.
+       * 
+ * + * CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + */ + public static final int CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS_VALUE = 6; + /** + * + * + *
+       * The `allowed_vehicle_indices` field of the shipment is not empty and
+       * this vehicle does not belong to it.
+       * 
+ * + * VEHICLE_NOT_ALLOWED = 7; + */ + public static final int VEHICLE_NOT_ALLOWED_VALUE = 7; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Code forNumber(int value) { + switch (value) { + case 0: + return CODE_UNSPECIFIED; + case 1: + return NO_VEHICLE; + case 2: + return DEMAND_EXCEEDS_VEHICLE_CAPACITY; + case 3: + return CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT; + case 4: + return CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT; + case 5: + return CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT; + case 6: + return CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS; + case 7: + return VEHICLE_NOT_ALLOWED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.SkippedShipment.Reason.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Code[] VALUES = values(); + + public static Code valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.SkippedShipment.Reason.Code) + } + + private int bitField0_; + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + * + * + *
+     * Refer to the comments of Code.
+     * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * Refer to the comments of Code.
+     * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code getCode() { + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code result = + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code.forNumber(code_); + return result == null + ? com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code.UNRECOGNIZED + : result; + } + + public static final int EXAMPLE_VEHICLE_INDEX_FIELD_NUMBER = 2; + private int exampleVehicleIndex_ = 0; + /** + * + * + *
+     * If the reason is related to a shipment-vehicle incompatibility, this
+     * field provides the index of one relevant vehicle.
+     * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return Whether the exampleVehicleIndex field is set. + */ + @java.lang.Override + public boolean hasExampleVehicleIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * If the reason is related to a shipment-vehicle incompatibility, this
+     * field provides the index of one relevant vehicle.
+     * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return The exampleVehicleIndex. + */ + @java.lang.Override + public int getExampleVehicleIndex() { + return exampleVehicleIndex_; + } + + public static final int EXAMPLE_EXCEEDED_CAPACITY_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object exampleExceededCapacityType_ = ""; + /** + * + * + *
+     * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+     * capacity type that is exceeded.
+     * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return The exampleExceededCapacityType. + */ + @java.lang.Override + public java.lang.String getExampleExceededCapacityType() { + java.lang.Object ref = exampleExceededCapacityType_; + 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(); + exampleExceededCapacityType_ = s; + return s; + } + } + /** + * + * + *
+     * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+     * capacity type that is exceeded.
+     * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return The bytes for exampleExceededCapacityType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExampleExceededCapacityTypeBytes() { + java.lang.Object ref = exampleExceededCapacityType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + exampleExceededCapacityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ + != com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code.CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(2, exampleVehicleIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(exampleExceededCapacityType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, exampleExceededCapacityType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code.CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, exampleVehicleIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(exampleExceededCapacityType_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 3, exampleExceededCapacityType_); + } + 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.SkippedShipment.Reason)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.SkippedShipment.Reason other = + (com.google.maps.routeoptimization.v1.SkippedShipment.Reason) obj; + + if (code_ != other.code_) return false; + if (hasExampleVehicleIndex() != other.hasExampleVehicleIndex()) return false; + if (hasExampleVehicleIndex()) { + if (getExampleVehicleIndex() != other.getExampleVehicleIndex()) return false; + } + if (!getExampleExceededCapacityType().equals(other.getExampleExceededCapacityType())) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + if (hasExampleVehicleIndex()) { + hash = (37 * hash) + EXAMPLE_VEHICLE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getExampleVehicleIndex(); + } + hash = (37 * hash) + EXAMPLE_EXCEEDED_CAPACITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getExampleExceededCapacityType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason 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.SkippedShipment.Reason parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason 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.SkippedShipment.Reason parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason 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.SkippedShipment.Reason parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason 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.SkippedShipment.Reason parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason 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.SkippedShipment.Reason 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.SkippedShipment.Reason 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.SkippedShipment.Reason 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; + } + /** + * + * + *
+     * If we can explain why the shipment was skipped, reasons will be listed
+     * here. If the reason is not the same for all vehicles, `reason` will have
+     * more than 1 element. A skipped shipment cannot have duplicate reasons,
+     * i.e. where all fields are the same except for `example_vehicle_index`.
+     * Example:
+     * ```
+     * reasons {
+     *   code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
+     *   example_vehicle_index: 1
+     *   example_exceeded_capacity_type: "Apples"
+     * }
+     * reasons {
+     *   code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
+     *   example_vehicle_index: 3
+     *   example_exceeded_capacity_type: "Pears"
+     * }
+     * reasons {
+     *   code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
+     *   example_vehicle_index: 1
+     * }
+     * ```
+     * The skipped shipment is incompatible with all vehicles. The reasons may
+     * be different for all vehicles but at least one vehicle's "Apples"
+     * capacity would be exceeded (including vehicle 1), at least one vehicle's
+     * "Pears" capacity would be exceeded (including vehicle 3) and at least one
+     * vehicle's distance limit would be exceeded (including vehicle 1).
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.SkippedShipment.Reason} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.SkippedShipment.Reason) + com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_Reason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.class, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.SkippedShipment.Reason.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + exampleVehicleIndex_ = 0; + exampleExceededCapacityType_ = ""; + 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_SkippedShipment_Reason_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.SkippedShipment.Reason.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason build() { + com.google.maps.routeoptimization.v1.SkippedShipment.Reason result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason buildPartial() { + com.google.maps.routeoptimization.v1.SkippedShipment.Reason result = + new com.google.maps.routeoptimization.v1.SkippedShipment.Reason(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.exampleVehicleIndex_ = exampleVehicleIndex_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.exampleExceededCapacityType_ = exampleExceededCapacityType_; + } + 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.SkippedShipment.Reason) { + return mergeFrom((com.google.maps.routeoptimization.v1.SkippedShipment.Reason) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.SkippedShipment.Reason other) { + if (other + == com.google.maps.routeoptimization.v1.SkippedShipment.Reason.getDefaultInstance()) + return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (other.hasExampleVehicleIndex()) { + setExampleVehicleIndex(other.getExampleVehicleIndex()); + } + if (!other.getExampleExceededCapacityType().isEmpty()) { + exampleExceededCapacityType_ = other.exampleExceededCapacityType_; + bitField0_ |= 0x00000004; + 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 8: + { + code_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + exampleVehicleIndex_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + exampleExceededCapacityType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + 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 code_ = 0; + /** + * + * + *
+       * Refer to the comments of Code.
+       * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+       * Refer to the comments of Code.
+       * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Refer to the comments of Code.
+       * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code getCode() { + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code result = + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code.forNumber(code_); + return result == null + ? com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Refer to the comments of Code.
+       * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Refer to the comments of Code.
+       * 
+ * + * .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private int exampleVehicleIndex_; + /** + * + * + *
+       * If the reason is related to a shipment-vehicle incompatibility, this
+       * field provides the index of one relevant vehicle.
+       * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return Whether the exampleVehicleIndex field is set. + */ + @java.lang.Override + public boolean hasExampleVehicleIndex() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * If the reason is related to a shipment-vehicle incompatibility, this
+       * field provides the index of one relevant vehicle.
+       * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return The exampleVehicleIndex. + */ + @java.lang.Override + public int getExampleVehicleIndex() { + return exampleVehicleIndex_; + } + /** + * + * + *
+       * If the reason is related to a shipment-vehicle incompatibility, this
+       * field provides the index of one relevant vehicle.
+       * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @param value The exampleVehicleIndex to set. + * @return This builder for chaining. + */ + public Builder setExampleVehicleIndex(int value) { + + exampleVehicleIndex_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If the reason is related to a shipment-vehicle incompatibility, this
+       * field provides the index of one relevant vehicle.
+       * 
+ * + * optional int32 example_vehicle_index = 2; + * + * @return This builder for chaining. + */ + public Builder clearExampleVehicleIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + exampleVehicleIndex_ = 0; + onChanged(); + return this; + } + + private java.lang.Object exampleExceededCapacityType_ = ""; + /** + * + * + *
+       * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+       * capacity type that is exceeded.
+       * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return The exampleExceededCapacityType. + */ + public java.lang.String getExampleExceededCapacityType() { + java.lang.Object ref = exampleExceededCapacityType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + exampleExceededCapacityType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+       * capacity type that is exceeded.
+       * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return The bytes for exampleExceededCapacityType. + */ + public com.google.protobuf.ByteString getExampleExceededCapacityTypeBytes() { + java.lang.Object ref = exampleExceededCapacityType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + exampleExceededCapacityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+       * capacity type that is exceeded.
+       * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @param value The exampleExceededCapacityType to set. + * @return This builder for chaining. + */ + public Builder setExampleExceededCapacityType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + exampleExceededCapacityType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+       * capacity type that is exceeded.
+       * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearExampleExceededCapacityType() { + exampleExceededCapacityType_ = getDefaultInstance().getExampleExceededCapacityType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
+       * capacity type that is exceeded.
+       * 
+ * + * string example_exceeded_capacity_type = 3; + * + * @param value The bytes for exampleExceededCapacityType to set. + * @return This builder for chaining. + */ + public Builder setExampleExceededCapacityTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + exampleExceededCapacityType_ = value; + bitField0_ |= 0x00000004; + 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.SkippedShipment.Reason) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.SkippedShipment.Reason) + private static final com.google.maps.routeoptimization.v1.SkippedShipment.Reason + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.SkippedShipment.Reason(); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment.Reason getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reason 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.SkippedShipment.Reason getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INDEX_FIELD_NUMBER = 1; + private int index_ = 0; + /** + * + * + *
+   * The index corresponds to the index of the shipment in the source
+   * `ShipmentModel`.
+   * 
+ * + * int32 index = 1; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + + public static final int LABEL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object label_ = ""; + /** + * + * + *
+   * Copy of the corresponding
+   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+   * specified in the `Shipment`.
+   * 
+ * + * string label = 2; + * + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + * + * + *
+   * Copy of the corresponding
+   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+   * specified in the `Shipment`.
+   * 
+ * + * string label = 2; + * + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REASONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List reasons_; + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + @java.lang.Override + public java.util.List + getReasonsList() { + return reasons_; + } + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder> + getReasonsOrBuilderList() { + return reasons_; + } + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + @java.lang.Override + public int getReasonsCount() { + return reasons_.size(); + } + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason getReasons(int index) { + return reasons_.get(index); + } + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder getReasonsOrBuilder( + int index) { + return reasons_.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 { + if (index_ != 0) { + output.writeInt32(1, index_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, label_); + } + for (int i = 0; i < reasons_.size(); i++) { + output.writeMessage(3, reasons_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, index_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, label_); + } + for (int i = 0; i < reasons_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, reasons_.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.SkippedShipment)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.SkippedShipment other = + (com.google.maps.routeoptimization.v1.SkippedShipment) obj; + + if (getIndex() != other.getIndex()) return false; + if (!getLabel().equals(other.getLabel())) return false; + if (!getReasonsList().equals(other.getReasonsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + if (getReasonsCount() > 0) { + hash = (37 * hash) + REASONS_FIELD_NUMBER; + hash = (53 * hash) + getReasonsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment 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.SkippedShipment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment 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.SkippedShipment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment 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.SkippedShipment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment 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.SkippedShipment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment 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.SkippedShipment 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.SkippedShipment 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.SkippedShipment 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 details of unperformed shipments in a solution. For trivial cases
+   * and/or if we are able to identify the cause for skipping, we report the
+   * reason here.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.SkippedShipment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.SkippedShipment) + com.google.maps.routeoptimization.v1.SkippedShipmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_SkippedShipment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.SkippedShipment.class, + com.google.maps.routeoptimization.v1.SkippedShipment.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.SkippedShipment.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + index_ = 0; + label_ = ""; + if (reasonsBuilder_ == null) { + reasons_ = java.util.Collections.emptyList(); + } else { + reasons_ = null; + reasonsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + 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_SkippedShipment_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.SkippedShipment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment build() { + com.google.maps.routeoptimization.v1.SkippedShipment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.SkippedShipment buildPartial() { + com.google.maps.routeoptimization.v1.SkippedShipment result = + new com.google.maps.routeoptimization.v1.SkippedShipment(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.routeoptimization.v1.SkippedShipment result) { + if (reasonsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + reasons_ = java.util.Collections.unmodifiableList(reasons_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.reasons_ = reasons_; + } else { + result.reasons_ = reasonsBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.SkippedShipment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.index_ = index_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.label_ = label_; + } + } + + @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.SkippedShipment) { + return mergeFrom((com.google.maps.routeoptimization.v1.SkippedShipment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.SkippedShipment other) { + if (other == com.google.maps.routeoptimization.v1.SkippedShipment.getDefaultInstance()) + return this; + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (reasonsBuilder_ == null) { + if (!other.reasons_.isEmpty()) { + if (reasons_.isEmpty()) { + reasons_ = other.reasons_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureReasonsIsMutable(); + reasons_.addAll(other.reasons_); + } + onChanged(); + } + } else { + if (!other.reasons_.isEmpty()) { + if (reasonsBuilder_.isEmpty()) { + reasonsBuilder_.dispose(); + reasonsBuilder_ = null; + reasons_ = other.reasons_; + bitField0_ = (bitField0_ & ~0x00000004); + reasonsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReasonsFieldBuilder() + : null; + } else { + reasonsBuilder_.addAllMessages(other.reasons_); + } + } + } + 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: + { + index_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + label_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.maps.routeoptimization.v1.SkippedShipment.Reason m = + input.readMessage( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.parser(), + extensionRegistry); + if (reasonsBuilder_ == null) { + ensureReasonsIsMutable(); + reasons_.add(m); + } else { + reasonsBuilder_.addMessage(m); + } + break; + } // case 26 + 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 index_; + /** + * + * + *
+     * The index corresponds to the index of the shipment in the source
+     * `ShipmentModel`.
+     * 
+ * + * int32 index = 1; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + /** + * + * + *
+     * The index corresponds to the index of the shipment in the source
+     * `ShipmentModel`.
+     * 
+ * + * int32 index = 1; + * + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + + index_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The index corresponds to the index of the shipment in the source
+     * `ShipmentModel`.
+     * 
+ * + * int32 index = 1; + * + * @return This builder for chaining. + */ + public Builder clearIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + index_ = 0; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+     * Copy of the corresponding
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+     * specified in the `Shipment`.
+     * 
+ * + * string label = 2; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Copy of the corresponding
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+     * specified in the `Shipment`.
+     * 
+ * + * string label = 2; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Copy of the corresponding
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+     * specified in the `Shipment`.
+     * 
+ * + * string label = 2; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + label_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Copy of the corresponding
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+     * specified in the `Shipment`.
+     * 
+ * + * string label = 2; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + label_ = getDefaultInstance().getLabel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Copy of the corresponding
+     * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+     * specified in the `Shipment`.
+     * 
+ * + * string label = 2; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + label_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List reasons_ = + java.util.Collections.emptyList(); + + private void ensureReasonsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + reasons_ = + new java.util.ArrayList( + reasons_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment.Reason, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder, + com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder> + reasonsBuilder_; + + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public java.util.List + getReasonsList() { + if (reasonsBuilder_ == null) { + return java.util.Collections.unmodifiableList(reasons_); + } else { + return reasonsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public int getReasonsCount() { + if (reasonsBuilder_ == null) { + return reasons_.size(); + } else { + return reasonsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason getReasons(int index) { + if (reasonsBuilder_ == null) { + return reasons_.get(index); + } else { + return reasonsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder setReasons( + int index, com.google.maps.routeoptimization.v1.SkippedShipment.Reason value) { + if (reasonsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.set(index, value); + onChanged(); + } else { + reasonsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder setReasons( + int index, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder builderForValue) { + if (reasonsBuilder_ == null) { + ensureReasonsIsMutable(); + reasons_.set(index, builderForValue.build()); + onChanged(); + } else { + reasonsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder addReasons(com.google.maps.routeoptimization.v1.SkippedShipment.Reason value) { + if (reasonsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.add(value); + onChanged(); + } else { + reasonsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder addReasons( + int index, com.google.maps.routeoptimization.v1.SkippedShipment.Reason value) { + if (reasonsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.add(index, value); + onChanged(); + } else { + reasonsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder addReasons( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder builderForValue) { + if (reasonsBuilder_ == null) { + ensureReasonsIsMutable(); + reasons_.add(builderForValue.build()); + onChanged(); + } else { + reasonsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder addReasons( + int index, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder builderForValue) { + if (reasonsBuilder_ == null) { + ensureReasonsIsMutable(); + reasons_.add(index, builderForValue.build()); + onChanged(); + } else { + reasonsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder addAllReasons( + java.lang.Iterable + values) { + if (reasonsBuilder_ == null) { + ensureReasonsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reasons_); + onChanged(); + } else { + reasonsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder clearReasons() { + if (reasonsBuilder_ == null) { + reasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + reasonsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public Builder removeReasons(int index) { + if (reasonsBuilder_ == null) { + ensureReasonsIsMutable(); + reasons_.remove(index); + onChanged(); + } else { + reasonsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder getReasonsBuilder( + int index) { + return getReasonsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder getReasonsOrBuilder( + int index) { + if (reasonsBuilder_ == null) { + return reasons_.get(index); + } else { + return reasonsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public java.util.List< + ? extends com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder> + getReasonsOrBuilderList() { + if (reasonsBuilder_ != null) { + return reasonsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(reasons_); + } + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder addReasonsBuilder() { + return getReasonsFieldBuilder() + .addBuilder( + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.getDefaultInstance()); + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder addReasonsBuilder( + int index) { + return getReasonsFieldBuilder() + .addBuilder( + index, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.getDefaultInstance()); + } + /** + * + * + *
+     * A list of reasons that explain why the shipment was skipped. See comment
+     * above `Reason`.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + public java.util.List + getReasonsBuilderList() { + return getReasonsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment.Reason, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder, + com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder> + getReasonsFieldBuilder() { + if (reasonsBuilder_ == null) { + reasonsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.SkippedShipment.Reason, + com.google.maps.routeoptimization.v1.SkippedShipment.Reason.Builder, + com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder>( + reasons_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + reasons_ = null; + } + return reasonsBuilder_; + } + + @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.SkippedShipment) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.SkippedShipment) + private static final com.google.maps.routeoptimization.v1.SkippedShipment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.SkippedShipment(); + } + + public static com.google.maps.routeoptimization.v1.SkippedShipment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SkippedShipment 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.SkippedShipment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/SkippedShipmentOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/SkippedShipmentOrBuilder.java new file mode 100644 index 000000000000..d1e20ed42a71 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/SkippedShipmentOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface SkippedShipmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.SkippedShipment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The index corresponds to the index of the shipment in the source
+   * `ShipmentModel`.
+   * 
+ * + * int32 index = 1; + * + * @return The index. + */ + int getIndex(); + + /** + * + * + *
+   * Copy of the corresponding
+   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+   * specified in the `Shipment`.
+   * 
+ * + * string label = 2; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+   * Copy of the corresponding
+   * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if
+   * specified in the `Shipment`.
+   * 
+ * + * string label = 2; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); + + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + java.util.List getReasonsList(); + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + com.google.maps.routeoptimization.v1.SkippedShipment.Reason getReasons(int index); + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + int getReasonsCount(); + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + java.util.List + getReasonsOrBuilderList(); + /** + * + * + *
+   * A list of reasons that explain why the shipment was skipped. See comment
+   * above `Reason`.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + com.google.maps.routeoptimization.v1.SkippedShipment.ReasonOrBuilder getReasonsOrBuilder( + int index); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TimeWindow.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TimeWindow.java new file mode 100644 index 000000000000..5c6018951951 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TimeWindow.java @@ -0,0 +1,1963 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Time windows constrain the time of an event, such as the arrival time at a
+ * visit, or the start and end time of a vehicle.
+ *
+ * Hard time window bounds, `start_time` and `end_time`, enforce the earliest
+ * and latest time of the event, such that `start_time <= event_time <=
+ * end_time`. The soft time window lower bound, `soft_start_time`, expresses a
+ * preference for the event to happen at or after `soft_start_time` by incurring
+ * a cost proportional to how long before soft_start_time the event occurs. The
+ * soft time window upper bound, `soft_end_time`, expresses a preference for the
+ * event to happen at or before `soft_end_time` by incurring a cost proportional
+ * to how long after `soft_end_time` the event occurs. `start_time`, `end_time`,
+ * `soft_start_time` and `soft_end_time` should be within the global time limits
+ * (see
+ * [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+ * and
+ * [ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time])
+ * and should respect:
+ * ```
+ *   0 <= `start_time` <= `soft_start_time` <= `end_time` and
+ *   0 <= `start_time` <= `soft_end_time` <= `end_time`.
+ * ```
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.TimeWindow} + */ +public final class TimeWindow extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.TimeWindow) + TimeWindowOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeWindow.newBuilder() to construct. + private TimeWindow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeWindow() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeWindow(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TimeWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.TimeWindow.class, + com.google.maps.routeoptimization.v1.TimeWindow.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The hard time window start time. If unspecified it will be set to
+   * `ShipmentModel.global_start_time`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The hard time window start time. If unspecified it will be set to
+   * `ShipmentModel.global_start_time`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The hard time window start time. If unspecified it will be set to
+   * `ShipmentModel.global_start_time`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The hard time window end time. If unspecified it will be set to
+   * `ShipmentModel.global_end_time`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The hard time window end time. If unspecified it will be set to
+   * `ShipmentModel.global_end_time`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The hard time window end time. If unspecified it will be set to
+   * `ShipmentModel.global_end_time`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int SOFT_START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp softStartTime_; + /** + * + * + *
+   * The soft start time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + * + * @return Whether the softStartTime field is set. + */ + @java.lang.Override + public boolean hasSoftStartTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The soft start time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + * + * @return The softStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSoftStartTime() { + return softStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : softStartTime_; + } + /** + * + * + *
+   * The soft start time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSoftStartTimeOrBuilder() { + return softStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : softStartTime_; + } + + public static final int SOFT_END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp softEndTime_; + /** + * + * + *
+   * The soft end time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + * + * @return Whether the softEndTime field is set. + */ + @java.lang.Override + public boolean hasSoftEndTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * The soft end time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + * + * @return The softEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSoftEndTime() { + return softEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softEndTime_; + } + /** + * + * + *
+   * The soft end time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSoftEndTimeOrBuilder() { + return softEndTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : softEndTime_; + } + + public static final int COST_PER_HOUR_BEFORE_SOFT_START_TIME_FIELD_NUMBER = 5; + private double costPerHourBeforeSoftStartTime_ = 0D; + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs
+   * before soft_start_time, computed as:
+   *
+   * ```
+   *    max(0, soft_start_time - t.seconds)
+   *                           * cost_per_hour_before_soft_start_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * soft_start_time has been set.
+   * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return Whether the costPerHourBeforeSoftStartTime field is set. + */ + @java.lang.Override + public boolean hasCostPerHourBeforeSoftStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs
+   * before soft_start_time, computed as:
+   *
+   * ```
+   *    max(0, soft_start_time - t.seconds)
+   *                           * cost_per_hour_before_soft_start_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * soft_start_time has been set.
+   * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return The costPerHourBeforeSoftStartTime. + */ + @java.lang.Override + public double getCostPerHourBeforeSoftStartTime() { + return costPerHourBeforeSoftStartTime_; + } + + public static final int COST_PER_HOUR_AFTER_SOFT_END_TIME_FIELD_NUMBER = 6; + private double costPerHourAfterSoftEndTime_ = 0D; + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs after
+   * `soft_end_time`, computed as:
+   *
+   * ```
+   *    max(0, t.seconds - soft_end_time.seconds)
+   *                     * cost_per_hour_after_soft_end_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * `soft_end_time` has been set.
+   * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return Whether the costPerHourAfterSoftEndTime field is set. + */ + @java.lang.Override + public boolean hasCostPerHourAfterSoftEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs after
+   * `soft_end_time`, computed as:
+   *
+   * ```
+   *    max(0, t.seconds - soft_end_time.seconds)
+   *                     * cost_per_hour_after_soft_end_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * `soft_end_time` has been set.
+   * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return The costPerHourAfterSoftEndTime. + */ + @java.lang.Override + public double getCostPerHourAfterSoftEndTime() { + return costPerHourAfterSoftEndTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getSoftStartTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(4, getSoftEndTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeDouble(5, costPerHourBeforeSoftStartTime_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeDouble(6, costPerHourAfterSoftEndTime_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSoftStartTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSoftEndTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 5, costPerHourBeforeSoftStartTime_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize(6, costPerHourAfterSoftEndTime_); + } + 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.TimeWindow)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.TimeWindow other = + (com.google.maps.routeoptimization.v1.TimeWindow) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasSoftStartTime() != other.hasSoftStartTime()) return false; + if (hasSoftStartTime()) { + if (!getSoftStartTime().equals(other.getSoftStartTime())) return false; + } + if (hasSoftEndTime() != other.hasSoftEndTime()) return false; + if (hasSoftEndTime()) { + if (!getSoftEndTime().equals(other.getSoftEndTime())) return false; + } + if (hasCostPerHourBeforeSoftStartTime() != other.hasCostPerHourBeforeSoftStartTime()) + return false; + if (hasCostPerHourBeforeSoftStartTime()) { + if (java.lang.Double.doubleToLongBits(getCostPerHourBeforeSoftStartTime()) + != java.lang.Double.doubleToLongBits(other.getCostPerHourBeforeSoftStartTime())) + return false; + } + if (hasCostPerHourAfterSoftEndTime() != other.hasCostPerHourAfterSoftEndTime()) return false; + if (hasCostPerHourAfterSoftEndTime()) { + if (java.lang.Double.doubleToLongBits(getCostPerHourAfterSoftEndTime()) + != java.lang.Double.doubleToLongBits(other.getCostPerHourAfterSoftEndTime())) + 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 (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasSoftStartTime()) { + hash = (37 * hash) + SOFT_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSoftStartTime().hashCode(); + } + if (hasSoftEndTime()) { + hash = (37 * hash) + SOFT_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSoftEndTime().hashCode(); + } + if (hasCostPerHourBeforeSoftStartTime()) { + hash = (37 * hash) + COST_PER_HOUR_BEFORE_SOFT_START_TIME_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerHourBeforeSoftStartTime())); + } + if (hasCostPerHourAfterSoftEndTime()) { + hash = (37 * hash) + COST_PER_HOUR_AFTER_SOFT_END_TIME_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerHourAfterSoftEndTime())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.TimeWindow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.TimeWindow 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.TimeWindow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.TimeWindow 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.TimeWindow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.TimeWindow 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.TimeWindow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.TimeWindow 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.TimeWindow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.TimeWindow 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.TimeWindow 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.TimeWindow 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.TimeWindow 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; + } + /** + * + * + *
+   * Time windows constrain the time of an event, such as the arrival time at a
+   * visit, or the start and end time of a vehicle.
+   *
+   * Hard time window bounds, `start_time` and `end_time`, enforce the earliest
+   * and latest time of the event, such that `start_time <= event_time <=
+   * end_time`. The soft time window lower bound, `soft_start_time`, expresses a
+   * preference for the event to happen at or after `soft_start_time` by incurring
+   * a cost proportional to how long before soft_start_time the event occurs. The
+   * soft time window upper bound, `soft_end_time`, expresses a preference for the
+   * event to happen at or before `soft_end_time` by incurring a cost proportional
+   * to how long after `soft_end_time` the event occurs. `start_time`, `end_time`,
+   * `soft_start_time` and `soft_end_time` should be within the global time limits
+   * (see
+   * [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * and
+   * [ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time])
+   * and should respect:
+   * ```
+   *   0 <= `start_time` <= `soft_start_time` <= `end_time` and
+   *   0 <= `start_time` <= `soft_end_time` <= `end_time`.
+   * ```
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.TimeWindow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.TimeWindow) + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TimeWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TimeWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.TimeWindow.class, + com.google.maps.routeoptimization.v1.TimeWindow.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.TimeWindow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + getSoftStartTimeFieldBuilder(); + getSoftEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + softStartTime_ = null; + if (softStartTimeBuilder_ != null) { + softStartTimeBuilder_.dispose(); + softStartTimeBuilder_ = null; + } + softEndTime_ = null; + if (softEndTimeBuilder_ != null) { + softEndTimeBuilder_.dispose(); + softEndTimeBuilder_ = null; + } + costPerHourBeforeSoftStartTime_ = 0D; + costPerHourAfterSoftEndTime_ = 0D; + 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_TimeWindow_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindow getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindow build() { + com.google.maps.routeoptimization.v1.TimeWindow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindow buildPartial() { + com.google.maps.routeoptimization.v1.TimeWindow result = + new com.google.maps.routeoptimization.v1.TimeWindow(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.TimeWindow result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.softStartTime_ = + softStartTimeBuilder_ == null ? softStartTime_ : softStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.softEndTime_ = + softEndTimeBuilder_ == null ? softEndTime_ : softEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.costPerHourBeforeSoftStartTime_ = costPerHourBeforeSoftStartTime_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.costPerHourAfterSoftEndTime_ = costPerHourAfterSoftEndTime_; + to_bitField0_ |= 0x00000020; + } + 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.TimeWindow) { + return mergeFrom((com.google.maps.routeoptimization.v1.TimeWindow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.TimeWindow other) { + if (other == com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasSoftStartTime()) { + mergeSoftStartTime(other.getSoftStartTime()); + } + if (other.hasSoftEndTime()) { + mergeSoftEndTime(other.getSoftEndTime()); + } + if (other.hasCostPerHourBeforeSoftStartTime()) { + setCostPerHourBeforeSoftStartTime(other.getCostPerHourBeforeSoftStartTime()); + } + if (other.hasCostPerHourAfterSoftEndTime()) { + setCostPerHourAfterSoftEndTime(other.getCostPerHourAfterSoftEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getSoftStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getSoftEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 41: + { + costPerHourBeforeSoftStartTime_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + case 49: + { + costPerHourAfterSoftEndTime_ = input.readDouble(); + bitField0_ |= 0x00000020; + break; + } // case 49 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The hard time window start time. If unspecified it will be set to
+     * `ShipmentModel.global_start_time`.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The hard time window end time. If unspecified it will be set to
+     * `ShipmentModel.global_end_time`.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.Timestamp softStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + softStartTimeBuilder_; + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + * + * @return Whether the softStartTime field is set. + */ + public boolean hasSoftStartTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + * + * @return The softStartTime. + */ + public com.google.protobuf.Timestamp getSoftStartTime() { + if (softStartTimeBuilder_ == null) { + return softStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : softStartTime_; + } else { + return softStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + public Builder setSoftStartTime(com.google.protobuf.Timestamp value) { + if (softStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + softStartTime_ = value; + } else { + softStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + public Builder setSoftStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (softStartTimeBuilder_ == null) { + softStartTime_ = builderForValue.build(); + } else { + softStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + public Builder mergeSoftStartTime(com.google.protobuf.Timestamp value) { + if (softStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && softStartTime_ != null + && softStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSoftStartTimeBuilder().mergeFrom(value); + } else { + softStartTime_ = value; + } + } else { + softStartTimeBuilder_.mergeFrom(value); + } + if (softStartTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + public Builder clearSoftStartTime() { + bitField0_ = (bitField0_ & ~0x00000004); + softStartTime_ = null; + if (softStartTimeBuilder_ != null) { + softStartTimeBuilder_.dispose(); + softStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getSoftStartTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSoftStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getSoftStartTimeOrBuilder() { + if (softStartTimeBuilder_ != null) { + return softStartTimeBuilder_.getMessageOrBuilder(); + } else { + return softStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : softStartTime_; + } + } + /** + * + * + *
+     * The soft start time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSoftStartTimeFieldBuilder() { + if (softStartTimeBuilder_ == null) { + softStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSoftStartTime(), getParentForChildren(), isClean()); + softStartTime_ = null; + } + return softStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp softEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + softEndTimeBuilder_; + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + * + * @return Whether the softEndTime field is set. + */ + public boolean hasSoftEndTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + * + * @return The softEndTime. + */ + public com.google.protobuf.Timestamp getSoftEndTime() { + if (softEndTimeBuilder_ == null) { + return softEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : softEndTime_; + } else { + return softEndTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + public Builder setSoftEndTime(com.google.protobuf.Timestamp value) { + if (softEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + softEndTime_ = value; + } else { + softEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + public Builder setSoftEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (softEndTimeBuilder_ == null) { + softEndTime_ = builderForValue.build(); + } else { + softEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + public Builder mergeSoftEndTime(com.google.protobuf.Timestamp value) { + if (softEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && softEndTime_ != null + && softEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSoftEndTimeBuilder().mergeFrom(value); + } else { + softEndTime_ = value; + } + } else { + softEndTimeBuilder_.mergeFrom(value); + } + if (softEndTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + public Builder clearSoftEndTime() { + bitField0_ = (bitField0_ & ~0x00000008); + softEndTime_ = null; + if (softEndTimeBuilder_ != null) { + softEndTimeBuilder_.dispose(); + softEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getSoftEndTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getSoftEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getSoftEndTimeOrBuilder() { + if (softEndTimeBuilder_ != null) { + return softEndTimeBuilder_.getMessageOrBuilder(); + } else { + return softEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : softEndTime_; + } + } + /** + * + * + *
+     * The soft end time of the time window.
+     * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSoftEndTimeFieldBuilder() { + if (softEndTimeBuilder_ == null) { + softEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSoftEndTime(), getParentForChildren(), isClean()); + softEndTime_ = null; + } + return softEndTimeBuilder_; + } + + private double costPerHourBeforeSoftStartTime_; + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs
+     * before soft_start_time, computed as:
+     *
+     * ```
+     *    max(0, soft_start_time - t.seconds)
+     *                           * cost_per_hour_before_soft_start_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * soft_start_time has been set.
+     * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return Whether the costPerHourBeforeSoftStartTime field is set. + */ + @java.lang.Override + public boolean hasCostPerHourBeforeSoftStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs
+     * before soft_start_time, computed as:
+     *
+     * ```
+     *    max(0, soft_start_time - t.seconds)
+     *                           * cost_per_hour_before_soft_start_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * soft_start_time has been set.
+     * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return The costPerHourBeforeSoftStartTime. + */ + @java.lang.Override + public double getCostPerHourBeforeSoftStartTime() { + return costPerHourBeforeSoftStartTime_; + } + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs
+     * before soft_start_time, computed as:
+     *
+     * ```
+     *    max(0, soft_start_time - t.seconds)
+     *                           * cost_per_hour_before_soft_start_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * soft_start_time has been set.
+     * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @param value The costPerHourBeforeSoftStartTime to set. + * @return This builder for chaining. + */ + public Builder setCostPerHourBeforeSoftStartTime(double value) { + + costPerHourBeforeSoftStartTime_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs
+     * before soft_start_time, computed as:
+     *
+     * ```
+     *    max(0, soft_start_time - t.seconds)
+     *                           * cost_per_hour_before_soft_start_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * soft_start_time has been set.
+     * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return This builder for chaining. + */ + public Builder clearCostPerHourBeforeSoftStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + costPerHourBeforeSoftStartTime_ = 0D; + onChanged(); + return this; + } + + private double costPerHourAfterSoftEndTime_; + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs after
+     * `soft_end_time`, computed as:
+     *
+     * ```
+     *    max(0, t.seconds - soft_end_time.seconds)
+     *                     * cost_per_hour_after_soft_end_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * `soft_end_time` has been set.
+     * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return Whether the costPerHourAfterSoftEndTime field is set. + */ + @java.lang.Override + public boolean hasCostPerHourAfterSoftEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs after
+     * `soft_end_time`, computed as:
+     *
+     * ```
+     *    max(0, t.seconds - soft_end_time.seconds)
+     *                     * cost_per_hour_after_soft_end_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * `soft_end_time` has been set.
+     * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return The costPerHourAfterSoftEndTime. + */ + @java.lang.Override + public double getCostPerHourAfterSoftEndTime() { + return costPerHourAfterSoftEndTime_; + } + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs after
+     * `soft_end_time`, computed as:
+     *
+     * ```
+     *    max(0, t.seconds - soft_end_time.seconds)
+     *                     * cost_per_hour_after_soft_end_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * `soft_end_time` has been set.
+     * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @param value The costPerHourAfterSoftEndTime to set. + * @return This builder for chaining. + */ + public Builder setCostPerHourAfterSoftEndTime(double value) { + + costPerHourAfterSoftEndTime_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * A cost per hour added to other costs in the model if the event occurs after
+     * `soft_end_time`, computed as:
+     *
+     * ```
+     *    max(0, t.seconds - soft_end_time.seconds)
+     *                     * cost_per_hour_after_soft_end_time / 3600,
+     * t being the time of the event.
+     * ```
+     *
+     * This cost must be positive, and the field can only be set if
+     * `soft_end_time` has been set.
+     * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return This builder for chaining. + */ + public Builder clearCostPerHourAfterSoftEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + costPerHourAfterSoftEndTime_ = 0D; + 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.TimeWindow) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.TimeWindow) + private static final com.google.maps.routeoptimization.v1.TimeWindow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.TimeWindow(); + } + + public static com.google.maps.routeoptimization.v1.TimeWindow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeWindow 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.TimeWindow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TimeWindowOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TimeWindowOrBuilder.java new file mode 100644 index 000000000000..c7d0e0117289 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TimeWindowOrBuilder.java @@ -0,0 +1,262 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface TimeWindowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.TimeWindow) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The hard time window start time. If unspecified it will be set to
+   * `ShipmentModel.global_start_time`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The hard time window start time. If unspecified it will be set to
+   * `ShipmentModel.global_start_time`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The hard time window start time. If unspecified it will be set to
+   * `ShipmentModel.global_start_time`.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The hard time window end time. If unspecified it will be set to
+   * `ShipmentModel.global_end_time`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The hard time window end time. If unspecified it will be set to
+   * `ShipmentModel.global_end_time`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The hard time window end time. If unspecified it will be set to
+   * `ShipmentModel.global_end_time`.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The soft start time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + * + * @return Whether the softStartTime field is set. + */ + boolean hasSoftStartTime(); + /** + * + * + *
+   * The soft start time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + * + * @return The softStartTime. + */ + com.google.protobuf.Timestamp getSoftStartTime(); + /** + * + * + *
+   * The soft start time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getSoftStartTimeOrBuilder(); + + /** + * + * + *
+   * The soft end time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + * + * @return Whether the softEndTime field is set. + */ + boolean hasSoftEndTime(); + /** + * + * + *
+   * The soft end time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + * + * @return The softEndTime. + */ + com.google.protobuf.Timestamp getSoftEndTime(); + /** + * + * + *
+   * The soft end time of the time window.
+   * 
+ * + * .google.protobuf.Timestamp soft_end_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getSoftEndTimeOrBuilder(); + + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs
+   * before soft_start_time, computed as:
+   *
+   * ```
+   *    max(0, soft_start_time - t.seconds)
+   *                           * cost_per_hour_before_soft_start_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * soft_start_time has been set.
+   * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return Whether the costPerHourBeforeSoftStartTime field is set. + */ + boolean hasCostPerHourBeforeSoftStartTime(); + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs
+   * before soft_start_time, computed as:
+   *
+   * ```
+   *    max(0, soft_start_time - t.seconds)
+   *                           * cost_per_hour_before_soft_start_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * soft_start_time has been set.
+   * 
+ * + * optional double cost_per_hour_before_soft_start_time = 5; + * + * @return The costPerHourBeforeSoftStartTime. + */ + double getCostPerHourBeforeSoftStartTime(); + + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs after
+   * `soft_end_time`, computed as:
+   *
+   * ```
+   *    max(0, t.seconds - soft_end_time.seconds)
+   *                     * cost_per_hour_after_soft_end_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * `soft_end_time` has been set.
+   * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return Whether the costPerHourAfterSoftEndTime field is set. + */ + boolean hasCostPerHourAfterSoftEndTime(); + /** + * + * + *
+   * A cost per hour added to other costs in the model if the event occurs after
+   * `soft_end_time`, computed as:
+   *
+   * ```
+   *    max(0, t.seconds - soft_end_time.seconds)
+   *                     * cost_per_hour_after_soft_end_time / 3600,
+   * t being the time of the event.
+   * ```
+   *
+   * This cost must be positive, and the field can only be set if
+   * `soft_end_time` has been set.
+   * 
+ * + * optional double cost_per_hour_after_soft_end_time = 6; + * + * @return The costPerHourAfterSoftEndTime. + */ + double getCostPerHourAfterSoftEndTime(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TransitionAttributes.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TransitionAttributes.java new file mode 100644 index 000000000000..2d86afdf2724 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TransitionAttributes.java @@ -0,0 +1,2096 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Specifies attributes of transitions between two consecutive visits on a
+ * route. Several `TransitionAttributes` may apply to the same transition: in
+ * that case, all extra costs add up and the strictest constraint or limit
+ * applies (following natural "AND" semantics).
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.TransitionAttributes} + */ +public final class TransitionAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.TransitionAttributes) + TransitionAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransitionAttributes.newBuilder() to construct. + private TransitionAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TransitionAttributes() { + srcTag_ = ""; + excludedSrcTag_ = ""; + dstTag_ = ""; + excludedDstTag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TransitionAttributes(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TransitionAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TransitionAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.TransitionAttributes.class, + com.google.maps.routeoptimization.v1.TransitionAttributes.Builder.class); + } + + private int bitField0_; + public static final int SRC_TAG_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object srcTag_ = ""; + /** + * + * + *
+   * Tags defining the set of (src->dst) transitions these attributes apply to.
+   *
+   * A source visit or vehicle start matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or
+   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+   * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string src_tag = 1; + * + * @return The srcTag. + */ + @java.lang.Override + public java.lang.String getSrcTag() { + java.lang.Object ref = srcTag_; + 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(); + srcTag_ = s; + return s; + } + } + /** + * + * + *
+   * Tags defining the set of (src->dst) transitions these attributes apply to.
+   *
+   * A source visit or vehicle start matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or
+   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+   * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string src_tag = 1; + * + * @return The bytes for srcTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSrcTagBytes() { + java.lang.Object ref = srcTag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + srcTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXCLUDED_SRC_TAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object excludedSrcTag_ = ""; + /** + * + * + *
+   * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_src_tag = 2; + * + * @return The excludedSrcTag. + */ + @java.lang.Override + public java.lang.String getExcludedSrcTag() { + java.lang.Object ref = excludedSrcTag_; + 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(); + excludedSrcTag_ = s; + return s; + } + } + /** + * + * + *
+   * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_src_tag = 2; + * + * @return The bytes for excludedSrcTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExcludedSrcTagBytes() { + java.lang.Object ref = excludedSrcTag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + excludedSrcTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DST_TAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object dstTag_ = ""; + /** + * + * + *
+   * A destination visit or vehicle end matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+   * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string dst_tag = 3; + * + * @return The dstTag. + */ + @java.lang.Override + public java.lang.String getDstTag() { + java.lang.Object ref = dstTag_; + 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(); + dstTag_ = s; + return s; + } + } + /** + * + * + *
+   * A destination visit or vehicle end matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+   * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string dst_tag = 3; + * + * @return The bytes for dstTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDstTagBytes() { + java.lang.Object ref = dstTag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dstTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXCLUDED_DST_TAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object excludedDstTag_ = ""; + /** + * + * + *
+   * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_dst_tag = 4; + * + * @return The excludedDstTag. + */ + @java.lang.Override + public java.lang.String getExcludedDstTag() { + java.lang.Object ref = excludedDstTag_; + 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(); + excludedDstTag_ = s; + return s; + } + } + /** + * + * + *
+   * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_dst_tag = 4; + * + * @return The bytes for excludedDstTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExcludedDstTagBytes() { + java.lang.Object ref = excludedDstTag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + excludedDstTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COST_FIELD_NUMBER = 5; + private double cost_ = 0D; + /** + * + * + *
+   * Specifies a cost for performing this transition. This is in the same unit
+   * as all other costs in the model and must not be negative. It is applied on
+   * top of all other existing costs.
+   * 
+ * + * double cost = 5; + * + * @return The cost. + */ + @java.lang.Override + public double getCost() { + return cost_; + } + + public static final int COST_PER_KILOMETER_FIELD_NUMBER = 6; + private double costPerKilometer_ = 0D; + /** + * + * + *
+   * Specifies a cost per kilometer applied to the distance traveled while
+   * performing this transition. It adds up to any
+   * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer]
+   * specified on vehicles.
+   * 
+ * + * double cost_per_kilometer = 6; + * + * @return The costPerKilometer. + */ + @java.lang.Override + public double getCostPerKilometer() { + return costPerKilometer_; + } + + public static final int DISTANCE_LIMIT_FIELD_NUMBER = 7; + private com.google.maps.routeoptimization.v1.DistanceLimit distanceLimit_; + /** + * + * + *
+   * Specifies a limit on the distance traveled while performing this
+   * transition.
+   *
+   * As of 2021/06, only soft limits are supported.
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * + * @return Whether the distanceLimit field is set. + */ + @java.lang.Override + public boolean hasDistanceLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Specifies a limit on the distance traveled while performing this
+   * transition.
+   *
+   * As of 2021/06, only soft limits are supported.
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * + * @return The distanceLimit. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimit getDistanceLimit() { + return distanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : distanceLimit_; + } + /** + * + * + *
+   * Specifies a limit on the distance traveled while performing this
+   * transition.
+   *
+   * As of 2021/06, only soft limits are supported.
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder getDistanceLimitOrBuilder() { + return distanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : distanceLimit_; + } + + public static final int DELAY_FIELD_NUMBER = 8; + private com.google.protobuf.Duration delay_; + /** + * + * + *
+   * Specifies a delay incurred when performing this transition.
+   *
+   * This delay always occurs *after* finishing the source visit and *before*
+   * starting the destination visit.
+   * 
+ * + * .google.protobuf.Duration delay = 8; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Specifies a delay incurred when performing this transition.
+   *
+   * This delay always occurs *after* finishing the source visit and *before*
+   * starting the destination visit.
+   * 
+ * + * .google.protobuf.Duration delay = 8; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + /** + * + * + *
+   * Specifies a delay incurred when performing this transition.
+   *
+   * This delay always occurs *after* finishing the source visit and *before*
+   * starting the destination visit.
+   * 
+ * + * .google.protobuf.Duration delay = 8; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(srcTag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, srcTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(excludedSrcTag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, excludedSrcTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dstTag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dstTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(excludedDstTag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, excludedDstTag_); + } + if (java.lang.Double.doubleToRawLongBits(cost_) != 0) { + output.writeDouble(5, cost_); + } + if (java.lang.Double.doubleToRawLongBits(costPerKilometer_) != 0) { + output.writeDouble(6, costPerKilometer_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getDistanceLimit()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getDelay()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(srcTag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, srcTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(excludedSrcTag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, excludedSrcTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dstTag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dstTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(excludedDstTag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, excludedDstTag_); + } + if (java.lang.Double.doubleToRawLongBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, cost_); + } + if (java.lang.Double.doubleToRawLongBits(costPerKilometer_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, costPerKilometer_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDistanceLimit()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDelay()); + } + 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.TransitionAttributes)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.TransitionAttributes other = + (com.google.maps.routeoptimization.v1.TransitionAttributes) obj; + + if (!getSrcTag().equals(other.getSrcTag())) return false; + if (!getExcludedSrcTag().equals(other.getExcludedSrcTag())) return false; + if (!getDstTag().equals(other.getDstTag())) return false; + if (!getExcludedDstTag().equals(other.getExcludedDstTag())) return false; + if (java.lang.Double.doubleToLongBits(getCost()) + != java.lang.Double.doubleToLongBits(other.getCost())) return false; + if (java.lang.Double.doubleToLongBits(getCostPerKilometer()) + != java.lang.Double.doubleToLongBits(other.getCostPerKilometer())) return false; + if (hasDistanceLimit() != other.hasDistanceLimit()) return false; + if (hasDistanceLimit()) { + if (!getDistanceLimit().equals(other.getDistanceLimit())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SRC_TAG_FIELD_NUMBER; + hash = (53 * hash) + getSrcTag().hashCode(); + hash = (37 * hash) + EXCLUDED_SRC_TAG_FIELD_NUMBER; + hash = (53 * hash) + getExcludedSrcTag().hashCode(); + hash = (37 * hash) + DST_TAG_FIELD_NUMBER; + hash = (53 * hash) + getDstTag().hashCode(); + hash = (37 * hash) + EXCLUDED_DST_TAG_FIELD_NUMBER; + hash = (53 * hash) + getExcludedDstTag().hashCode(); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getCost())); + hash = (37 * hash) + COST_PER_KILOMETER_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerKilometer())); + if (hasDistanceLimit()) { + hash = (37 * hash) + DISTANCE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getDistanceLimit().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes 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.TransitionAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes 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.TransitionAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes 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.TransitionAttributes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes 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.TransitionAttributes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes 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.TransitionAttributes 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.TransitionAttributes 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.TransitionAttributes 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 attributes of transitions between two consecutive visits on a
+   * route. Several `TransitionAttributes` may apply to the same transition: in
+   * that case, all extra costs add up and the strictest constraint or limit
+   * applies (following natural "AND" semantics).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.TransitionAttributes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.TransitionAttributes) + com.google.maps.routeoptimization.v1.TransitionAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TransitionAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_TransitionAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.TransitionAttributes.class, + com.google.maps.routeoptimization.v1.TransitionAttributes.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.TransitionAttributes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDistanceLimitFieldBuilder(); + getDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + srcTag_ = ""; + excludedSrcTag_ = ""; + dstTag_ = ""; + excludedDstTag_ = ""; + cost_ = 0D; + costPerKilometer_ = 0D; + distanceLimit_ = null; + if (distanceLimitBuilder_ != null) { + distanceLimitBuilder_.dispose(); + distanceLimitBuilder_ = null; + } + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = 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_TransitionAttributes_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.TransitionAttributes getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.TransitionAttributes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.TransitionAttributes build() { + com.google.maps.routeoptimization.v1.TransitionAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.TransitionAttributes buildPartial() { + com.google.maps.routeoptimization.v1.TransitionAttributes result = + new com.google.maps.routeoptimization.v1.TransitionAttributes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.TransitionAttributes result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.srcTag_ = srcTag_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.excludedSrcTag_ = excludedSrcTag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dstTag_ = dstTag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.excludedDstTag_ = excludedDstTag_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cost_ = cost_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.costPerKilometer_ = costPerKilometer_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.distanceLimit_ = + distanceLimitBuilder_ == null ? distanceLimit_ : distanceLimitBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.delay_ = delayBuilder_ == null ? delay_ : delayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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.TransitionAttributes) { + return mergeFrom((com.google.maps.routeoptimization.v1.TransitionAttributes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.TransitionAttributes other) { + if (other == com.google.maps.routeoptimization.v1.TransitionAttributes.getDefaultInstance()) + return this; + if (!other.getSrcTag().isEmpty()) { + srcTag_ = other.srcTag_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getExcludedSrcTag().isEmpty()) { + excludedSrcTag_ = other.excludedSrcTag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDstTag().isEmpty()) { + dstTag_ = other.dstTag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getExcludedDstTag().isEmpty()) { + excludedDstTag_ = other.excludedDstTag_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getCost() != 0D) { + setCost(other.getCost()); + } + if (other.getCostPerKilometer() != 0D) { + setCostPerKilometer(other.getCostPerKilometer()); + } + if (other.hasDistanceLimit()) { + mergeDistanceLimit(other.getDistanceLimit()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + 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: + { + srcTag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + excludedSrcTag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + dstTag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + excludedDstTag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 41: + { + cost_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + case 49: + { + costPerKilometer_ = input.readDouble(); + bitField0_ |= 0x00000020; + break; + } // case 49 + case 58: + { + input.readMessage(getDistanceLimitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object srcTag_ = ""; + /** + * + * + *
+     * Tags defining the set of (src->dst) transitions these attributes apply to.
+     *
+     * A source visit or vehicle start matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or
+     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+     * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string src_tag = 1; + * + * @return The srcTag. + */ + public java.lang.String getSrcTag() { + java.lang.Object ref = srcTag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcTag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Tags defining the set of (src->dst) transitions these attributes apply to.
+     *
+     * A source visit or vehicle start matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or
+     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+     * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string src_tag = 1; + * + * @return The bytes for srcTag. + */ + public com.google.protobuf.ByteString getSrcTagBytes() { + java.lang.Object ref = srcTag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + srcTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Tags defining the set of (src->dst) transitions these attributes apply to.
+     *
+     * A source visit or vehicle start matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or
+     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+     * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string src_tag = 1; + * + * @param value The srcTag to set. + * @return This builder for chaining. + */ + public Builder setSrcTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + srcTag_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Tags defining the set of (src->dst) transitions these attributes apply to.
+     *
+     * A source visit or vehicle start matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or
+     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+     * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string src_tag = 1; + * + * @return This builder for chaining. + */ + public Builder clearSrcTag() { + srcTag_ = getDefaultInstance().getSrcTag(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags defining the set of (src->dst) transitions these attributes apply to.
+     *
+     * A source visit or vehicle start matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or
+     * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+     * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string src_tag = 1; + * + * @param value The bytes for srcTag to set. + * @return This builder for chaining. + */ + public Builder setSrcTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + srcTag_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object excludedSrcTag_ = ""; + /** + * + * + *
+     * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_src_tag = 2; + * + * @return The excludedSrcTag. + */ + public java.lang.String getExcludedSrcTag() { + java.lang.Object ref = excludedSrcTag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + excludedSrcTag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_src_tag = 2; + * + * @return The bytes for excludedSrcTag. + */ + public com.google.protobuf.ByteString getExcludedSrcTagBytes() { + java.lang.Object ref = excludedSrcTag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + excludedSrcTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_src_tag = 2; + * + * @param value The excludedSrcTag to set. + * @return This builder for chaining. + */ + public Builder setExcludedSrcTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + excludedSrcTag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_src_tag = 2; + * + * @return This builder for chaining. + */ + public Builder clearExcludedSrcTag() { + excludedSrcTag_ = getDefaultInstance().getExcludedSrcTag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_src_tag = 2; + * + * @param value The bytes for excludedSrcTag to set. + * @return This builder for chaining. + */ + public Builder setExcludedSrcTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + excludedSrcTag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object dstTag_ = ""; + /** + * + * + *
+     * A destination visit or vehicle end matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+     * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string dst_tag = 3; + * + * @return The dstTag. + */ + public java.lang.String getDstTag() { + java.lang.Object ref = dstTag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstTag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A destination visit or vehicle end matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+     * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string dst_tag = 3; + * + * @return The bytes for dstTag. + */ + public com.google.protobuf.ByteString getDstTagBytes() { + java.lang.Object ref = dstTag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dstTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A destination visit or vehicle end matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+     * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string dst_tag = 3; + * + * @param value The dstTag to set. + * @return This builder for chaining. + */ + public Builder setDstTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dstTag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A destination visit or vehicle end matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+     * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string dst_tag = 3; + * + * @return This builder for chaining. + */ + public Builder clearDstTag() { + dstTag_ = getDefaultInstance().getDstTag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A destination visit or vehicle end matches iff its
+     * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+     * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+     * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+     * on which of these two fields is non-empty).
+     * 
+ * + * string dst_tag = 3; + * + * @param value The bytes for dstTag to set. + * @return This builder for chaining. + */ + public Builder setDstTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dstTag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object excludedDstTag_ = ""; + /** + * + * + *
+     * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_dst_tag = 4; + * + * @return The excludedDstTag. + */ + public java.lang.String getExcludedDstTag() { + java.lang.Object ref = excludedDstTag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + excludedDstTag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_dst_tag = 4; + * + * @return The bytes for excludedDstTag. + */ + public com.google.protobuf.ByteString getExcludedDstTagBytes() { + java.lang.Object ref = excludedDstTag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + excludedDstTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_dst_tag = 4; + * + * @param value The excludedDstTag to set. + * @return This builder for chaining. + */ + public Builder setExcludedDstTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + excludedDstTag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_dst_tag = 4; + * + * @return This builder for chaining. + */ + public Builder clearExcludedDstTag() { + excludedDstTag_ = getDefaultInstance().getExcludedDstTag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+     * non-empty.
+     * 
+ * + * string excluded_dst_tag = 4; + * + * @param value The bytes for excludedDstTag to set. + * @return This builder for chaining. + */ + public Builder setExcludedDstTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + excludedDstTag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private double cost_; + /** + * + * + *
+     * Specifies a cost for performing this transition. This is in the same unit
+     * as all other costs in the model and must not be negative. It is applied on
+     * top of all other existing costs.
+     * 
+ * + * double cost = 5; + * + * @return The cost. + */ + @java.lang.Override + public double getCost() { + return cost_; + } + /** + * + * + *
+     * Specifies a cost for performing this transition. This is in the same unit
+     * as all other costs in the model and must not be negative. It is applied on
+     * top of all other existing costs.
+     * 
+ * + * double cost = 5; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(double value) { + + cost_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a cost for performing this transition. This is in the same unit
+     * as all other costs in the model and must not be negative. It is applied on
+     * top of all other existing costs.
+     * 
+ * + * double cost = 5; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + bitField0_ = (bitField0_ & ~0x00000010); + cost_ = 0D; + onChanged(); + return this; + } + + private double costPerKilometer_; + /** + * + * + *
+     * Specifies a cost per kilometer applied to the distance traveled while
+     * performing this transition. It adds up to any
+     * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer]
+     * specified on vehicles.
+     * 
+ * + * double cost_per_kilometer = 6; + * + * @return The costPerKilometer. + */ + @java.lang.Override + public double getCostPerKilometer() { + return costPerKilometer_; + } + /** + * + * + *
+     * Specifies a cost per kilometer applied to the distance traveled while
+     * performing this transition. It adds up to any
+     * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer]
+     * specified on vehicles.
+     * 
+ * + * double cost_per_kilometer = 6; + * + * @param value The costPerKilometer to set. + * @return This builder for chaining. + */ + public Builder setCostPerKilometer(double value) { + + costPerKilometer_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a cost per kilometer applied to the distance traveled while
+     * performing this transition. It adds up to any
+     * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer]
+     * specified on vehicles.
+     * 
+ * + * double cost_per_kilometer = 6; + * + * @return This builder for chaining. + */ + public Builder clearCostPerKilometer() { + bitField0_ = (bitField0_ & ~0x00000020); + costPerKilometer_ = 0D; + onChanged(); + return this; + } + + private com.google.maps.routeoptimization.v1.DistanceLimit distanceLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.DistanceLimit, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder, + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder> + distanceLimitBuilder_; + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * + * @return Whether the distanceLimit field is set. + */ + public boolean hasDistanceLimit() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * + * @return The distanceLimit. + */ + public com.google.maps.routeoptimization.v1.DistanceLimit getDistanceLimit() { + if (distanceLimitBuilder_ == null) { + return distanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : distanceLimit_; + } else { + return distanceLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + public Builder setDistanceLimit(com.google.maps.routeoptimization.v1.DistanceLimit value) { + if (distanceLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + distanceLimit_ = value; + } else { + distanceLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + public Builder setDistanceLimit( + com.google.maps.routeoptimization.v1.DistanceLimit.Builder builderForValue) { + if (distanceLimitBuilder_ == null) { + distanceLimit_ = builderForValue.build(); + } else { + distanceLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + public Builder mergeDistanceLimit(com.google.maps.routeoptimization.v1.DistanceLimit value) { + if (distanceLimitBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && distanceLimit_ != null + && distanceLimit_ + != com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance()) { + getDistanceLimitBuilder().mergeFrom(value); + } else { + distanceLimit_ = value; + } + } else { + distanceLimitBuilder_.mergeFrom(value); + } + if (distanceLimit_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + public Builder clearDistanceLimit() { + bitField0_ = (bitField0_ & ~0x00000040); + distanceLimit_ = null; + if (distanceLimitBuilder_ != null) { + distanceLimitBuilder_.dispose(); + distanceLimitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + public com.google.maps.routeoptimization.v1.DistanceLimit.Builder getDistanceLimitBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getDistanceLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + public com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder getDistanceLimitOrBuilder() { + if (distanceLimitBuilder_ != null) { + return distanceLimitBuilder_.getMessageOrBuilder(); + } else { + return distanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : distanceLimit_; + } + } + /** + * + * + *
+     * Specifies a limit on the distance traveled while performing this
+     * transition.
+     *
+     * As of 2021/06, only soft limits are supported.
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.DistanceLimit, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder, + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder> + getDistanceLimitFieldBuilder() { + if (distanceLimitBuilder_ == null) { + distanceLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.DistanceLimit, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder, + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder>( + getDistanceLimit(), getParentForChildren(), isClean()); + distanceLimit_ = null; + } + return distanceLimitBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + } else { + delayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && delay_ != null + && delay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayBuilder().mergeFrom(value); + } else { + delay_ = value; + } + } else { + delayBuilder_.mergeFrom(value); + } + if (delay_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + public Builder clearDelay() { + bitField0_ = (bitField0_ & ~0x00000080); + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getDelayFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + /** + * + * + *
+     * Specifies a delay incurred when performing this transition.
+     *
+     * This delay always occurs *after* finishing the source visit and *before*
+     * starting the destination visit.
+     * 
+ * + * .google.protobuf.Duration delay = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + @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.TransitionAttributes) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.TransitionAttributes) + private static final com.google.maps.routeoptimization.v1.TransitionAttributes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.TransitionAttributes(); + } + + public static com.google.maps.routeoptimization.v1.TransitionAttributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransitionAttributes 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.TransitionAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TransitionAttributesOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TransitionAttributesOrBuilder.java new file mode 100644 index 000000000000..d4bb34ca2d23 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/TransitionAttributesOrBuilder.java @@ -0,0 +1,271 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface TransitionAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.TransitionAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Tags defining the set of (src->dst) transitions these attributes apply to.
+   *
+   * A source visit or vehicle start matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or
+   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+   * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string src_tag = 1; + * + * @return The srcTag. + */ + java.lang.String getSrcTag(); + /** + * + * + *
+   * Tags defining the set of (src->dst) transitions these attributes apply to.
+   *
+   * A source visit or vehicle start matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or
+   * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]
+   * either contains `src_tag` or does not contain `excluded_src_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string src_tag = 1; + * + * @return The bytes for srcTag. + */ + com.google.protobuf.ByteString getSrcTagBytes(); + + /** + * + * + *
+   * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_src_tag = 2; + * + * @return The excludedSrcTag. + */ + java.lang.String getExcludedSrcTag(); + /** + * + * + *
+   * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_src_tag = 2; + * + * @return The bytes for excludedSrcTag. + */ + com.google.protobuf.ByteString getExcludedSrcTagBytes(); + + /** + * + * + *
+   * A destination visit or vehicle end matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+   * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string dst_tag = 3; + * + * @return The dstTag. + */ + java.lang.String getDstTag(); + /** + * + * + *
+   * A destination visit or vehicle end matches iff its
+   * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags]
+   * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags]
+   * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
+   * on which of these two fields is non-empty).
+   * 
+ * + * string dst_tag = 3; + * + * @return The bytes for dstTag. + */ + com.google.protobuf.ByteString getDstTagBytes(); + + /** + * + * + *
+   * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_dst_tag = 4; + * + * @return The excludedDstTag. + */ + java.lang.String getExcludedDstTag(); + /** + * + * + *
+   * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
+   * non-empty.
+   * 
+ * + * string excluded_dst_tag = 4; + * + * @return The bytes for excludedDstTag. + */ + com.google.protobuf.ByteString getExcludedDstTagBytes(); + + /** + * + * + *
+   * Specifies a cost for performing this transition. This is in the same unit
+   * as all other costs in the model and must not be negative. It is applied on
+   * top of all other existing costs.
+   * 
+ * + * double cost = 5; + * + * @return The cost. + */ + double getCost(); + + /** + * + * + *
+   * Specifies a cost per kilometer applied to the distance traveled while
+   * performing this transition. It adds up to any
+   * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer]
+   * specified on vehicles.
+   * 
+ * + * double cost_per_kilometer = 6; + * + * @return The costPerKilometer. + */ + double getCostPerKilometer(); + + /** + * + * + *
+   * Specifies a limit on the distance traveled while performing this
+   * transition.
+   *
+   * As of 2021/06, only soft limits are supported.
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * + * @return Whether the distanceLimit field is set. + */ + boolean hasDistanceLimit(); + /** + * + * + *
+   * Specifies a limit on the distance traveled while performing this
+   * transition.
+   *
+   * As of 2021/06, only soft limits are supported.
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * + * @return The distanceLimit. + */ + com.google.maps.routeoptimization.v1.DistanceLimit getDistanceLimit(); + /** + * + * + *
+   * Specifies a limit on the distance traveled while performing this
+   * transition.
+   *
+   * As of 2021/06, only soft limits are supported.
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder getDistanceLimitOrBuilder(); + + /** + * + * + *
+   * Specifies a delay incurred when performing this transition.
+   *
+   * This delay always occurs *after* finishing the source visit and *before*
+   * starting the destination visit.
+   * 
+ * + * .google.protobuf.Duration delay = 8; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + /** + * + * + *
+   * Specifies a delay incurred when performing this transition.
+   *
+   * This delay always occurs *after* finishing the source visit and *before*
+   * starting the destination visit.
+   * 
+ * + * .google.protobuf.Duration delay = 8; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + /** + * + * + *
+   * Specifies a delay incurred when performing this transition.
+   *
+   * This delay always occurs *after* finishing the source visit and *before*
+   * starting the destination visit.
+   * 
+ * + * .google.protobuf.Duration delay = 8; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Vehicle.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Vehicle.java new file mode 100644 index 000000000000..003e1897d436 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Vehicle.java @@ -0,0 +1,12356 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Models a vehicle in a shipment problem. Solving a shipment problem will
+ * build a route starting from `start_location` and ending at `end_location`
+ * for this vehicle. A route is a sequence of visits (see `ShipmentRoute`).
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle} + */ +public final class Vehicle extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Vehicle) + VehicleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Vehicle.newBuilder() to construct. + private Vehicle(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Vehicle() { + displayName_ = ""; + travelMode_ = 0; + startTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + endTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + startTimeWindows_ = java.util.Collections.emptyList(); + endTimeWindows_ = java.util.Collections.emptyList(); + unloadingPolicy_ = 0; + label_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Vehicle(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 30: + return internalGetLoadLimits(); + case 24: + return internalGetExtraVisitDurationForVisitType(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.class, + com.google.maps.routeoptimization.v1.Vehicle.Builder.class); + } + + /** + * + * + *
+   * Travel modes which can be used by vehicles.
+   *
+   * These should be a subset of the Google Maps Platform Routes Preferred API
+   * travel modes, see:
+   * https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode.
+   * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.Vehicle.TravelMode} + */ + public enum TravelMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified travel mode, equivalent to `DRIVING`.
+     * 
+ * + * TRAVEL_MODE_UNSPECIFIED = 0; + */ + TRAVEL_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Travel mode corresponding to driving directions (car, ...).
+     * 
+ * + * DRIVING = 1; + */ + DRIVING(1), + /** + * + * + *
+     * Travel mode corresponding to walking directions.
+     * 
+ * + * WALKING = 2; + */ + WALKING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified travel mode, equivalent to `DRIVING`.
+     * 
+ * + * TRAVEL_MODE_UNSPECIFIED = 0; + */ + public static final int TRAVEL_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Travel mode corresponding to driving directions (car, ...).
+     * 
+ * + * DRIVING = 1; + */ + public static final int DRIVING_VALUE = 1; + /** + * + * + *
+     * Travel mode corresponding to walking directions.
+     * 
+ * + * WALKING = 2; + */ + public static final int WALKING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TravelMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TravelMode forNumber(int value) { + switch (value) { + case 0: + return TRAVEL_MODE_UNSPECIFIED; + case 1: + return DRIVING; + case 2: + return WALKING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TravelMode findValueByNumber(int number) { + return TravelMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.Vehicle.getDescriptor().getEnumTypes().get(0); + } + + private static final TravelMode[] VALUES = values(); + + public static TravelMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TravelMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.Vehicle.TravelMode) + } + + /** + * + * + *
+   * Policy on how a vehicle can be unloaded. Applies only to shipments having
+   * both a pickup and a delivery.
+   *
+   * Other shipments are free to occur anywhere on the route independent of
+   * `unloading_policy`.
+   * 
+ * + * Protobuf enum {@code google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy} + */ + public enum UnloadingPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified unloading policy; deliveries must just occur after their
+     * corresponding pickups.
+     * 
+ * + * UNLOADING_POLICY_UNSPECIFIED = 0; + */ + UNLOADING_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * Deliveries must occur in reverse order of pickups
+     * 
+ * + * LAST_IN_FIRST_OUT = 1; + */ + LAST_IN_FIRST_OUT(1), + /** + * + * + *
+     * Deliveries must occur in the same order as pickups
+     * 
+ * + * FIRST_IN_FIRST_OUT = 2; + */ + FIRST_IN_FIRST_OUT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified unloading policy; deliveries must just occur after their
+     * corresponding pickups.
+     * 
+ * + * UNLOADING_POLICY_UNSPECIFIED = 0; + */ + public static final int UNLOADING_POLICY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Deliveries must occur in reverse order of pickups
+     * 
+ * + * LAST_IN_FIRST_OUT = 1; + */ + public static final int LAST_IN_FIRST_OUT_VALUE = 1; + /** + * + * + *
+     * Deliveries must occur in the same order as pickups
+     * 
+ * + * FIRST_IN_FIRST_OUT = 2; + */ + public static final int FIRST_IN_FIRST_OUT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static UnloadingPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static UnloadingPolicy forNumber(int value) { + switch (value) { + case 0: + return UNLOADING_POLICY_UNSPECIFIED; + case 1: + return LAST_IN_FIRST_OUT; + case 2: + return FIRST_IN_FIRST_OUT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public UnloadingPolicy findValueByNumber(int number) { + return UnloadingPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.Vehicle.getDescriptor().getEnumTypes().get(1); + } + + private static final UnloadingPolicy[] VALUES = values(); + + public static UnloadingPolicy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private UnloadingPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy) + } + + public interface LoadLimitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Vehicle.LoadLimit) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The maximum acceptable amount of load.
+     * 
+ * + * optional int64 max_load = 1; + * + * @return Whether the maxLoad field is set. + */ + boolean hasMaxLoad(); + /** + * + * + *
+     * The maximum acceptable amount of load.
+     * 
+ * + * optional int64 max_load = 1; + * + * @return The maxLoad. + */ + long getMaxLoad(); + + /** + * + * + *
+     * A soft limit of the load. See
+     * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
+     * 
+ * + * int64 soft_max_load = 2; + * + * @return The softMaxLoad. + */ + long getSoftMaxLoad(); + + /** + * + * + *
+     * If the load ever exceeds
+     * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]
+     * along this vehicle's route, the following cost penalty applies (only once
+     * per vehicle): (load -
+     * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
+     * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
+     * add up and must be in the same unit as
+     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+     * 
+ * + * double cost_per_unit_above_soft_max = 3; + * + * @return The costPerUnitAboveSoftMax. + */ + double getCostPerUnitAboveSoftMax(); + + /** + * + * + *
+     * The acceptable load interval of the vehicle at the start of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + * + * @return Whether the startLoadInterval field is set. + */ + boolean hasStartLoadInterval(); + /** + * + * + *
+     * The acceptable load interval of the vehicle at the start of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + * + * @return The startLoadInterval. + */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval getStartLoadInterval(); + /** + * + * + *
+     * The acceptable load interval of the vehicle at the start of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder + getStartLoadIntervalOrBuilder(); + + /** + * + * + *
+     * The acceptable load interval of the vehicle at the end of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + * + * @return Whether the endLoadInterval field is set. + */ + boolean hasEndLoadInterval(); + /** + * + * + *
+     * The acceptable load interval of the vehicle at the end of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + * + * @return The endLoadInterval. + */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval getEndLoadInterval(); + /** + * + * + *
+     * The acceptable load interval of the vehicle at the end of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder + getEndLoadIntervalOrBuilder(); + } + /** + * + * + *
+   * Defines a load limit applying to a vehicle, e.g. "this truck may only
+   * carry up to 3500 kg". See
+   * [load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits].
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle.LoadLimit} + */ + public static final class LoadLimit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Vehicle.LoadLimit) + LoadLimitOrBuilder { + private static final long serialVersionUID = 0L; + // Use LoadLimit.newBuilder() to construct. + private LoadLimit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LoadLimit() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LoadLimit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.class, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder.class); + } + + public interface IntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * A minimum acceptable load. Must be ≥ 0.
+       * If they're both specified,
+       * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+       * must be ≤
+       * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+       * 
+ * + * int64 min = 1; + * + * @return The min. + */ + long getMin(); + + /** + * + * + *
+       * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+       * load is unrestricted by this message.
+       * If they're both specified,
+       * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+       * must be ≤
+       * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+       * 
+ * + * optional int64 max = 2; + * + * @return Whether the max field is set. + */ + boolean hasMax(); + /** + * + * + *
+       * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+       * load is unrestricted by this message.
+       * If they're both specified,
+       * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+       * must be ≤
+       * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+       * 
+ * + * optional int64 max = 2; + * + * @return The max. + */ + long getMax(); + } + /** + * + * + *
+     * Interval of acceptable load amounts.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} + */ + public static final class Interval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) + IntervalOrBuilder { + private static final long serialVersionUID = 0L; + // Use Interval.newBuilder() to construct. + private Interval(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Interval() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Interval(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.class, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder.class); + } + + private int bitField0_; + public static final int MIN_FIELD_NUMBER = 1; + private long min_ = 0L; + /** + * + * + *
+       * A minimum acceptable load. Must be ≥ 0.
+       * If they're both specified,
+       * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+       * must be ≤
+       * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+       * 
+ * + * int64 min = 1; + * + * @return The min. + */ + @java.lang.Override + public long getMin() { + return min_; + } + + public static final int MAX_FIELD_NUMBER = 2; + private long max_ = 0L; + /** + * + * + *
+       * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+       * load is unrestricted by this message.
+       * If they're both specified,
+       * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+       * must be ≤
+       * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+       * 
+ * + * optional int64 max = 2; + * + * @return Whether the max field is set. + */ + @java.lang.Override + public boolean hasMax() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+       * load is unrestricted by this message.
+       * If they're both specified,
+       * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+       * must be ≤
+       * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+       * 
+ * + * optional int64 max = 2; + * + * @return The max. + */ + @java.lang.Override + public long getMax() { + return max_; + } + + 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 (min_ != 0L) { + output.writeInt64(1, min_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(2, max_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (min_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, min_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, max_); + } + 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.Vehicle.LoadLimit.Interval)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval other = + (com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) obj; + + if (getMin() != other.getMin()) return false; + if (hasMax() != other.hasMax()) return false; + if (hasMax()) { + if (getMax() != other.getMax()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMin()); + if (hasMax()) { + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMax()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval 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.Vehicle.LoadLimit.Interval parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval 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.Vehicle.LoadLimit.Interval parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval 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.Vehicle.LoadLimit.Interval parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval 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.Vehicle.LoadLimit.Interval + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + 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.Vehicle.LoadLimit.Interval 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.Vehicle.LoadLimit.Interval 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.Vehicle.LoadLimit.Interval 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; + } + /** + * + * + *
+       * Interval of acceptable load amounts.
+       * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.class, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder.class); + } + + // Construct using + // com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + min_ = 0L; + max_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_Interval_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval build() { + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval buildPartial() { + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval result = + new com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.min_ = min_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.max_ = max_; + to_bitField0_ |= 0x00000001; + } + 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.Vehicle.LoadLimit.Interval) { + return mergeFrom( + (com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval other) { + if (other + == com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + .getDefaultInstance()) return this; + if (other.getMin() != 0L) { + setMin(other.getMin()); + } + if (other.hasMax()) { + setMax(other.getMax()); + } + 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: + { + min_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + max_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long min_; + /** + * + * + *
+         * A minimum acceptable load. Must be ≥ 0.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * int64 min = 1; + * + * @return The min. + */ + @java.lang.Override + public long getMin() { + return min_; + } + /** + * + * + *
+         * A minimum acceptable load. Must be ≥ 0.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * int64 min = 1; + * + * @param value The min to set. + * @return This builder for chaining. + */ + public Builder setMin(long value) { + + min_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * A minimum acceptable load. Must be ≥ 0.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * int64 min = 1; + * + * @return This builder for chaining. + */ + public Builder clearMin() { + bitField0_ = (bitField0_ & ~0x00000001); + min_ = 0L; + onChanged(); + return this; + } + + private long max_; + /** + * + * + *
+         * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+         * load is unrestricted by this message.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * optional int64 max = 2; + * + * @return Whether the max field is set. + */ + @java.lang.Override + public boolean hasMax() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+         * load is unrestricted by this message.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * optional int64 max = 2; + * + * @return The max. + */ + @java.lang.Override + public long getMax() { + return max_; + } + /** + * + * + *
+         * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+         * load is unrestricted by this message.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * optional int64 max = 2; + * + * @param value The max to set. + * @return This builder for chaining. + */ + public Builder setMax(long value) { + + max_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
+         * load is unrestricted by this message.
+         * If they're both specified,
+         * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min]
+         * must be ≤
+         * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max].
+         * 
+ * + * optional int64 max = 2; + * + * @return This builder for chaining. + */ + public Builder clearMax() { + bitField0_ = (bitField0_ & ~0x00000002); + max_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) + private static final com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval(); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Interval 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.Vehicle.LoadLimit.Interval + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MAX_LOAD_FIELD_NUMBER = 1; + private long maxLoad_ = 0L; + /** + * + * + *
+     * The maximum acceptable amount of load.
+     * 
+ * + * optional int64 max_load = 1; + * + * @return Whether the maxLoad field is set. + */ + @java.lang.Override + public boolean hasMaxLoad() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The maximum acceptable amount of load.
+     * 
+ * + * optional int64 max_load = 1; + * + * @return The maxLoad. + */ + @java.lang.Override + public long getMaxLoad() { + return maxLoad_; + } + + public static final int SOFT_MAX_LOAD_FIELD_NUMBER = 2; + private long softMaxLoad_ = 0L; + /** + * + * + *
+     * A soft limit of the load. See
+     * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
+     * 
+ * + * int64 soft_max_load = 2; + * + * @return The softMaxLoad. + */ + @java.lang.Override + public long getSoftMaxLoad() { + return softMaxLoad_; + } + + public static final int COST_PER_UNIT_ABOVE_SOFT_MAX_FIELD_NUMBER = 3; + private double costPerUnitAboveSoftMax_ = 0D; + /** + * + * + *
+     * If the load ever exceeds
+     * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]
+     * along this vehicle's route, the following cost penalty applies (only once
+     * per vehicle): (load -
+     * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
+     * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
+     * add up and must be in the same unit as
+     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+     * 
+ * + * double cost_per_unit_above_soft_max = 3; + * + * @return The costPerUnitAboveSoftMax. + */ + @java.lang.Override + public double getCostPerUnitAboveSoftMax() { + return costPerUnitAboveSoftMax_; + } + + public static final int START_LOAD_INTERVAL_FIELD_NUMBER = 4; + private com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval startLoadInterval_; + /** + * + * + *
+     * The acceptable load interval of the vehicle at the start of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + * + * @return Whether the startLoadInterval field is set. + */ + @java.lang.Override + public boolean hasStartLoadInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The acceptable load interval of the vehicle at the start of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + * + * @return The startLoadInterval. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval getStartLoadInterval() { + return startLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : startLoadInterval_; + } + /** + * + * + *
+     * The acceptable load interval of the vehicle at the start of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder + getStartLoadIntervalOrBuilder() { + return startLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : startLoadInterval_; + } + + public static final int END_LOAD_INTERVAL_FIELD_NUMBER = 5; + private com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval endLoadInterval_; + /** + * + * + *
+     * The acceptable load interval of the vehicle at the end of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + * + * @return Whether the endLoadInterval field is set. + */ + @java.lang.Override + public boolean hasEndLoadInterval() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The acceptable load interval of the vehicle at the end of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + * + * @return The endLoadInterval. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval getEndLoadInterval() { + return endLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : endLoadInterval_; + } + /** + * + * + *
+     * The acceptable load interval of the vehicle at the end of the route.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder + getEndLoadIntervalOrBuilder() { + return endLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : endLoadInterval_; + } + + 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.writeInt64(1, maxLoad_); + } + if (softMaxLoad_ != 0L) { + output.writeInt64(2, softMaxLoad_); + } + if (java.lang.Double.doubleToRawLongBits(costPerUnitAboveSoftMax_) != 0) { + output.writeDouble(3, costPerUnitAboveSoftMax_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStartLoadInterval()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getEndLoadInterval()); + } + 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.computeInt64Size(1, maxLoad_); + } + if (softMaxLoad_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, softMaxLoad_); + } + if (java.lang.Double.doubleToRawLongBits(costPerUnitAboveSoftMax_) != 0) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize(3, costPerUnitAboveSoftMax_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartLoadInterval()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndLoadInterval()); + } + 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.Vehicle.LoadLimit)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit other = + (com.google.maps.routeoptimization.v1.Vehicle.LoadLimit) obj; + + if (hasMaxLoad() != other.hasMaxLoad()) return false; + if (hasMaxLoad()) { + if (getMaxLoad() != other.getMaxLoad()) return false; + } + if (getSoftMaxLoad() != other.getSoftMaxLoad()) return false; + if (java.lang.Double.doubleToLongBits(getCostPerUnitAboveSoftMax()) + != java.lang.Double.doubleToLongBits(other.getCostPerUnitAboveSoftMax())) return false; + if (hasStartLoadInterval() != other.hasStartLoadInterval()) return false; + if (hasStartLoadInterval()) { + if (!getStartLoadInterval().equals(other.getStartLoadInterval())) return false; + } + if (hasEndLoadInterval() != other.hasEndLoadInterval()) return false; + if (hasEndLoadInterval()) { + if (!getEndLoadInterval().equals(other.getEndLoadInterval())) 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 (hasMaxLoad()) { + hash = (37 * hash) + MAX_LOAD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxLoad()); + } + hash = (37 * hash) + SOFT_MAX_LOAD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSoftMaxLoad()); + hash = (37 * hash) + COST_PER_UNIT_ABOVE_SOFT_MAX_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerUnitAboveSoftMax())); + if (hasStartLoadInterval()) { + hash = (37 * hash) + START_LOAD_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getStartLoadInterval().hashCode(); + } + if (hasEndLoadInterval()) { + hash = (37 * hash) + END_LOAD_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getEndLoadInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit 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.Vehicle.LoadLimit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit 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.Vehicle.LoadLimit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit 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.Vehicle.LoadLimit parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit 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.Vehicle.LoadLimit parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit 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.Vehicle.LoadLimit 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.Vehicle.LoadLimit 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.Vehicle.LoadLimit 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; + } + /** + * + * + *
+     * Defines a load limit applying to a vehicle, e.g. "this truck may only
+     * carry up to 3500 kg". See
+     * [load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits].
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle.LoadLimit} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Vehicle.LoadLimit) + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.class, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartLoadIntervalFieldBuilder(); + getEndLoadIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxLoad_ = 0L; + softMaxLoad_ = 0L; + costPerUnitAboveSoftMax_ = 0D; + startLoadInterval_ = null; + if (startLoadIntervalBuilder_ != null) { + startLoadIntervalBuilder_.dispose(); + startLoadIntervalBuilder_ = null; + } + endLoadInterval_ = null; + if (endLoadIntervalBuilder_ != null) { + endLoadIntervalBuilder_.dispose(); + endLoadIntervalBuilder_ = 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_Vehicle_LoadLimit_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit build() { + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit buildPartial() { + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit result = + new com.google.maps.routeoptimization.v1.Vehicle.LoadLimit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.Vehicle.LoadLimit result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxLoad_ = maxLoad_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.softMaxLoad_ = softMaxLoad_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.costPerUnitAboveSoftMax_ = costPerUnitAboveSoftMax_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.startLoadInterval_ = + startLoadIntervalBuilder_ == null + ? startLoadInterval_ + : startLoadIntervalBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.endLoadInterval_ = + endLoadIntervalBuilder_ == null ? endLoadInterval_ : endLoadIntervalBuilder_.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.Vehicle.LoadLimit) { + return mergeFrom((com.google.maps.routeoptimization.v1.Vehicle.LoadLimit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Vehicle.LoadLimit other) { + if (other == com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.getDefaultInstance()) + return this; + if (other.hasMaxLoad()) { + setMaxLoad(other.getMaxLoad()); + } + if (other.getSoftMaxLoad() != 0L) { + setSoftMaxLoad(other.getSoftMaxLoad()); + } + if (other.getCostPerUnitAboveSoftMax() != 0D) { + setCostPerUnitAboveSoftMax(other.getCostPerUnitAboveSoftMax()); + } + if (other.hasStartLoadInterval()) { + mergeStartLoadInterval(other.getStartLoadInterval()); + } + if (other.hasEndLoadInterval()) { + mergeEndLoadInterval(other.getEndLoadInterval()); + } + 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: + { + maxLoad_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + softMaxLoad_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 25: + { + costPerUnitAboveSoftMax_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 34: + { + input.readMessage( + getStartLoadIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + getEndLoadIntervalFieldBuilder().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 long maxLoad_; + /** + * + * + *
+       * The maximum acceptable amount of load.
+       * 
+ * + * optional int64 max_load = 1; + * + * @return Whether the maxLoad field is set. + */ + @java.lang.Override + public boolean hasMaxLoad() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The maximum acceptable amount of load.
+       * 
+ * + * optional int64 max_load = 1; + * + * @return The maxLoad. + */ + @java.lang.Override + public long getMaxLoad() { + return maxLoad_; + } + /** + * + * + *
+       * The maximum acceptable amount of load.
+       * 
+ * + * optional int64 max_load = 1; + * + * @param value The maxLoad to set. + * @return This builder for chaining. + */ + public Builder setMaxLoad(long value) { + + maxLoad_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The maximum acceptable amount of load.
+       * 
+ * + * optional int64 max_load = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaxLoad() { + bitField0_ = (bitField0_ & ~0x00000001); + maxLoad_ = 0L; + onChanged(); + return this; + } + + private long softMaxLoad_; + /** + * + * + *
+       * A soft limit of the load. See
+       * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
+       * 
+ * + * int64 soft_max_load = 2; + * + * @return The softMaxLoad. + */ + @java.lang.Override + public long getSoftMaxLoad() { + return softMaxLoad_; + } + /** + * + * + *
+       * A soft limit of the load. See
+       * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
+       * 
+ * + * int64 soft_max_load = 2; + * + * @param value The softMaxLoad to set. + * @return This builder for chaining. + */ + public Builder setSoftMaxLoad(long value) { + + softMaxLoad_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit of the load. See
+       * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max].
+       * 
+ * + * int64 soft_max_load = 2; + * + * @return This builder for chaining. + */ + public Builder clearSoftMaxLoad() { + bitField0_ = (bitField0_ & ~0x00000002); + softMaxLoad_ = 0L; + onChanged(); + return this; + } + + private double costPerUnitAboveSoftMax_; + /** + * + * + *
+       * If the load ever exceeds
+       * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]
+       * along this vehicle's route, the following cost penalty applies (only once
+       * per vehicle): (load -
+       * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
+       * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
+       * add up and must be in the same unit as
+       * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+       * 
+ * + * double cost_per_unit_above_soft_max = 3; + * + * @return The costPerUnitAboveSoftMax. + */ + @java.lang.Override + public double getCostPerUnitAboveSoftMax() { + return costPerUnitAboveSoftMax_; + } + /** + * + * + *
+       * If the load ever exceeds
+       * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]
+       * along this vehicle's route, the following cost penalty applies (only once
+       * per vehicle): (load -
+       * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
+       * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
+       * add up and must be in the same unit as
+       * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+       * 
+ * + * double cost_per_unit_above_soft_max = 3; + * + * @param value The costPerUnitAboveSoftMax to set. + * @return This builder for chaining. + */ + public Builder setCostPerUnitAboveSoftMax(double value) { + + costPerUnitAboveSoftMax_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * If the load ever exceeds
+       * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]
+       * along this vehicle's route, the following cost penalty applies (only once
+       * per vehicle): (load -
+       * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load])
+       * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
+       * add up and must be in the same unit as
+       * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+       * 
+ * + * double cost_per_unit_above_soft_max = 3; + * + * @return This builder for chaining. + */ + public Builder clearCostPerUnitAboveSoftMax() { + bitField0_ = (bitField0_ & ~0x00000004); + costPerUnitAboveSoftMax_ = 0D; + onChanged(); + return this; + } + + private com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval startLoadInterval_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder> + startLoadIntervalBuilder_; + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + * + * @return Whether the startLoadInterval field is set. + */ + public boolean hasStartLoadInterval() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + * + * @return The startLoadInterval. + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + getStartLoadInterval() { + if (startLoadIntervalBuilder_ == null) { + return startLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : startLoadInterval_; + } else { + return startLoadIntervalBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + public Builder setStartLoadInterval( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval value) { + if (startLoadIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startLoadInterval_ = value; + } else { + startLoadIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + public Builder setStartLoadInterval( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder builderForValue) { + if (startLoadIntervalBuilder_ == null) { + startLoadInterval_ = builderForValue.build(); + } else { + startLoadIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + public Builder mergeStartLoadInterval( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval value) { + if (startLoadIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && startLoadInterval_ != null + && startLoadInterval_ + != com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + .getDefaultInstance()) { + getStartLoadIntervalBuilder().mergeFrom(value); + } else { + startLoadInterval_ = value; + } + } else { + startLoadIntervalBuilder_.mergeFrom(value); + } + if (startLoadInterval_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + public Builder clearStartLoadInterval() { + bitField0_ = (bitField0_ & ~0x00000008); + startLoadInterval_ = null; + if (startLoadIntervalBuilder_ != null) { + startLoadIntervalBuilder_.dispose(); + startLoadIntervalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder + getStartLoadIntervalBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getStartLoadIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder + getStartLoadIntervalOrBuilder() { + if (startLoadIntervalBuilder_ != null) { + return startLoadIntervalBuilder_.getMessageOrBuilder(); + } else { + return startLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : startLoadInterval_; + } + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the start of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder> + getStartLoadIntervalFieldBuilder() { + if (startLoadIntervalBuilder_ == null) { + startLoadIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder>( + getStartLoadInterval(), getParentForChildren(), isClean()); + startLoadInterval_ = null; + } + return startLoadIntervalBuilder_; + } + + private com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval endLoadInterval_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder> + endLoadIntervalBuilder_; + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + * + * @return Whether the endLoadInterval field is set. + */ + public boolean hasEndLoadInterval() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + * + * @return The endLoadInterval. + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval getEndLoadInterval() { + if (endLoadIntervalBuilder_ == null) { + return endLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : endLoadInterval_; + } else { + return endLoadIntervalBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + public Builder setEndLoadInterval( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval value) { + if (endLoadIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endLoadInterval_ = value; + } else { + endLoadIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + public Builder setEndLoadInterval( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder builderForValue) { + if (endLoadIntervalBuilder_ == null) { + endLoadInterval_ = builderForValue.build(); + } else { + endLoadIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + public Builder mergeEndLoadInterval( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval value) { + if (endLoadIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && endLoadInterval_ != null + && endLoadInterval_ + != com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + .getDefaultInstance()) { + getEndLoadIntervalBuilder().mergeFrom(value); + } else { + endLoadInterval_ = value; + } + } else { + endLoadIntervalBuilder_.mergeFrom(value); + } + if (endLoadInterval_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + public Builder clearEndLoadInterval() { + bitField0_ = (bitField0_ & ~0x00000010); + endLoadInterval_ = null; + if (endLoadIntervalBuilder_ != null) { + endLoadIntervalBuilder_.dispose(); + endLoadIntervalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder + getEndLoadIntervalBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getEndLoadIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder + getEndLoadIntervalOrBuilder() { + if (endLoadIntervalBuilder_ != null) { + return endLoadIntervalBuilder_.getMessageOrBuilder(); + } else { + return endLoadInterval_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.getDefaultInstance() + : endLoadInterval_; + } + } + /** + * + * + *
+       * The acceptable load interval of the vehicle at the end of the route.
+       * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder> + getEndLoadIntervalFieldBuilder() { + if (endLoadIntervalBuilder_ == null) { + endLoadIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.Builder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.IntervalOrBuilder>( + getEndLoadInterval(), getParentForChildren(), isClean()); + endLoadInterval_ = null; + } + return endLoadIntervalBuilder_; + } + + @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.Vehicle.LoadLimit) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Vehicle.LoadLimit) + private static final com.google.maps.routeoptimization.v1.Vehicle.LoadLimit DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Vehicle.LoadLimit(); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.LoadLimit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LoadLimit 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.Vehicle.LoadLimit getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DurationLimitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Vehicle.DurationLimit) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A hard limit constraining the duration to be at most max_duration.
+     * 
+ * + * .google.protobuf.Duration max_duration = 1; + * + * @return Whether the maxDuration field is set. + */ + boolean hasMaxDuration(); + /** + * + * + *
+     * A hard limit constraining the duration to be at most max_duration.
+     * 
+ * + * .google.protobuf.Duration max_duration = 1; + * + * @return The maxDuration. + */ + com.google.protobuf.Duration getMaxDuration(); + /** + * + * + *
+     * A hard limit constraining the duration to be at most max_duration.
+     * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder(); + + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost. This cost adds up to other costs defined in
+     * the model, with the same unit.
+     *
+     * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+     * also defined, `soft_max_duration` must be less than max_duration.
+     * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + * + * @return Whether the softMaxDuration field is set. + */ + boolean hasSoftMaxDuration(); + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost. This cost adds up to other costs defined in
+     * the model, with the same unit.
+     *
+     * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+     * also defined, `soft_max_duration` must be less than max_duration.
+     * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + * + * @return The softMaxDuration. + */ + com.google.protobuf.Duration getSoftMaxDuration(); + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost. This cost adds up to other costs defined in
+     * the model, with the same unit.
+     *
+     * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+     * also defined, `soft_max_duration` must be less than max_duration.
+     * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getSoftMaxDurationOrBuilder(); + + /** + * + * + *
+     * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     * ```
+     *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return Whether the costPerHourAfterSoftMax field is set. + */ + boolean hasCostPerHourAfterSoftMax(); + /** + * + * + *
+     * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     * ```
+     *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return The costPerHourAfterSoftMax. + */ + double getCostPerHourAfterSoftMax(); + + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost, quadratic in the duration. This cost adds
+     * up to other costs defined in the model, with the same unit.
+     *
+     * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+     * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+     * less than `max_duration`, and the difference must be no larger than one
+     * day:
+     *
+     *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+     * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + * + * @return Whether the quadraticSoftMaxDuration field is set. + */ + boolean hasQuadraticSoftMaxDuration(); + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost, quadratic in the duration. This cost adds
+     * up to other costs defined in the model, with the same unit.
+     *
+     * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+     * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+     * less than `max_duration`, and the difference must be no larger than one
+     * day:
+     *
+     *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+     * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + * + * @return The quadraticSoftMaxDuration. + */ + com.google.protobuf.Duration getQuadraticSoftMaxDuration(); + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost, quadratic in the duration. This cost adds
+     * up to other costs defined in the model, with the same unit.
+     *
+     * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+     * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+     * less than `max_duration`, and the difference must be no larger than one
+     * day:
+     *
+     *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+     * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getQuadraticSoftMaxDurationOrBuilder(); + + /** + * + * + *
+     * Cost per square hour incurred if the
+     * `quadratic_soft_max_duration` threshold is violated.
+     *
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     *
+     * ```
+     *   cost_per_square_hour_after_quadratic_soft_max *
+     *   (duration - quadratic_soft_max_duration)^2
+     * ```
+     *
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return Whether the costPerSquareHourAfterQuadraticSoftMax field is set. + */ + boolean hasCostPerSquareHourAfterQuadraticSoftMax(); + /** + * + * + *
+     * Cost per square hour incurred if the
+     * `quadratic_soft_max_duration` threshold is violated.
+     *
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     *
+     * ```
+     *   cost_per_square_hour_after_quadratic_soft_max *
+     *   (duration - quadratic_soft_max_duration)^2
+     * ```
+     *
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return The costPerSquareHourAfterQuadraticSoftMax. + */ + double getCostPerSquareHourAfterQuadraticSoftMax(); + } + /** + * + * + *
+   * A limit defining a maximum duration of the route of a vehicle. It can be
+   * either hard or soft.
+   *
+   * When a soft limit field is defined, both the soft max threshold and its
+   * associated cost must be defined together.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle.DurationLimit} + */ + public static final class DurationLimit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Vehicle.DurationLimit) + DurationLimitOrBuilder { + private static final long serialVersionUID = 0L; + // Use DurationLimit.newBuilder() to construct. + private DurationLimit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DurationLimit() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DurationLimit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.class, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder.class); + } + + private int bitField0_; + public static final int MAX_DURATION_FIELD_NUMBER = 1; + private com.google.protobuf.Duration maxDuration_; + /** + * + * + *
+     * A hard limit constraining the duration to be at most max_duration.
+     * 
+ * + * .google.protobuf.Duration max_duration = 1; + * + * @return Whether the maxDuration field is set. + */ + @java.lang.Override + public boolean hasMaxDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * A hard limit constraining the duration to be at most max_duration.
+     * 
+ * + * .google.protobuf.Duration max_duration = 1; + * + * @return The maxDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getMaxDuration() { + return maxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxDuration_; + } + /** + * + * + *
+     * A hard limit constraining the duration to be at most max_duration.
+     * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder() { + return maxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxDuration_; + } + + public static final int SOFT_MAX_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration softMaxDuration_; + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost. This cost adds up to other costs defined in
+     * the model, with the same unit.
+     *
+     * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+     * also defined, `soft_max_duration` must be less than max_duration.
+     * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + * + * @return Whether the softMaxDuration field is set. + */ + @java.lang.Override + public boolean hasSoftMaxDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost. This cost adds up to other costs defined in
+     * the model, with the same unit.
+     *
+     * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+     * also defined, `soft_max_duration` must be less than max_duration.
+     * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + * + * @return The softMaxDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getSoftMaxDuration() { + return softMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : softMaxDuration_; + } + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost. This cost adds up to other costs defined in
+     * the model, with the same unit.
+     *
+     * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+     * also defined, `soft_max_duration` must be less than max_duration.
+     * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getSoftMaxDurationOrBuilder() { + return softMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : softMaxDuration_; + } + + public static final int COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER = 3; + private double costPerHourAfterSoftMax_ = 0D; + /** + * + * + *
+     * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     * ```
+     *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return Whether the costPerHourAfterSoftMax field is set. + */ + @java.lang.Override + public boolean hasCostPerHourAfterSoftMax() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     * ```
+     *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+     * ```
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return The costPerHourAfterSoftMax. + */ + @java.lang.Override + public double getCostPerHourAfterSoftMax() { + return costPerHourAfterSoftMax_; + } + + public static final int QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration quadraticSoftMaxDuration_; + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost, quadratic in the duration. This cost adds
+     * up to other costs defined in the model, with the same unit.
+     *
+     * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+     * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+     * less than `max_duration`, and the difference must be no larger than one
+     * day:
+     *
+     *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+     * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + * + * @return Whether the quadraticSoftMaxDuration field is set. + */ + @java.lang.Override + public boolean hasQuadraticSoftMaxDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost, quadratic in the duration. This cost adds
+     * up to other costs defined in the model, with the same unit.
+     *
+     * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+     * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+     * less than `max_duration`, and the difference must be no larger than one
+     * day:
+     *
+     *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+     * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + * + * @return The quadraticSoftMaxDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getQuadraticSoftMaxDuration() { + return quadraticSoftMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : quadraticSoftMaxDuration_; + } + /** + * + * + *
+     * A soft limit not enforcing a maximum duration limit, but when violated
+     * makes the route incur a cost, quadratic in the duration. This cost adds
+     * up to other costs defined in the model, with the same unit.
+     *
+     * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+     * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+     * less than `max_duration`, and the difference must be no larger than one
+     * day:
+     *
+     *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+     * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getQuadraticSoftMaxDurationOrBuilder() { + return quadraticSoftMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : quadraticSoftMaxDuration_; + } + + public static final int COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER = 5; + private double costPerSquareHourAfterQuadraticSoftMax_ = 0D; + /** + * + * + *
+     * Cost per square hour incurred if the
+     * `quadratic_soft_max_duration` threshold is violated.
+     *
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     *
+     * ```
+     *   cost_per_square_hour_after_quadratic_soft_max *
+     *   (duration - quadratic_soft_max_duration)^2
+     * ```
+     *
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return Whether the costPerSquareHourAfterQuadraticSoftMax field is set. + */ + @java.lang.Override + public boolean hasCostPerSquareHourAfterQuadraticSoftMax() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Cost per square hour incurred if the
+     * `quadratic_soft_max_duration` threshold is violated.
+     *
+     * The additional cost is 0 if the duration is under the threshold,
+     * otherwise the cost depends on the duration as follows:
+     *
+     * ```
+     *   cost_per_square_hour_after_quadratic_soft_max *
+     *   (duration - quadratic_soft_max_duration)^2
+     * ```
+     *
+     * The cost must be nonnegative.
+     * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return The costPerSquareHourAfterQuadraticSoftMax. + */ + @java.lang.Override + public double getCostPerSquareHourAfterQuadraticSoftMax() { + return costPerSquareHourAfterQuadraticSoftMax_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMaxDuration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getSoftMaxDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(3, costPerHourAfterSoftMax_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(4, getQuadraticSoftMaxDuration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeDouble(5, costPerSquareHourAfterQuadraticSoftMax_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMaxDuration()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSoftMaxDuration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize(3, costPerHourAfterSoftMax_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getQuadraticSoftMaxDuration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 5, costPerSquareHourAfterQuadraticSoftMax_); + } + 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.Vehicle.DurationLimit)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit other = + (com.google.maps.routeoptimization.v1.Vehicle.DurationLimit) obj; + + if (hasMaxDuration() != other.hasMaxDuration()) return false; + if (hasMaxDuration()) { + if (!getMaxDuration().equals(other.getMaxDuration())) return false; + } + if (hasSoftMaxDuration() != other.hasSoftMaxDuration()) return false; + if (hasSoftMaxDuration()) { + if (!getSoftMaxDuration().equals(other.getSoftMaxDuration())) return false; + } + if (hasCostPerHourAfterSoftMax() != other.hasCostPerHourAfterSoftMax()) return false; + if (hasCostPerHourAfterSoftMax()) { + if (java.lang.Double.doubleToLongBits(getCostPerHourAfterSoftMax()) + != java.lang.Double.doubleToLongBits(other.getCostPerHourAfterSoftMax())) return false; + } + if (hasQuadraticSoftMaxDuration() != other.hasQuadraticSoftMaxDuration()) return false; + if (hasQuadraticSoftMaxDuration()) { + if (!getQuadraticSoftMaxDuration().equals(other.getQuadraticSoftMaxDuration())) + return false; + } + if (hasCostPerSquareHourAfterQuadraticSoftMax() + != other.hasCostPerSquareHourAfterQuadraticSoftMax()) return false; + if (hasCostPerSquareHourAfterQuadraticSoftMax()) { + if (java.lang.Double.doubleToLongBits(getCostPerSquareHourAfterQuadraticSoftMax()) + != java.lang.Double.doubleToLongBits(other.getCostPerSquareHourAfterQuadraticSoftMax())) + 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 (hasMaxDuration()) { + hash = (37 * hash) + MAX_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMaxDuration().hashCode(); + } + if (hasSoftMaxDuration()) { + hash = (37 * hash) + SOFT_MAX_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getSoftMaxDuration().hashCode(); + } + if (hasCostPerHourAfterSoftMax()) { + hash = (37 * hash) + COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerHourAfterSoftMax())); + } + if (hasQuadraticSoftMaxDuration()) { + hash = (37 * hash) + QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getQuadraticSoftMaxDuration().hashCode(); + } + if (hasCostPerSquareHourAfterQuadraticSoftMax()) { + hash = (37 * hash) + COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerSquareHourAfterQuadraticSoftMax())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit 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.Vehicle.DurationLimit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit 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.Vehicle.DurationLimit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit 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.Vehicle.DurationLimit parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit 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.Vehicle.DurationLimit parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit 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.Vehicle.DurationLimit 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.Vehicle.DurationLimit 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.Vehicle.DurationLimit 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 limit defining a maximum duration of the route of a vehicle. It can be
+     * either hard or soft.
+     *
+     * When a soft limit field is defined, both the soft max threshold and its
+     * associated cost must be defined together.
+     * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle.DurationLimit} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Vehicle.DurationLimit) + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_DurationLimit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.class, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMaxDurationFieldBuilder(); + getSoftMaxDurationFieldBuilder(); + getQuadraticSoftMaxDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxDuration_ = null; + if (maxDurationBuilder_ != null) { + maxDurationBuilder_.dispose(); + maxDurationBuilder_ = null; + } + softMaxDuration_ = null; + if (softMaxDurationBuilder_ != null) { + softMaxDurationBuilder_.dispose(); + softMaxDurationBuilder_ = null; + } + costPerHourAfterSoftMax_ = 0D; + quadraticSoftMaxDuration_ = null; + if (quadraticSoftMaxDurationBuilder_ != null) { + quadraticSoftMaxDurationBuilder_.dispose(); + quadraticSoftMaxDurationBuilder_ = null; + } + costPerSquareHourAfterQuadraticSoftMax_ = 0D; + 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_Vehicle_DurationLimit_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit + getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit build() { + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit buildPartial() { + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit result = + new com.google.maps.routeoptimization.v1.Vehicle.DurationLimit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxDuration_ = + maxDurationBuilder_ == null ? maxDuration_ : maxDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.softMaxDuration_ = + softMaxDurationBuilder_ == null ? softMaxDuration_ : softMaxDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.costPerHourAfterSoftMax_ = costPerHourAfterSoftMax_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quadraticSoftMaxDuration_ = + quadraticSoftMaxDurationBuilder_ == null + ? quadraticSoftMaxDuration_ + : quadraticSoftMaxDurationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.costPerSquareHourAfterQuadraticSoftMax_ = costPerSquareHourAfterQuadraticSoftMax_; + to_bitField0_ |= 0x00000010; + } + 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.Vehicle.DurationLimit) { + return mergeFrom((com.google.maps.routeoptimization.v1.Vehicle.DurationLimit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Vehicle.DurationLimit other) { + if (other + == com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance()) + return this; + if (other.hasMaxDuration()) { + mergeMaxDuration(other.getMaxDuration()); + } + if (other.hasSoftMaxDuration()) { + mergeSoftMaxDuration(other.getSoftMaxDuration()); + } + if (other.hasCostPerHourAfterSoftMax()) { + setCostPerHourAfterSoftMax(other.getCostPerHourAfterSoftMax()); + } + if (other.hasQuadraticSoftMaxDuration()) { + mergeQuadraticSoftMaxDuration(other.getQuadraticSoftMaxDuration()); + } + if (other.hasCostPerSquareHourAfterQuadraticSoftMax()) { + setCostPerSquareHourAfterQuadraticSoftMax( + other.getCostPerSquareHourAfterQuadraticSoftMax()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getMaxDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getSoftMaxDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 25: + { + costPerHourAfterSoftMax_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 34: + { + input.readMessage( + getQuadraticSoftMaxDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 41: + { + costPerSquareHourAfterQuadraticSoftMax_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration maxDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + maxDurationBuilder_; + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + * + * @return Whether the maxDuration field is set. + */ + public boolean hasMaxDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + * + * @return The maxDuration. + */ + public com.google.protobuf.Duration getMaxDuration() { + if (maxDurationBuilder_ == null) { + return maxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxDuration_; + } else { + return maxDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + public Builder setMaxDuration(com.google.protobuf.Duration value) { + if (maxDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxDuration_ = value; + } else { + maxDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + public Builder setMaxDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (maxDurationBuilder_ == null) { + maxDuration_ = builderForValue.build(); + } else { + maxDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + public Builder mergeMaxDuration(com.google.protobuf.Duration value) { + if (maxDurationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && maxDuration_ != null + && maxDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getMaxDurationBuilder().mergeFrom(value); + } else { + maxDuration_ = value; + } + } else { + maxDurationBuilder_.mergeFrom(value); + } + if (maxDuration_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + public Builder clearMaxDuration() { + bitField0_ = (bitField0_ & ~0x00000001); + maxDuration_ = null; + if (maxDurationBuilder_ != null) { + maxDurationBuilder_.dispose(); + maxDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + public com.google.protobuf.Duration.Builder getMaxDurationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMaxDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + public com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder() { + if (maxDurationBuilder_ != null) { + return maxDurationBuilder_.getMessageOrBuilder(); + } else { + return maxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxDuration_; + } + } + /** + * + * + *
+       * A hard limit constraining the duration to be at most max_duration.
+       * 
+ * + * .google.protobuf.Duration max_duration = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMaxDurationFieldBuilder() { + if (maxDurationBuilder_ == null) { + maxDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMaxDuration(), getParentForChildren(), isClean()); + maxDuration_ = null; + } + return maxDurationBuilder_; + } + + private com.google.protobuf.Duration softMaxDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + softMaxDurationBuilder_; + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + * + * @return Whether the softMaxDuration field is set. + */ + public boolean hasSoftMaxDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + * + * @return The softMaxDuration. + */ + public com.google.protobuf.Duration getSoftMaxDuration() { + if (softMaxDurationBuilder_ == null) { + return softMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : softMaxDuration_; + } else { + return softMaxDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + public Builder setSoftMaxDuration(com.google.protobuf.Duration value) { + if (softMaxDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + softMaxDuration_ = value; + } else { + softMaxDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + public Builder setSoftMaxDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (softMaxDurationBuilder_ == null) { + softMaxDuration_ = builderForValue.build(); + } else { + softMaxDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + public Builder mergeSoftMaxDuration(com.google.protobuf.Duration value) { + if (softMaxDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && softMaxDuration_ != null + && softMaxDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getSoftMaxDurationBuilder().mergeFrom(value); + } else { + softMaxDuration_ = value; + } + } else { + softMaxDurationBuilder_.mergeFrom(value); + } + if (softMaxDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + public Builder clearSoftMaxDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + softMaxDuration_ = null; + if (softMaxDurationBuilder_ != null) { + softMaxDurationBuilder_.dispose(); + softMaxDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + public com.google.protobuf.Duration.Builder getSoftMaxDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSoftMaxDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getSoftMaxDurationOrBuilder() { + if (softMaxDurationBuilder_ != null) { + return softMaxDurationBuilder_.getMessageOrBuilder(); + } else { + return softMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : softMaxDuration_; + } + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost. This cost adds up to other costs defined in
+       * the model, with the same unit.
+       *
+       * If defined, `soft_max_duration` must be nonnegative. If max_duration is
+       * also defined, `soft_max_duration` must be less than max_duration.
+       * 
+ * + * .google.protobuf.Duration soft_max_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getSoftMaxDurationFieldBuilder() { + if (softMaxDurationBuilder_ == null) { + softMaxDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getSoftMaxDuration(), getParentForChildren(), isClean()); + softMaxDuration_ = null; + } + return softMaxDurationBuilder_; + } + + private double costPerHourAfterSoftMax_; + /** + * + * + *
+       * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       * ```
+       *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+       * ```
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return Whether the costPerHourAfterSoftMax field is set. + */ + @java.lang.Override + public boolean hasCostPerHourAfterSoftMax() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       * ```
+       *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+       * ```
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return The costPerHourAfterSoftMax. + */ + @java.lang.Override + public double getCostPerHourAfterSoftMax() { + return costPerHourAfterSoftMax_; + } + /** + * + * + *
+       * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       * ```
+       *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+       * ```
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @param value The costPerHourAfterSoftMax to set. + * @return This builder for chaining. + */ + public Builder setCostPerHourAfterSoftMax(double value) { + + costPerHourAfterSoftMax_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Cost per hour incurred if the `soft_max_duration` threshold is violated.
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       * ```
+       *   cost_per_hour_after_soft_max * (duration - soft_max_duration)
+       * ```
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_hour_after_soft_max = 3; + * + * @return This builder for chaining. + */ + public Builder clearCostPerHourAfterSoftMax() { + bitField0_ = (bitField0_ & ~0x00000004); + costPerHourAfterSoftMax_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Duration quadraticSoftMaxDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + quadraticSoftMaxDurationBuilder_; + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + * + * @return Whether the quadraticSoftMaxDuration field is set. + */ + public boolean hasQuadraticSoftMaxDuration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + * + * @return The quadraticSoftMaxDuration. + */ + public com.google.protobuf.Duration getQuadraticSoftMaxDuration() { + if (quadraticSoftMaxDurationBuilder_ == null) { + return quadraticSoftMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : quadraticSoftMaxDuration_; + } else { + return quadraticSoftMaxDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + public Builder setQuadraticSoftMaxDuration(com.google.protobuf.Duration value) { + if (quadraticSoftMaxDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quadraticSoftMaxDuration_ = value; + } else { + quadraticSoftMaxDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + public Builder setQuadraticSoftMaxDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (quadraticSoftMaxDurationBuilder_ == null) { + quadraticSoftMaxDuration_ = builderForValue.build(); + } else { + quadraticSoftMaxDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + public Builder mergeQuadraticSoftMaxDuration(com.google.protobuf.Duration value) { + if (quadraticSoftMaxDurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && quadraticSoftMaxDuration_ != null + && quadraticSoftMaxDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getQuadraticSoftMaxDurationBuilder().mergeFrom(value); + } else { + quadraticSoftMaxDuration_ = value; + } + } else { + quadraticSoftMaxDurationBuilder_.mergeFrom(value); + } + if (quadraticSoftMaxDuration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + public Builder clearQuadraticSoftMaxDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + quadraticSoftMaxDuration_ = null; + if (quadraticSoftMaxDurationBuilder_ != null) { + quadraticSoftMaxDurationBuilder_.dispose(); + quadraticSoftMaxDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + public com.google.protobuf.Duration.Builder getQuadraticSoftMaxDurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getQuadraticSoftMaxDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getQuadraticSoftMaxDurationOrBuilder() { + if (quadraticSoftMaxDurationBuilder_ != null) { + return quadraticSoftMaxDurationBuilder_.getMessageOrBuilder(); + } else { + return quadraticSoftMaxDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : quadraticSoftMaxDuration_; + } + } + /** + * + * + *
+       * A soft limit not enforcing a maximum duration limit, but when violated
+       * makes the route incur a cost, quadratic in the duration. This cost adds
+       * up to other costs defined in the model, with the same unit.
+       *
+       * If defined, `quadratic_soft_max_duration` must be nonnegative. If
+       * `max_duration` is also defined, `quadratic_soft_max_duration` must be
+       * less than `max_duration`, and the difference must be no larger than one
+       * day:
+       *
+       *    `max_duration - quadratic_soft_max_duration <= 86400 seconds`
+       * 
+ * + * .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getQuadraticSoftMaxDurationFieldBuilder() { + if (quadraticSoftMaxDurationBuilder_ == null) { + quadraticSoftMaxDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getQuadraticSoftMaxDuration(), getParentForChildren(), isClean()); + quadraticSoftMaxDuration_ = null; + } + return quadraticSoftMaxDurationBuilder_; + } + + private double costPerSquareHourAfterQuadraticSoftMax_; + /** + * + * + *
+       * Cost per square hour incurred if the
+       * `quadratic_soft_max_duration` threshold is violated.
+       *
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       *
+       * ```
+       *   cost_per_square_hour_after_quadratic_soft_max *
+       *   (duration - quadratic_soft_max_duration)^2
+       * ```
+       *
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return Whether the costPerSquareHourAfterQuadraticSoftMax field is set. + */ + @java.lang.Override + public boolean hasCostPerSquareHourAfterQuadraticSoftMax() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+       * Cost per square hour incurred if the
+       * `quadratic_soft_max_duration` threshold is violated.
+       *
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       *
+       * ```
+       *   cost_per_square_hour_after_quadratic_soft_max *
+       *   (duration - quadratic_soft_max_duration)^2
+       * ```
+       *
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return The costPerSquareHourAfterQuadraticSoftMax. + */ + @java.lang.Override + public double getCostPerSquareHourAfterQuadraticSoftMax() { + return costPerSquareHourAfterQuadraticSoftMax_; + } + /** + * + * + *
+       * Cost per square hour incurred if the
+       * `quadratic_soft_max_duration` threshold is violated.
+       *
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       *
+       * ```
+       *   cost_per_square_hour_after_quadratic_soft_max *
+       *   (duration - quadratic_soft_max_duration)^2
+       * ```
+       *
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @param value The costPerSquareHourAfterQuadraticSoftMax to set. + * @return This builder for chaining. + */ + public Builder setCostPerSquareHourAfterQuadraticSoftMax(double value) { + + costPerSquareHourAfterQuadraticSoftMax_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * Cost per square hour incurred if the
+       * `quadratic_soft_max_duration` threshold is violated.
+       *
+       * The additional cost is 0 if the duration is under the threshold,
+       * otherwise the cost depends on the duration as follows:
+       *
+       * ```
+       *   cost_per_square_hour_after_quadratic_soft_max *
+       *   (duration - quadratic_soft_max_duration)^2
+       * ```
+       *
+       * The cost must be nonnegative.
+       * 
+ * + * optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * + * @return This builder for chaining. + */ + public Builder clearCostPerSquareHourAfterQuadraticSoftMax() { + bitField0_ = (bitField0_ & ~0x00000010); + costPerSquareHourAfterQuadraticSoftMax_ = 0D; + 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.Vehicle.DurationLimit) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Vehicle.DurationLimit) + private static final com.google.maps.routeoptimization.v1.Vehicle.DurationLimit + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Vehicle.DurationLimit(); + } + + public static com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DurationLimit 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.Vehicle.DurationLimit getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int DISPLAY_NAME_FIELD_NUMBER = 32; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The user-defined display name of the vehicle.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 32; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The user-defined display name of the vehicle.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 32; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAVEL_MODE_FIELD_NUMBER = 1; + private int travelMode_ = 0; + /** + * + * + *
+   * The travel mode which affects the roads usable by the vehicle and its
+   * speed. See also `travel_duration_multiple`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return The enum numeric value on the wire for travelMode. + */ + @java.lang.Override + public int getTravelModeValue() { + return travelMode_; + } + /** + * + * + *
+   * The travel mode which affects the roads usable by the vehicle and its
+   * speed. See also `travel_duration_multiple`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return The travelMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.TravelMode getTravelMode() { + com.google.maps.routeoptimization.v1.Vehicle.TravelMode result = + com.google.maps.routeoptimization.v1.Vehicle.TravelMode.forNumber(travelMode_); + return result == null + ? com.google.maps.routeoptimization.v1.Vehicle.TravelMode.UNRECOGNIZED + : result; + } + + public static final int START_LOCATION_FIELD_NUMBER = 3; + private com.google.type.LatLng startLocation_; + /** + * + * + *
+   * Geographic location where the vehicle starts before picking up any
+   * shipments. If not specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng start_location = 3; + * + * @return Whether the startLocation field is set. + */ + @java.lang.Override + public boolean hasStartLocation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Geographic location where the vehicle starts before picking up any
+   * shipments. If not specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng start_location = 3; + * + * @return The startLocation. + */ + @java.lang.Override + public com.google.type.LatLng getStartLocation() { + return startLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : startLocation_; + } + /** + * + * + *
+   * Geographic location where the vehicle starts before picking up any
+   * shipments. If not specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng start_location = 3; + */ + @java.lang.Override + public com.google.type.LatLngOrBuilder getStartLocationOrBuilder() { + return startLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : startLocation_; + } + + public static final int START_WAYPOINT_FIELD_NUMBER = 4; + private com.google.maps.routeoptimization.v1.Waypoint startWaypoint_; + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle starts before
+   * picking up any shipments. If neither `start_waypoint` nor `start_location`
+   * is specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * + * @return Whether the startWaypoint field is set. + */ + @java.lang.Override + public boolean hasStartWaypoint() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle starts before
+   * picking up any shipments. If neither `start_waypoint` nor `start_location`
+   * is specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * + * @return The startWaypoint. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint getStartWaypoint() { + return startWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : startWaypoint_; + } + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle starts before
+   * picking up any shipments. If neither `start_waypoint` nor `start_location`
+   * is specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getStartWaypointOrBuilder() { + return startWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : startWaypoint_; + } + + public static final int END_LOCATION_FIELD_NUMBER = 5; + private com.google.type.LatLng endLocation_; + /** + * + * + *
+   * Geographic location where the vehicle ends after it has completed its last
+   * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+   * immediately when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng end_location = 5; + * + * @return Whether the endLocation field is set. + */ + @java.lang.Override + public boolean hasEndLocation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Geographic location where the vehicle ends after it has completed its last
+   * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+   * immediately when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng end_location = 5; + * + * @return The endLocation. + */ + @java.lang.Override + public com.google.type.LatLng getEndLocation() { + return endLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : endLocation_; + } + /** + * + * + *
+   * Geographic location where the vehicle ends after it has completed its last
+   * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+   * immediately when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng end_location = 5; + */ + @java.lang.Override + public com.google.type.LatLngOrBuilder getEndLocationOrBuilder() { + return endLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : endLocation_; + } + + public static final int END_WAYPOINT_FIELD_NUMBER = 6; + private com.google.maps.routeoptimization.v1.Waypoint endWaypoint_; + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle ends after
+   * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+   * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+   * when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * + * @return Whether the endWaypoint field is set. + */ + @java.lang.Override + public boolean hasEndWaypoint() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle ends after
+   * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+   * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+   * when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * + * @return The endWaypoint. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint getEndWaypoint() { + return endWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : endWaypoint_; + } + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle ends after
+   * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+   * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+   * when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getEndWaypointOrBuilder() { + return endWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : endWaypoint_; + } + + public static final int START_TAGS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList startTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @return A list containing the startTags. + */ + public com.google.protobuf.ProtocolStringList getStartTagsList() { + return startTags_; + } + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @return The count of startTags. + */ + public int getStartTagsCount() { + return startTags_.size(); + } + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @param index The index of the element to return. + * @return The startTags at the given index. + */ + public java.lang.String getStartTags(int index) { + return startTags_.get(index); + } + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @param index The index of the value to return. + * @return The bytes of the startTags at the given index. + */ + public com.google.protobuf.ByteString getStartTagsBytes(int index) { + return startTags_.getByteString(index); + } + + public static final int END_TAGS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList endTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @return A list containing the endTags. + */ + public com.google.protobuf.ProtocolStringList getEndTagsList() { + return endTags_; + } + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @return The count of endTags. + */ + public int getEndTagsCount() { + return endTags_.size(); + } + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @param index The index of the element to return. + * @return The endTags at the given index. + */ + public java.lang.String getEndTags(int index) { + return endTags_.get(index); + } + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @param index The index of the value to return. + * @return The bytes of the endTags at the given index. + */ + public com.google.protobuf.ByteString getEndTagsBytes(int index) { + return endTags_.getByteString(index); + } + + public static final int START_TIME_WINDOWS_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List startTimeWindows_; + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + @java.lang.Override + public java.util.List getStartTimeWindowsList() { + return startTimeWindows_; + } + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + @java.lang.Override + public java.util.List + getStartTimeWindowsOrBuilderList() { + return startTimeWindows_; + } + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + @java.lang.Override + public int getStartTimeWindowsCount() { + return startTimeWindows_.size(); + } + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindow getStartTimeWindows(int index) { + return startTimeWindows_.get(index); + } + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getStartTimeWindowsOrBuilder( + int index) { + return startTimeWindows_.get(index); + } + + public static final int END_TIME_WINDOWS_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private java.util.List endTimeWindows_; + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + @java.lang.Override + public java.util.List getEndTimeWindowsList() { + return endTimeWindows_; + } + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + @java.lang.Override + public java.util.List + getEndTimeWindowsOrBuilderList() { + return endTimeWindows_; + } + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + @java.lang.Override + public int getEndTimeWindowsCount() { + return endTimeWindows_.size(); + } + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindow getEndTimeWindows(int index) { + return endTimeWindows_.get(index); + } + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getEndTimeWindowsOrBuilder( + int index) { + return endTimeWindows_.get(index); + } + + public static final int TRAVEL_DURATION_MULTIPLE_FIELD_NUMBER = 11; + private double travelDurationMultiple_ = 0D; + /** + * + * + *
+   * Specifies a multiplicative factor that can be used to increase or decrease
+   * travel times of this vehicle. For example, setting this to 2.0 means
+   * that this vehicle is slower and has travel times that are twice what they
+   * are for standard vehicles. This multiple does not affect visit durations.
+   * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+   * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+   * is standard, and this multiple is considered 1.0.
+   *
+   * WARNING: Travel times will be rounded to the nearest second after this
+   * multiple is applied but before performing any numerical operations, thus,
+   * a small multiple may result in a loss of precision.
+   *
+   * See also `extra_visit_duration_for_visit_type` below.
+   * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return Whether the travelDurationMultiple field is set. + */ + @java.lang.Override + public boolean hasTravelDurationMultiple() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Specifies a multiplicative factor that can be used to increase or decrease
+   * travel times of this vehicle. For example, setting this to 2.0 means
+   * that this vehicle is slower and has travel times that are twice what they
+   * are for standard vehicles. This multiple does not affect visit durations.
+   * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+   * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+   * is standard, and this multiple is considered 1.0.
+   *
+   * WARNING: Travel times will be rounded to the nearest second after this
+   * multiple is applied but before performing any numerical operations, thus,
+   * a small multiple may result in a loss of precision.
+   *
+   * See also `extra_visit_duration_for_visit_type` below.
+   * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return The travelDurationMultiple. + */ + @java.lang.Override + public double getTravelDurationMultiple() { + return travelDurationMultiple_; + } + + public static final int UNLOADING_POLICY_FIELD_NUMBER = 12; + private int unloadingPolicy_ = 0; + /** + * + * + *
+   * Unloading policy enforced on the vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return The enum numeric value on the wire for unloadingPolicy. + */ + @java.lang.Override + public int getUnloadingPolicyValue() { + return unloadingPolicy_; + } + /** + * + * + *
+   * Unloading policy enforced on the vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return The unloadingPolicy. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy getUnloadingPolicy() { + com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy result = + com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy.forNumber(unloadingPolicy_); + return result == null + ? com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy.UNRECOGNIZED + : result; + } + + public static final int LOAD_LIMITS_FIELD_NUMBER = 30; + + private static final class LoadLimitsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_LoadLimitsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + loadLimits_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + internalGetLoadLimits() { + if (loadLimits_ == null) { + return com.google.protobuf.MapField.emptyMapField(LoadLimitsDefaultEntryHolder.defaultEntry); + } + return loadLimits_; + } + + public int getLoadLimitsCount() { + return internalGetLoadLimits().getMap().size(); + } + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public boolean containsLoadLimits(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadLimits().getMap().containsKey(key); + } + /** Use {@link #getLoadLimitsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadLimits() { + return getLoadLimitsMap(); + } + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public java.util.Map + getLoadLimitsMap() { + return internalGetLoadLimits().getMap(); + } + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Vehicle.LoadLimit + getLoadLimitsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadLimits().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit getLoadLimitsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetLoadLimits().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int COST_PER_HOUR_FIELD_NUMBER = 16; + private double costPerHour_ = 0D; + /** + * + * + *
+   * Vehicle costs: all costs add up and must be in the same unit as
+   * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+   *
+   * Cost per hour of the vehicle route. This cost is applied to the total time
+   * taken by the route, and includes travel time, waiting time, and visit time.
+   * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result
+   * in additional latency.
+   * 
+ * + * double cost_per_hour = 16; + * + * @return The costPerHour. + */ + @java.lang.Override + public double getCostPerHour() { + return costPerHour_; + } + + public static final int COST_PER_TRAVELED_HOUR_FIELD_NUMBER = 17; + private double costPerTraveledHour_ = 0D; + /** + * + * + *
+   * Cost per traveled hour of the vehicle route. This cost is applied only to
+   * travel time taken by the route (i.e., that reported in
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]),
+   * and excludes waiting time and visit time.
+   * 
+ * + * double cost_per_traveled_hour = 17; + * + * @return The costPerTraveledHour. + */ + @java.lang.Override + public double getCostPerTraveledHour() { + return costPerTraveledHour_; + } + + public static final int COST_PER_KILOMETER_FIELD_NUMBER = 18; + private double costPerKilometer_ = 0D; + /** + * + * + *
+   * Cost per kilometer of the vehicle route. This cost is applied to the
+   * distance reported in the
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * and does not apply to any distance implicitly traveled from the
+   * `arrival_location` to the `departure_location` of a single `VisitRequest`.
+   * 
+ * + * double cost_per_kilometer = 18; + * + * @return The costPerKilometer. + */ + @java.lang.Override + public double getCostPerKilometer() { + return costPerKilometer_; + } + + public static final int FIXED_COST_FIELD_NUMBER = 19; + private double fixedCost_ = 0D; + /** + * + * + *
+   * Fixed cost applied if this vehicle is used to handle a shipment.
+   * 
+ * + * double fixed_cost = 19; + * + * @return The fixedCost. + */ + @java.lang.Override + public double getFixedCost() { + return fixedCost_; + } + + public static final int USED_IF_ROUTE_IS_EMPTY_FIELD_NUMBER = 20; + private boolean usedIfRouteIsEmpty_ = false; + /** + * + * + *
+   * This field only applies to vehicles when their route does not serve any
+   * shipments. It indicates if the vehicle should be considered as used or not
+   * in this case.
+   *
+   * If true, the vehicle goes from its start to its end location even if it
+   * doesn't serve any shipments, and time and distance costs resulting from its
+   * start --> end travel are taken into account.
+   *
+   * Otherwise, it doesn't travel from its start to its end location, and no
+   * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this
+   * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any
+   * information except for the vehicle index and label.
+   * 
+ * + * bool used_if_route_is_empty = 20; + * + * @return The usedIfRouteIsEmpty. + */ + @java.lang.Override + public boolean getUsedIfRouteIsEmpty() { + return usedIfRouteIsEmpty_; + } + + public static final int ROUTE_DURATION_LIMIT_FIELD_NUMBER = 21; + private com.google.maps.routeoptimization.v1.Vehicle.DurationLimit routeDurationLimit_; + /** + * + * + *
+   * Limit applied to the total duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route duration of a vehicle is the
+   * difference between its `vehicle_end_time` and `vehicle_start_time`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + * @return Whether the routeDurationLimit field is set. + */ + @java.lang.Override + public boolean hasRouteDurationLimit() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Limit applied to the total duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route duration of a vehicle is the
+   * difference between its `vehicle_end_time` and `vehicle_start_time`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + * @return The routeDurationLimit. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getRouteDurationLimit() { + return routeDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : routeDurationLimit_; + } + /** + * + * + *
+   * Limit applied to the total duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route duration of a vehicle is the
+   * difference between its `vehicle_end_time` and `vehicle_start_time`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder + getRouteDurationLimitOrBuilder() { + return routeDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : routeDurationLimit_; + } + + public static final int TRAVEL_DURATION_LIMIT_FIELD_NUMBER = 22; + private com.google.maps.routeoptimization.v1.Vehicle.DurationLimit travelDurationLimit_; + /** + * + * + *
+   * Limit applied to the travel duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route travel duration is the sum of all its
+   * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + * + * @return Whether the travelDurationLimit field is set. + */ + @java.lang.Override + public boolean hasTravelDurationLimit() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+   * Limit applied to the travel duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route travel duration is the sum of all its
+   * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + * + * @return The travelDurationLimit. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getTravelDurationLimit() { + return travelDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : travelDurationLimit_; + } + /** + * + * + *
+   * Limit applied to the travel duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route travel duration is the sum of all its
+   * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder + getTravelDurationLimitOrBuilder() { + return travelDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : travelDurationLimit_; + } + + public static final int ROUTE_DISTANCE_LIMIT_FIELD_NUMBER = 23; + private com.google.maps.routeoptimization.v1.DistanceLimit routeDistanceLimit_; + /** + * + * + *
+   * Limit applied to the total distance of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route distance is the sum of all its
+   * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * + * @return Whether the routeDistanceLimit field is set. + */ + @java.lang.Override + public boolean hasRouteDistanceLimit() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+   * Limit applied to the total distance of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route distance is the sum of all its
+   * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * + * @return The routeDistanceLimit. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimit getRouteDistanceLimit() { + return routeDistanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : routeDistanceLimit_; + } + /** + * + * + *
+   * Limit applied to the total distance of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route distance is the sum of all its
+   * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder + getRouteDistanceLimitOrBuilder() { + return routeDistanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : routeDistanceLimit_; + } + + public static final int EXTRA_VISIT_DURATION_FOR_VISIT_TYPE_FIELD_NUMBER = 24; + + private static final class ExtraVisitDurationForVisitTypeDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_ExtraVisitDurationForVisitTypeEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Duration.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + extraVisitDurationForVisitType_; + + private com.google.protobuf.MapField + internalGetExtraVisitDurationForVisitType() { + if (extraVisitDurationForVisitType_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ExtraVisitDurationForVisitTypeDefaultEntryHolder.defaultEntry); + } + return extraVisitDurationForVisitType_; + } + + public int getExtraVisitDurationForVisitTypeCount() { + return internalGetExtraVisitDurationForVisitType().getMap().size(); + } + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public boolean containsExtraVisitDurationForVisitType(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetExtraVisitDurationForVisitType().getMap().containsKey(key); + } + /** Use {@link #getExtraVisitDurationForVisitTypeMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getExtraVisitDurationForVisitType() { + return getExtraVisitDurationForVisitTypeMap(); + } + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public java.util.Map + getExtraVisitDurationForVisitTypeMap() { + return internalGetExtraVisitDurationForVisitType().getMap(); + } + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Duration getExtraVisitDurationForVisitTypeOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Duration defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetExtraVisitDurationForVisitType().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public com.google.protobuf.Duration getExtraVisitDurationForVisitTypeOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetExtraVisitDurationForVisitType().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int BREAK_RULE_FIELD_NUMBER = 25; + private com.google.maps.routeoptimization.v1.BreakRule breakRule_; + /** + * + * + *
+   * Describes the break schedule to be enforced on this vehicle.
+   * If empty, no breaks will be scheduled for this vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * + * @return Whether the breakRule field is set. + */ + @java.lang.Override + public boolean hasBreakRule() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+   * Describes the break schedule to be enforced on this vehicle.
+   * If empty, no breaks will be scheduled for this vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * + * @return The breakRule. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRule getBreakRule() { + return breakRule_ == null + ? com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance() + : breakRule_; + } + /** + * + * + *
+   * Describes the break schedule to be enforced on this vehicle.
+   * If empty, no breaks will be scheduled for this vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.BreakRuleOrBuilder getBreakRuleOrBuilder() { + return breakRule_ == null + ? com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance() + : breakRule_; + } + + public static final int LABEL_FIELD_NUMBER = 27; + + @SuppressWarnings("serial") + private volatile java.lang.Object label_ = ""; + /** + * + * + *
+   * Specifies a label for this vehicle. This label is reported in the response
+   * as the `vehicle_label` of the corresponding
+   * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+   * 
+ * + * string label = 27; + * + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + * + * + *
+   * Specifies a label for this vehicle. This label is reported in the response
+   * as the `vehicle_label` of the corresponding
+   * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+   * 
+ * + * string label = 27; + * + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IGNORE_FIELD_NUMBER = 28; + private boolean ignore_ = false; + /** + * + * + *
+   * If true, `used_if_route_is_empty` must be false, and this vehicle will
+   * remain unused.
+   *
+   * If a shipment is performed by an ignored vehicle in
+   * `injected_first_solution_routes`, it is skipped in the first solution but
+   * is free to be performed in the response.
+   *
+   * If a shipment is performed by an ignored vehicle in
+   * `injected_solution_constraint` and any related pickup/delivery is
+   * constrained to remain on the vehicle (i.e., not relaxed to level
+   * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response.
+   * If a shipment has a non-empty `allowed_vehicle_indices` field and all of
+   * the allowed vehicles are ignored, it is skipped in the response.
+   * 
+ * + * bool ignore = 28; + * + * @return The ignore. + */ + @java.lang.Override + public boolean getIgnore() { + return ignore_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (travelMode_ + != com.google.maps.routeoptimization.v1.Vehicle.TravelMode.TRAVEL_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, travelMode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getStartLocation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStartWaypoint()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getEndLocation()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getEndWaypoint()); + } + for (int i = 0; i < startTags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, startTags_.getRaw(i)); + } + for (int i = 0; i < endTags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, endTags_.getRaw(i)); + } + for (int i = 0; i < startTimeWindows_.size(); i++) { + output.writeMessage(9, startTimeWindows_.get(i)); + } + for (int i = 0; i < endTimeWindows_.size(); i++) { + output.writeMessage(10, endTimeWindows_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeDouble(11, travelDurationMultiple_); + } + if (unloadingPolicy_ + != com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy.UNLOADING_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(12, unloadingPolicy_); + } + if (java.lang.Double.doubleToRawLongBits(costPerHour_) != 0) { + output.writeDouble(16, costPerHour_); + } + if (java.lang.Double.doubleToRawLongBits(costPerTraveledHour_) != 0) { + output.writeDouble(17, costPerTraveledHour_); + } + if (java.lang.Double.doubleToRawLongBits(costPerKilometer_) != 0) { + output.writeDouble(18, costPerKilometer_); + } + if (java.lang.Double.doubleToRawLongBits(fixedCost_) != 0) { + output.writeDouble(19, fixedCost_); + } + if (usedIfRouteIsEmpty_ != false) { + output.writeBool(20, usedIfRouteIsEmpty_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(21, getRouteDurationLimit()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(22, getTravelDurationLimit()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(23, getRouteDistanceLimit()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetExtraVisitDurationForVisitType(), + ExtraVisitDurationForVisitTypeDefaultEntryHolder.defaultEntry, + 24); + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(25, getBreakRule()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, label_); + } + if (ignore_ != false) { + output.writeBool(28, ignore_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLoadLimits(), LoadLimitsDefaultEntryHolder.defaultEntry, 30); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 32, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (travelMode_ + != com.google.maps.routeoptimization.v1.Vehicle.TravelMode.TRAVEL_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, travelMode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartLocation()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartWaypoint()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndLocation()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndWaypoint()); + } + { + int dataSize = 0; + for (int i = 0; i < startTags_.size(); i++) { + dataSize += computeStringSizeNoTag(startTags_.getRaw(i)); + } + size += dataSize; + size += 1 * getStartTagsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < endTags_.size(); i++) { + dataSize += computeStringSizeNoTag(endTags_.getRaw(i)); + } + size += dataSize; + size += 1 * getEndTagsList().size(); + } + for (int i = 0; i < startTimeWindows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, startTimeWindows_.get(i)); + } + for (int i = 0; i < endTimeWindows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, endTimeWindows_.get(i)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(11, travelDurationMultiple_); + } + if (unloadingPolicy_ + != com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy.UNLOADING_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, unloadingPolicy_); + } + if (java.lang.Double.doubleToRawLongBits(costPerHour_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(16, costPerHour_); + } + if (java.lang.Double.doubleToRawLongBits(costPerTraveledHour_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(17, costPerTraveledHour_); + } + if (java.lang.Double.doubleToRawLongBits(costPerKilometer_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(18, costPerKilometer_); + } + if (java.lang.Double.doubleToRawLongBits(fixedCost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(19, fixedCost_); + } + if (usedIfRouteIsEmpty_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, usedIfRouteIsEmpty_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getRouteDurationLimit()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(22, getTravelDurationLimit()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getRouteDistanceLimit()); + } + for (java.util.Map.Entry entry : + internalGetExtraVisitDurationForVisitType().getMap().entrySet()) { + com.google.protobuf.MapEntry + extraVisitDurationForVisitType__ = + ExtraVisitDurationForVisitTypeDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 24, extraVisitDurationForVisitType__); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getBreakRule()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(label_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, label_); + } + if (ignore_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(28, ignore_); + } + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + entry : internalGetLoadLimits().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + loadLimits__ = + LoadLimitsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(30, loadLimits__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(32, displayName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.routeoptimization.v1.Vehicle)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Vehicle other = + (com.google.maps.routeoptimization.v1.Vehicle) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (travelMode_ != other.travelMode_) return false; + if (hasStartLocation() != other.hasStartLocation()) return false; + if (hasStartLocation()) { + if (!getStartLocation().equals(other.getStartLocation())) return false; + } + if (hasStartWaypoint() != other.hasStartWaypoint()) return false; + if (hasStartWaypoint()) { + if (!getStartWaypoint().equals(other.getStartWaypoint())) return false; + } + if (hasEndLocation() != other.hasEndLocation()) return false; + if (hasEndLocation()) { + if (!getEndLocation().equals(other.getEndLocation())) return false; + } + if (hasEndWaypoint() != other.hasEndWaypoint()) return false; + if (hasEndWaypoint()) { + if (!getEndWaypoint().equals(other.getEndWaypoint())) return false; + } + if (!getStartTagsList().equals(other.getStartTagsList())) return false; + if (!getEndTagsList().equals(other.getEndTagsList())) return false; + if (!getStartTimeWindowsList().equals(other.getStartTimeWindowsList())) return false; + if (!getEndTimeWindowsList().equals(other.getEndTimeWindowsList())) return false; + if (hasTravelDurationMultiple() != other.hasTravelDurationMultiple()) return false; + if (hasTravelDurationMultiple()) { + if (java.lang.Double.doubleToLongBits(getTravelDurationMultiple()) + != java.lang.Double.doubleToLongBits(other.getTravelDurationMultiple())) return false; + } + if (unloadingPolicy_ != other.unloadingPolicy_) return false; + if (!internalGetLoadLimits().equals(other.internalGetLoadLimits())) return false; + if (java.lang.Double.doubleToLongBits(getCostPerHour()) + != java.lang.Double.doubleToLongBits(other.getCostPerHour())) return false; + if (java.lang.Double.doubleToLongBits(getCostPerTraveledHour()) + != java.lang.Double.doubleToLongBits(other.getCostPerTraveledHour())) return false; + if (java.lang.Double.doubleToLongBits(getCostPerKilometer()) + != java.lang.Double.doubleToLongBits(other.getCostPerKilometer())) return false; + if (java.lang.Double.doubleToLongBits(getFixedCost()) + != java.lang.Double.doubleToLongBits(other.getFixedCost())) return false; + if (getUsedIfRouteIsEmpty() != other.getUsedIfRouteIsEmpty()) return false; + if (hasRouteDurationLimit() != other.hasRouteDurationLimit()) return false; + if (hasRouteDurationLimit()) { + if (!getRouteDurationLimit().equals(other.getRouteDurationLimit())) return false; + } + if (hasTravelDurationLimit() != other.hasTravelDurationLimit()) return false; + if (hasTravelDurationLimit()) { + if (!getTravelDurationLimit().equals(other.getTravelDurationLimit())) return false; + } + if (hasRouteDistanceLimit() != other.hasRouteDistanceLimit()) return false; + if (hasRouteDistanceLimit()) { + if (!getRouteDistanceLimit().equals(other.getRouteDistanceLimit())) return false; + } + if (!internalGetExtraVisitDurationForVisitType() + .equals(other.internalGetExtraVisitDurationForVisitType())) return false; + if (hasBreakRule() != other.hasBreakRule()) return false; + if (hasBreakRule()) { + if (!getBreakRule().equals(other.getBreakRule())) return false; + } + if (!getLabel().equals(other.getLabel())) return false; + if (getIgnore() != other.getIgnore()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + TRAVEL_MODE_FIELD_NUMBER; + hash = (53 * hash) + travelMode_; + if (hasStartLocation()) { + hash = (37 * hash) + START_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getStartLocation().hashCode(); + } + if (hasStartWaypoint()) { + hash = (37 * hash) + START_WAYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getStartWaypoint().hashCode(); + } + if (hasEndLocation()) { + hash = (37 * hash) + END_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndLocation().hashCode(); + } + if (hasEndWaypoint()) { + hash = (37 * hash) + END_WAYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndWaypoint().hashCode(); + } + if (getStartTagsCount() > 0) { + hash = (37 * hash) + START_TAGS_FIELD_NUMBER; + hash = (53 * hash) + getStartTagsList().hashCode(); + } + if (getEndTagsCount() > 0) { + hash = (37 * hash) + END_TAGS_FIELD_NUMBER; + hash = (53 * hash) + getEndTagsList().hashCode(); + } + if (getStartTimeWindowsCount() > 0) { + hash = (37 * hash) + START_TIME_WINDOWS_FIELD_NUMBER; + hash = (53 * hash) + getStartTimeWindowsList().hashCode(); + } + if (getEndTimeWindowsCount() > 0) { + hash = (37 * hash) + END_TIME_WINDOWS_FIELD_NUMBER; + hash = (53 * hash) + getEndTimeWindowsList().hashCode(); + } + if (hasTravelDurationMultiple()) { + hash = (37 * hash) + TRAVEL_DURATION_MULTIPLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getTravelDurationMultiple())); + } + hash = (37 * hash) + UNLOADING_POLICY_FIELD_NUMBER; + hash = (53 * hash) + unloadingPolicy_; + if (!internalGetLoadLimits().getMap().isEmpty()) { + hash = (37 * hash) + LOAD_LIMITS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLoadLimits().hashCode(); + } + hash = (37 * hash) + COST_PER_HOUR_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerHour())); + hash = (37 * hash) + COST_PER_TRAVELED_HOUR_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerTraveledHour())); + hash = (37 * hash) + COST_PER_KILOMETER_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCostPerKilometer())); + hash = (37 * hash) + FIXED_COST_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFixedCost())); + hash = (37 * hash) + USED_IF_ROUTE_IS_EMPTY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUsedIfRouteIsEmpty()); + if (hasRouteDurationLimit()) { + hash = (37 * hash) + ROUTE_DURATION_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getRouteDurationLimit().hashCode(); + } + if (hasTravelDurationLimit()) { + hash = (37 * hash) + TRAVEL_DURATION_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getTravelDurationLimit().hashCode(); + } + if (hasRouteDistanceLimit()) { + hash = (37 * hash) + ROUTE_DISTANCE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getRouteDistanceLimit().hashCode(); + } + if (!internalGetExtraVisitDurationForVisitType().getMap().isEmpty()) { + hash = (37 * hash) + EXTRA_VISIT_DURATION_FOR_VISIT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + internalGetExtraVisitDurationForVisitType().hashCode(); + } + if (hasBreakRule()) { + hash = (37 * hash) + BREAK_RULE_FIELD_NUMBER; + hash = (53 * hash) + getBreakRule().hashCode(); + } + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + IGNORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnore()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Vehicle parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle 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.Vehicle parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle 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.Vehicle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Vehicle 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.Vehicle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle 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.Vehicle parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Vehicle 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.Vehicle 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.Vehicle 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.Vehicle 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; + } + /** + * + * + *
+   * Models a vehicle in a shipment problem. Solving a shipment problem will
+   * build a route starting from `start_location` and ending at `end_location`
+   * for this vehicle. A route is a sequence of visits (see `ShipmentRoute`).
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Vehicle} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Vehicle) + com.google.maps.routeoptimization.v1.VehicleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 30: + return internalGetLoadLimits(); + case 24: + return internalGetExtraVisitDurationForVisitType(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 30: + return internalGetMutableLoadLimits(); + case 24: + return internalGetMutableExtraVisitDurationForVisitType(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Vehicle.class, + com.google.maps.routeoptimization.v1.Vehicle.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Vehicle.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartLocationFieldBuilder(); + getStartWaypointFieldBuilder(); + getEndLocationFieldBuilder(); + getEndWaypointFieldBuilder(); + getStartTimeWindowsFieldBuilder(); + getEndTimeWindowsFieldBuilder(); + getRouteDurationLimitFieldBuilder(); + getTravelDurationLimitFieldBuilder(); + getRouteDistanceLimitFieldBuilder(); + getBreakRuleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + displayName_ = ""; + travelMode_ = 0; + startLocation_ = null; + if (startLocationBuilder_ != null) { + startLocationBuilder_.dispose(); + startLocationBuilder_ = null; + } + startWaypoint_ = null; + if (startWaypointBuilder_ != null) { + startWaypointBuilder_.dispose(); + startWaypointBuilder_ = null; + } + endLocation_ = null; + if (endLocationBuilder_ != null) { + endLocationBuilder_.dispose(); + endLocationBuilder_ = null; + } + endWaypoint_ = null; + if (endWaypointBuilder_ != null) { + endWaypointBuilder_.dispose(); + endWaypointBuilder_ = null; + } + startTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + endTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (startTimeWindowsBuilder_ == null) { + startTimeWindows_ = java.util.Collections.emptyList(); + } else { + startTimeWindows_ = null; + startTimeWindowsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + if (endTimeWindowsBuilder_ == null) { + endTimeWindows_ = java.util.Collections.emptyList(); + } else { + endTimeWindows_ = null; + endTimeWindowsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + travelDurationMultiple_ = 0D; + unloadingPolicy_ = 0; + internalGetMutableLoadLimits().clear(); + costPerHour_ = 0D; + costPerTraveledHour_ = 0D; + costPerKilometer_ = 0D; + fixedCost_ = 0D; + usedIfRouteIsEmpty_ = false; + routeDurationLimit_ = null; + if (routeDurationLimitBuilder_ != null) { + routeDurationLimitBuilder_.dispose(); + routeDurationLimitBuilder_ = null; + } + travelDurationLimit_ = null; + if (travelDurationLimitBuilder_ != null) { + travelDurationLimitBuilder_.dispose(); + travelDurationLimitBuilder_ = null; + } + routeDistanceLimit_ = null; + if (routeDistanceLimitBuilder_ != null) { + routeDistanceLimitBuilder_.dispose(); + routeDistanceLimitBuilder_ = null; + } + internalGetMutableExtraVisitDurationForVisitType().clear(); + breakRule_ = null; + if (breakRuleBuilder_ != null) { + breakRuleBuilder_.dispose(); + breakRuleBuilder_ = null; + } + label_ = ""; + ignore_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Vehicle_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Vehicle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle build() { + com.google.maps.routeoptimization.v1.Vehicle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle buildPartial() { + com.google.maps.routeoptimization.v1.Vehicle result = + new com.google.maps.routeoptimization.v1.Vehicle(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.maps.routeoptimization.v1.Vehicle result) { + if (startTimeWindowsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + startTimeWindows_ = java.util.Collections.unmodifiableList(startTimeWindows_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.startTimeWindows_ = startTimeWindows_; + } else { + result.startTimeWindows_ = startTimeWindowsBuilder_.build(); + } + if (endTimeWindowsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + endTimeWindows_ = java.util.Collections.unmodifiableList(endTimeWindows_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.endTimeWindows_ = endTimeWindows_; + } else { + result.endTimeWindows_ = endTimeWindowsBuilder_.build(); + } + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.Vehicle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.travelMode_ = travelMode_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.startLocation_ = + startLocationBuilder_ == null ? startLocation_ : startLocationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.startWaypoint_ = + startWaypointBuilder_ == null ? startWaypoint_ : startWaypointBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.endLocation_ = + endLocationBuilder_ == null ? endLocation_ : endLocationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endWaypoint_ = + endWaypointBuilder_ == null ? endWaypoint_ : endWaypointBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + startTags_.makeImmutable(); + result.startTags_ = startTags_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + endTags_.makeImmutable(); + result.endTags_ = endTags_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.travelDurationMultiple_ = travelDurationMultiple_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.unloadingPolicy_ = unloadingPolicy_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.loadLimits_ = + internalGetLoadLimits().build(LoadLimitsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.costPerHour_ = costPerHour_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.costPerTraveledHour_ = costPerTraveledHour_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.costPerKilometer_ = costPerKilometer_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.fixedCost_ = fixedCost_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.usedIfRouteIsEmpty_ = usedIfRouteIsEmpty_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.routeDurationLimit_ = + routeDurationLimitBuilder_ == null + ? routeDurationLimit_ + : routeDurationLimitBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.travelDurationLimit_ = + travelDurationLimitBuilder_ == null + ? travelDurationLimit_ + : travelDurationLimitBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.routeDistanceLimit_ = + routeDistanceLimitBuilder_ == null + ? routeDistanceLimit_ + : routeDistanceLimitBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.extraVisitDurationForVisitType_ = + internalGetExtraVisitDurationForVisitType() + .build(ExtraVisitDurationForVisitTypeDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.breakRule_ = breakRuleBuilder_ == null ? breakRule_ : breakRuleBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.label_ = label_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.ignore_ = ignore_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.maps.routeoptimization.v1.Vehicle) { + return mergeFrom((com.google.maps.routeoptimization.v1.Vehicle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Vehicle other) { + if (other == com.google.maps.routeoptimization.v1.Vehicle.getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.travelMode_ != 0) { + setTravelModeValue(other.getTravelModeValue()); + } + if (other.hasStartLocation()) { + mergeStartLocation(other.getStartLocation()); + } + if (other.hasStartWaypoint()) { + mergeStartWaypoint(other.getStartWaypoint()); + } + if (other.hasEndLocation()) { + mergeEndLocation(other.getEndLocation()); + } + if (other.hasEndWaypoint()) { + mergeEndWaypoint(other.getEndWaypoint()); + } + if (!other.startTags_.isEmpty()) { + if (startTags_.isEmpty()) { + startTags_ = other.startTags_; + bitField0_ |= 0x00000040; + } else { + ensureStartTagsIsMutable(); + startTags_.addAll(other.startTags_); + } + onChanged(); + } + if (!other.endTags_.isEmpty()) { + if (endTags_.isEmpty()) { + endTags_ = other.endTags_; + bitField0_ |= 0x00000080; + } else { + ensureEndTagsIsMutable(); + endTags_.addAll(other.endTags_); + } + onChanged(); + } + if (startTimeWindowsBuilder_ == null) { + if (!other.startTimeWindows_.isEmpty()) { + if (startTimeWindows_.isEmpty()) { + startTimeWindows_ = other.startTimeWindows_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.addAll(other.startTimeWindows_); + } + onChanged(); + } + } else { + if (!other.startTimeWindows_.isEmpty()) { + if (startTimeWindowsBuilder_.isEmpty()) { + startTimeWindowsBuilder_.dispose(); + startTimeWindowsBuilder_ = null; + startTimeWindows_ = other.startTimeWindows_; + bitField0_ = (bitField0_ & ~0x00000100); + startTimeWindowsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStartTimeWindowsFieldBuilder() + : null; + } else { + startTimeWindowsBuilder_.addAllMessages(other.startTimeWindows_); + } + } + } + if (endTimeWindowsBuilder_ == null) { + if (!other.endTimeWindows_.isEmpty()) { + if (endTimeWindows_.isEmpty()) { + endTimeWindows_ = other.endTimeWindows_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.addAll(other.endTimeWindows_); + } + onChanged(); + } + } else { + if (!other.endTimeWindows_.isEmpty()) { + if (endTimeWindowsBuilder_.isEmpty()) { + endTimeWindowsBuilder_.dispose(); + endTimeWindowsBuilder_ = null; + endTimeWindows_ = other.endTimeWindows_; + bitField0_ = (bitField0_ & ~0x00000200); + endTimeWindowsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndTimeWindowsFieldBuilder() + : null; + } else { + endTimeWindowsBuilder_.addAllMessages(other.endTimeWindows_); + } + } + } + if (other.hasTravelDurationMultiple()) { + setTravelDurationMultiple(other.getTravelDurationMultiple()); + } + if (other.unloadingPolicy_ != 0) { + setUnloadingPolicyValue(other.getUnloadingPolicyValue()); + } + internalGetMutableLoadLimits().mergeFrom(other.internalGetLoadLimits()); + bitField0_ |= 0x00001000; + if (other.getCostPerHour() != 0D) { + setCostPerHour(other.getCostPerHour()); + } + if (other.getCostPerTraveledHour() != 0D) { + setCostPerTraveledHour(other.getCostPerTraveledHour()); + } + if (other.getCostPerKilometer() != 0D) { + setCostPerKilometer(other.getCostPerKilometer()); + } + if (other.getFixedCost() != 0D) { + setFixedCost(other.getFixedCost()); + } + if (other.getUsedIfRouteIsEmpty() != false) { + setUsedIfRouteIsEmpty(other.getUsedIfRouteIsEmpty()); + } + if (other.hasRouteDurationLimit()) { + mergeRouteDurationLimit(other.getRouteDurationLimit()); + } + if (other.hasTravelDurationLimit()) { + mergeTravelDurationLimit(other.getTravelDurationLimit()); + } + if (other.hasRouteDistanceLimit()) { + mergeRouteDistanceLimit(other.getRouteDistanceLimit()); + } + internalGetMutableExtraVisitDurationForVisitType() + .mergeFrom(other.internalGetExtraVisitDurationForVisitType()); + bitField0_ |= 0x00200000; + if (other.hasBreakRule()) { + mergeBreakRule(other.getBreakRule()); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + bitField0_ |= 0x00800000; + onChanged(); + } + if (other.getIgnore() != false) { + setIgnore(other.getIgnore()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + travelMode_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 8 + case 26: + { + input.readMessage(getStartLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getStartWaypointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getEndLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getEndWaypointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStartTagsIsMutable(); + startTags_.add(s); + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureEndTagsIsMutable(); + endTags_.add(s); + break; + } // case 66 + case 74: + { + com.google.maps.routeoptimization.v1.TimeWindow m = + input.readMessage( + com.google.maps.routeoptimization.v1.TimeWindow.parser(), + extensionRegistry); + if (startTimeWindowsBuilder_ == null) { + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.add(m); + } else { + startTimeWindowsBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: + { + com.google.maps.routeoptimization.v1.TimeWindow m = + input.readMessage( + com.google.maps.routeoptimization.v1.TimeWindow.parser(), + extensionRegistry); + if (endTimeWindowsBuilder_ == null) { + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.add(m); + } else { + endTimeWindowsBuilder_.addMessage(m); + } + break; + } // case 82 + case 89: + { + travelDurationMultiple_ = input.readDouble(); + bitField0_ |= 0x00000400; + break; + } // case 89 + case 96: + { + unloadingPolicy_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 129: + { + costPerHour_ = input.readDouble(); + bitField0_ |= 0x00002000; + break; + } // case 129 + case 137: + { + costPerTraveledHour_ = input.readDouble(); + bitField0_ |= 0x00004000; + break; + } // case 137 + case 145: + { + costPerKilometer_ = input.readDouble(); + bitField0_ |= 0x00008000; + break; + } // case 145 + case 153: + { + fixedCost_ = input.readDouble(); + bitField0_ |= 0x00010000; + break; + } // case 153 + case 160: + { + usedIfRouteIsEmpty_ = input.readBool(); + bitField0_ |= 0x00020000; + break; + } // case 160 + case 170: + { + input.readMessage( + getRouteDurationLimitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 170 + case 178: + { + input.readMessage( + getTravelDurationLimitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 178 + case 186: + { + input.readMessage( + getRouteDistanceLimitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 186 + case 194: + { + com.google.protobuf.MapEntry + extraVisitDurationForVisitType__ = + input.readMessage( + ExtraVisitDurationForVisitTypeDefaultEntryHolder.defaultEntry + .getParserForType(), + extensionRegistry); + internalGetMutableExtraVisitDurationForVisitType() + .ensureBuilderMap() + .put( + extraVisitDurationForVisitType__.getKey(), + extraVisitDurationForVisitType__.getValue()); + bitField0_ |= 0x00200000; + break; + } // case 194 + case 202: + { + input.readMessage(getBreakRuleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 202 + case 218: + { + label_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00800000; + break; + } // case 218 + case 224: + { + ignore_ = input.readBool(); + bitField0_ |= 0x01000000; + break; + } // case 224 + case 242: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + loadLimits__ = + input.readMessage( + LoadLimitsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLoadLimits() + .ensureBuilderMap() + .put(loadLimits__.getKey(), loadLimits__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 242 + case 258: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 258 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The user-defined display name of the vehicle.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 32; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user-defined display name of the vehicle.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 32; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user-defined display name of the vehicle.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 32; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The user-defined display name of the vehicle.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 32; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The user-defined display name of the vehicle.
+     * It can be up to 63 characters long and may use UTF-8 characters.
+     * 
+ * + * string display_name = 32; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int travelMode_ = 0; + /** + * + * + *
+     * The travel mode which affects the roads usable by the vehicle and its
+     * speed. See also `travel_duration_multiple`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return The enum numeric value on the wire for travelMode. + */ + @java.lang.Override + public int getTravelModeValue() { + return travelMode_; + } + /** + * + * + *
+     * The travel mode which affects the roads usable by the vehicle and its
+     * speed. See also `travel_duration_multiple`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @param value The enum numeric value on the wire for travelMode to set. + * @return This builder for chaining. + */ + public Builder setTravelModeValue(int value) { + travelMode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The travel mode which affects the roads usable by the vehicle and its
+     * speed. See also `travel_duration_multiple`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return The travelMode. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.TravelMode getTravelMode() { + com.google.maps.routeoptimization.v1.Vehicle.TravelMode result = + com.google.maps.routeoptimization.v1.Vehicle.TravelMode.forNumber(travelMode_); + return result == null + ? com.google.maps.routeoptimization.v1.Vehicle.TravelMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The travel mode which affects the roads usable by the vehicle and its
+     * speed. See also `travel_duration_multiple`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @param value The travelMode to set. + * @return This builder for chaining. + */ + public Builder setTravelMode(com.google.maps.routeoptimization.v1.Vehicle.TravelMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + travelMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The travel mode which affects the roads usable by the vehicle and its
+     * speed. See also `travel_duration_multiple`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearTravelMode() { + bitField0_ = (bitField0_ & ~0x00000002); + travelMode_ = 0; + onChanged(); + return this; + } + + private com.google.type.LatLng startLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + startLocationBuilder_; + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + * + * @return Whether the startLocation field is set. + */ + public boolean hasStartLocation() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + * + * @return The startLocation. + */ + public com.google.type.LatLng getStartLocation() { + if (startLocationBuilder_ == null) { + return startLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : startLocation_; + } else { + return startLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + public Builder setStartLocation(com.google.type.LatLng value) { + if (startLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startLocation_ = value; + } else { + startLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + public Builder setStartLocation(com.google.type.LatLng.Builder builderForValue) { + if (startLocationBuilder_ == null) { + startLocation_ = builderForValue.build(); + } else { + startLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + public Builder mergeStartLocation(com.google.type.LatLng value) { + if (startLocationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && startLocation_ != null + && startLocation_ != com.google.type.LatLng.getDefaultInstance()) { + getStartLocationBuilder().mergeFrom(value); + } else { + startLocation_ = value; + } + } else { + startLocationBuilder_.mergeFrom(value); + } + if (startLocation_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + public Builder clearStartLocation() { + bitField0_ = (bitField0_ & ~0x00000004); + startLocation_ = null; + if (startLocationBuilder_ != null) { + startLocationBuilder_.dispose(); + startLocationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + public com.google.type.LatLng.Builder getStartLocationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getStartLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + public com.google.type.LatLngOrBuilder getStartLocationOrBuilder() { + if (startLocationBuilder_ != null) { + return startLocationBuilder_.getMessageOrBuilder(); + } else { + return startLocation_ == null + ? com.google.type.LatLng.getDefaultInstance() + : startLocation_; + } + } + /** + * + * + *
+     * Geographic location where the vehicle starts before picking up any
+     * shipments. If not specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng start_location = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getStartLocationFieldBuilder() { + if (startLocationBuilder_ == null) { + startLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>( + getStartLocation(), getParentForChildren(), isClean()); + startLocation_ = null; + } + return startLocationBuilder_; + } + + private com.google.maps.routeoptimization.v1.Waypoint startWaypoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + startWaypointBuilder_; + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * + * @return Whether the startWaypoint field is set. + */ + public boolean hasStartWaypoint() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * + * @return The startWaypoint. + */ + public com.google.maps.routeoptimization.v1.Waypoint getStartWaypoint() { + if (startWaypointBuilder_ == null) { + return startWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : startWaypoint_; + } else { + return startWaypointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + public Builder setStartWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (startWaypointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startWaypoint_ = value; + } else { + startWaypointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + public Builder setStartWaypoint( + com.google.maps.routeoptimization.v1.Waypoint.Builder builderForValue) { + if (startWaypointBuilder_ == null) { + startWaypoint_ = builderForValue.build(); + } else { + startWaypointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + public Builder mergeStartWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (startWaypointBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && startWaypoint_ != null + && startWaypoint_ + != com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) { + getStartWaypointBuilder().mergeFrom(value); + } else { + startWaypoint_ = value; + } + } else { + startWaypointBuilder_.mergeFrom(value); + } + if (startWaypoint_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + public Builder clearStartWaypoint() { + bitField0_ = (bitField0_ & ~0x00000008); + startWaypoint_ = null; + if (startWaypointBuilder_ != null) { + startWaypointBuilder_.dispose(); + startWaypointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + public com.google.maps.routeoptimization.v1.Waypoint.Builder getStartWaypointBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getStartWaypointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getStartWaypointOrBuilder() { + if (startWaypointBuilder_ != null) { + return startWaypointBuilder_.getMessageOrBuilder(); + } else { + return startWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : startWaypoint_; + } + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle starts before
+     * picking up any shipments. If neither `start_waypoint` nor `start_location`
+     * is specified, the vehicle starts at its first pickup.
+     * If the shipment model has duration and distance matrices, `start_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + getStartWaypointFieldBuilder() { + if (startWaypointBuilder_ == null) { + startWaypointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder>( + getStartWaypoint(), getParentForChildren(), isClean()); + startWaypoint_ = null; + } + return startWaypointBuilder_; + } + + private com.google.type.LatLng endLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + endLocationBuilder_; + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + * + * @return Whether the endLocation field is set. + */ + public boolean hasEndLocation() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + * + * @return The endLocation. + */ + public com.google.type.LatLng getEndLocation() { + if (endLocationBuilder_ == null) { + return endLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : endLocation_; + } else { + return endLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + public Builder setEndLocation(com.google.type.LatLng value) { + if (endLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endLocation_ = value; + } else { + endLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + public Builder setEndLocation(com.google.type.LatLng.Builder builderForValue) { + if (endLocationBuilder_ == null) { + endLocation_ = builderForValue.build(); + } else { + endLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + public Builder mergeEndLocation(com.google.type.LatLng value) { + if (endLocationBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && endLocation_ != null + && endLocation_ != com.google.type.LatLng.getDefaultInstance()) { + getEndLocationBuilder().mergeFrom(value); + } else { + endLocation_ = value; + } + } else { + endLocationBuilder_.mergeFrom(value); + } + if (endLocation_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + public Builder clearEndLocation() { + bitField0_ = (bitField0_ & ~0x00000010); + endLocation_ = null; + if (endLocationBuilder_ != null) { + endLocationBuilder_.dispose(); + endLocationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + public com.google.type.LatLng.Builder getEndLocationBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getEndLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + public com.google.type.LatLngOrBuilder getEndLocationOrBuilder() { + if (endLocationBuilder_ != null) { + return endLocationBuilder_.getMessageOrBuilder(); + } else { + return endLocation_ == null ? com.google.type.LatLng.getDefaultInstance() : endLocation_; + } + } + /** + * + * + *
+     * Geographic location where the vehicle ends after it has completed its last
+     * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+     * immediately when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_location`
+     * must not be specified.
+     * 
+ * + * .google.type.LatLng end_location = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getEndLocationFieldBuilder() { + if (endLocationBuilder_ == null) { + endLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>( + getEndLocation(), getParentForChildren(), isClean()); + endLocation_ = null; + } + return endLocationBuilder_; + } + + private com.google.maps.routeoptimization.v1.Waypoint endWaypoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + endWaypointBuilder_; + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * + * @return Whether the endWaypoint field is set. + */ + public boolean hasEndWaypoint() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * + * @return The endWaypoint. + */ + public com.google.maps.routeoptimization.v1.Waypoint getEndWaypoint() { + if (endWaypointBuilder_ == null) { + return endWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : endWaypoint_; + } else { + return endWaypointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + public Builder setEndWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (endWaypointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endWaypoint_ = value; + } else { + endWaypointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + public Builder setEndWaypoint( + com.google.maps.routeoptimization.v1.Waypoint.Builder builderForValue) { + if (endWaypointBuilder_ == null) { + endWaypoint_ = builderForValue.build(); + } else { + endWaypointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + public Builder mergeEndWaypoint(com.google.maps.routeoptimization.v1.Waypoint value) { + if (endWaypointBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endWaypoint_ != null + && endWaypoint_ != com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) { + getEndWaypointBuilder().mergeFrom(value); + } else { + endWaypoint_ = value; + } + } else { + endWaypointBuilder_.mergeFrom(value); + } + if (endWaypoint_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + public Builder clearEndWaypoint() { + bitField0_ = (bitField0_ & ~0x00000020); + endWaypoint_ = null; + if (endWaypointBuilder_ != null) { + endWaypointBuilder_.dispose(); + endWaypointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + public com.google.maps.routeoptimization.v1.Waypoint.Builder getEndWaypointBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getEndWaypointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + public com.google.maps.routeoptimization.v1.WaypointOrBuilder getEndWaypointOrBuilder() { + if (endWaypointBuilder_ != null) { + return endWaypointBuilder_.getMessageOrBuilder(); + } else { + return endWaypoint_ == null + ? com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance() + : endWaypoint_; + } + } + /** + * + * + *
+     * Waypoint representing a geographic location where the vehicle ends after
+     * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+     * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+     * when it completes its last `VisitRequest`.
+     * If the shipment model has duration and distance matrices, `end_waypoint`
+     * must not be specified.
+     * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder> + getEndWaypointFieldBuilder() { + if (endWaypointBuilder_ == null) { + endWaypointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Waypoint, + com.google.maps.routeoptimization.v1.Waypoint.Builder, + com.google.maps.routeoptimization.v1.WaypointOrBuilder>( + getEndWaypoint(), getParentForChildren(), isClean()); + endWaypoint_ = null; + } + return endWaypointBuilder_; + } + + private com.google.protobuf.LazyStringArrayList startTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStartTagsIsMutable() { + if (!startTags_.isModifiable()) { + startTags_ = new com.google.protobuf.LazyStringArrayList(startTags_); + } + bitField0_ |= 0x00000040; + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @return A list containing the startTags. + */ + public com.google.protobuf.ProtocolStringList getStartTagsList() { + startTags_.makeImmutable(); + return startTags_; + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @return The count of startTags. + */ + public int getStartTagsCount() { + return startTags_.size(); + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @param index The index of the element to return. + * @return The startTags at the given index. + */ + public java.lang.String getStartTags(int index) { + return startTags_.get(index); + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @param index The index of the value to return. + * @return The bytes of the startTags at the given index. + */ + public com.google.protobuf.ByteString getStartTagsBytes(int index) { + return startTags_.getByteString(index); + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @param index The index to set the value at. + * @param value The startTags to set. + * @return This builder for chaining. + */ + public Builder setStartTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTagsIsMutable(); + startTags_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @param value The startTags to add. + * @return This builder for chaining. + */ + public Builder addStartTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTagsIsMutable(); + startTags_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @param values The startTags to add. + * @return This builder for chaining. + */ + public Builder addAllStartTags(java.lang.Iterable values) { + ensureStartTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, startTags_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @return This builder for chaining. + */ + public Builder clearStartTags() { + startTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the start of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string start_tags = 7; + * + * @param value The bytes of the startTags to add. + * @return This builder for chaining. + */ + public Builder addStartTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStartTagsIsMutable(); + startTags_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList endTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureEndTagsIsMutable() { + if (!endTags_.isModifiable()) { + endTags_ = new com.google.protobuf.LazyStringArrayList(endTags_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @return A list containing the endTags. + */ + public com.google.protobuf.ProtocolStringList getEndTagsList() { + endTags_.makeImmutable(); + return endTags_; + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @return The count of endTags. + */ + public int getEndTagsCount() { + return endTags_.size(); + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @param index The index of the element to return. + * @return The endTags at the given index. + */ + public java.lang.String getEndTags(int index) { + return endTags_.get(index); + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @param index The index of the value to return. + * @return The bytes of the endTags at the given index. + */ + public com.google.protobuf.ByteString getEndTagsBytes(int index) { + return endTags_.getByteString(index); + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @param index The index to set the value at. + * @param value The endTags to set. + * @return This builder for chaining. + */ + public Builder setEndTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndTagsIsMutable(); + endTags_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @param value The endTags to add. + * @return This builder for chaining. + */ + public Builder addEndTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndTagsIsMutable(); + endTags_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @param values The endTags to add. + * @return This builder for chaining. + */ + public Builder addAllEndTags(java.lang.Iterable values) { + ensureEndTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endTags_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @return This builder for chaining. + */ + public Builder clearEndTags() { + endTags_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies tags attached to the end of the vehicle's route.
+     *
+     * Empty or duplicate strings are not allowed.
+     * 
+ * + * repeated string end_tags = 8; + * + * @param value The bytes of the endTags to add. + * @return This builder for chaining. + */ + public Builder addEndTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEndTagsIsMutable(); + endTags_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.util.List startTimeWindows_ = + java.util.Collections.emptyList(); + + private void ensureStartTimeWindowsIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + startTimeWindows_ = + new java.util.ArrayList( + startTimeWindows_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder> + startTimeWindowsBuilder_; + + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public java.util.List + getStartTimeWindowsList() { + if (startTimeWindowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(startTimeWindows_); + } else { + return startTimeWindowsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public int getStartTimeWindowsCount() { + if (startTimeWindowsBuilder_ == null) { + return startTimeWindows_.size(); + } else { + return startTimeWindowsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public com.google.maps.routeoptimization.v1.TimeWindow getStartTimeWindows(int index) { + if (startTimeWindowsBuilder_ == null) { + return startTimeWindows_.get(index); + } else { + return startTimeWindowsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder setStartTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow value) { + if (startTimeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.set(index, value); + onChanged(); + } else { + startTimeWindowsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder setStartTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (startTimeWindowsBuilder_ == null) { + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.set(index, builderForValue.build()); + onChanged(); + } else { + startTimeWindowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder addStartTimeWindows(com.google.maps.routeoptimization.v1.TimeWindow value) { + if (startTimeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.add(value); + onChanged(); + } else { + startTimeWindowsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder addStartTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow value) { + if (startTimeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.add(index, value); + onChanged(); + } else { + startTimeWindowsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder addStartTimeWindows( + com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (startTimeWindowsBuilder_ == null) { + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.add(builderForValue.build()); + onChanged(); + } else { + startTimeWindowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder addStartTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (startTimeWindowsBuilder_ == null) { + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.add(index, builderForValue.build()); + onChanged(); + } else { + startTimeWindowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder addAllStartTimeWindows( + java.lang.Iterable values) { + if (startTimeWindowsBuilder_ == null) { + ensureStartTimeWindowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, startTimeWindows_); + onChanged(); + } else { + startTimeWindowsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder clearStartTimeWindows() { + if (startTimeWindowsBuilder_ == null) { + startTimeWindows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + startTimeWindowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public Builder removeStartTimeWindows(int index) { + if (startTimeWindowsBuilder_ == null) { + ensureStartTimeWindowsIsMutable(); + startTimeWindows_.remove(index); + onChanged(); + } else { + startTimeWindowsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder getStartTimeWindowsBuilder( + int index) { + return getStartTimeWindowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getStartTimeWindowsOrBuilder( + int index) { + if (startTimeWindowsBuilder_ == null) { + return startTimeWindows_.get(index); + } else { + return startTimeWindowsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public java.util.List + getStartTimeWindowsOrBuilderList() { + if (startTimeWindowsBuilder_ != null) { + return startTimeWindowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(startTimeWindows_); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder addStartTimeWindowsBuilder() { + return getStartTimeWindowsFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()); + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder addStartTimeWindowsBuilder( + int index) { + return getStartTimeWindowsFieldBuilder() + .addBuilder(index, com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()); + } + /** + * + * + *
+     * Time windows during which the vehicle may depart its start location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + public java.util.List + getStartTimeWindowsBuilderList() { + return getStartTimeWindowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder> + getStartTimeWindowsFieldBuilder() { + if (startTimeWindowsBuilder_ == null) { + startTimeWindowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>( + startTimeWindows_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + startTimeWindows_ = null; + } + return startTimeWindowsBuilder_; + } + + private java.util.List endTimeWindows_ = + java.util.Collections.emptyList(); + + private void ensureEndTimeWindowsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + endTimeWindows_ = + new java.util.ArrayList( + endTimeWindows_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder> + endTimeWindowsBuilder_; + + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public java.util.List getEndTimeWindowsList() { + if (endTimeWindowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endTimeWindows_); + } else { + return endTimeWindowsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public int getEndTimeWindowsCount() { + if (endTimeWindowsBuilder_ == null) { + return endTimeWindows_.size(); + } else { + return endTimeWindowsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public com.google.maps.routeoptimization.v1.TimeWindow getEndTimeWindows(int index) { + if (endTimeWindowsBuilder_ == null) { + return endTimeWindows_.get(index); + } else { + return endTimeWindowsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder setEndTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow value) { + if (endTimeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.set(index, value); + onChanged(); + } else { + endTimeWindowsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder setEndTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (endTimeWindowsBuilder_ == null) { + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.set(index, builderForValue.build()); + onChanged(); + } else { + endTimeWindowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder addEndTimeWindows(com.google.maps.routeoptimization.v1.TimeWindow value) { + if (endTimeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.add(value); + onChanged(); + } else { + endTimeWindowsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder addEndTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow value) { + if (endTimeWindowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.add(index, value); + onChanged(); + } else { + endTimeWindowsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder addEndTimeWindows( + com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (endTimeWindowsBuilder_ == null) { + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.add(builderForValue.build()); + onChanged(); + } else { + endTimeWindowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder addEndTimeWindows( + int index, com.google.maps.routeoptimization.v1.TimeWindow.Builder builderForValue) { + if (endTimeWindowsBuilder_ == null) { + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.add(index, builderForValue.build()); + onChanged(); + } else { + endTimeWindowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder addAllEndTimeWindows( + java.lang.Iterable values) { + if (endTimeWindowsBuilder_ == null) { + ensureEndTimeWindowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endTimeWindows_); + onChanged(); + } else { + endTimeWindowsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder clearEndTimeWindows() { + if (endTimeWindowsBuilder_ == null) { + endTimeWindows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + endTimeWindowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public Builder removeEndTimeWindows(int index) { + if (endTimeWindowsBuilder_ == null) { + ensureEndTimeWindowsIsMutable(); + endTimeWindows_.remove(index); + onChanged(); + } else { + endTimeWindowsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder getEndTimeWindowsBuilder( + int index) { + return getEndTimeWindowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getEndTimeWindowsOrBuilder( + int index) { + if (endTimeWindowsBuilder_ == null) { + return endTimeWindows_.get(index); + } else { + return endTimeWindowsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public java.util.List + getEndTimeWindowsOrBuilderList() { + if (endTimeWindowsBuilder_ != null) { + return endTimeWindowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endTimeWindows_); + } + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder addEndTimeWindowsBuilder() { + return getEndTimeWindowsFieldBuilder() + .addBuilder(com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()); + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public com.google.maps.routeoptimization.v1.TimeWindow.Builder addEndTimeWindowsBuilder( + int index) { + return getEndTimeWindowsFieldBuilder() + .addBuilder(index, com.google.maps.routeoptimization.v1.TimeWindow.getDefaultInstance()); + } + /** + * + * + *
+     * Time windows during which the vehicle may arrive at its end location.
+     * They must be within the global time limits (see
+     * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+     * fields). If unspecified, there is no limitation besides those global time
+     * limits.
+     *
+     * Time windows belonging to the same repeated field must be disjoint, i.e. no
+     * time window can overlap with or be adjacent to another, and they must be in
+     * chronological order.
+     *
+     * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+     * there is a single time window.
+     * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + public java.util.List + getEndTimeWindowsBuilderList() { + return getEndTimeWindowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder> + getEndTimeWindowsFieldBuilder() { + if (endTimeWindowsBuilder_ == null) { + endTimeWindowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routeoptimization.v1.TimeWindow, + com.google.maps.routeoptimization.v1.TimeWindow.Builder, + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder>( + endTimeWindows_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + endTimeWindows_ = null; + } + return endTimeWindowsBuilder_; + } + + private double travelDurationMultiple_; + /** + * + * + *
+     * Specifies a multiplicative factor that can be used to increase or decrease
+     * travel times of this vehicle. For example, setting this to 2.0 means
+     * that this vehicle is slower and has travel times that are twice what they
+     * are for standard vehicles. This multiple does not affect visit durations.
+     * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+     * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+     * is standard, and this multiple is considered 1.0.
+     *
+     * WARNING: Travel times will be rounded to the nearest second after this
+     * multiple is applied but before performing any numerical operations, thus,
+     * a small multiple may result in a loss of precision.
+     *
+     * See also `extra_visit_duration_for_visit_type` below.
+     * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return Whether the travelDurationMultiple field is set. + */ + @java.lang.Override + public boolean hasTravelDurationMultiple() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Specifies a multiplicative factor that can be used to increase or decrease
+     * travel times of this vehicle. For example, setting this to 2.0 means
+     * that this vehicle is slower and has travel times that are twice what they
+     * are for standard vehicles. This multiple does not affect visit durations.
+     * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+     * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+     * is standard, and this multiple is considered 1.0.
+     *
+     * WARNING: Travel times will be rounded to the nearest second after this
+     * multiple is applied but before performing any numerical operations, thus,
+     * a small multiple may result in a loss of precision.
+     *
+     * See also `extra_visit_duration_for_visit_type` below.
+     * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return The travelDurationMultiple. + */ + @java.lang.Override + public double getTravelDurationMultiple() { + return travelDurationMultiple_; + } + /** + * + * + *
+     * Specifies a multiplicative factor that can be used to increase or decrease
+     * travel times of this vehicle. For example, setting this to 2.0 means
+     * that this vehicle is slower and has travel times that are twice what they
+     * are for standard vehicles. This multiple does not affect visit durations.
+     * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+     * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+     * is standard, and this multiple is considered 1.0.
+     *
+     * WARNING: Travel times will be rounded to the nearest second after this
+     * multiple is applied but before performing any numerical operations, thus,
+     * a small multiple may result in a loss of precision.
+     *
+     * See also `extra_visit_duration_for_visit_type` below.
+     * 
+ * + * optional double travel_duration_multiple = 11; + * + * @param value The travelDurationMultiple to set. + * @return This builder for chaining. + */ + public Builder setTravelDurationMultiple(double value) { + + travelDurationMultiple_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a multiplicative factor that can be used to increase or decrease
+     * travel times of this vehicle. For example, setting this to 2.0 means
+     * that this vehicle is slower and has travel times that are twice what they
+     * are for standard vehicles. This multiple does not affect visit durations.
+     * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+     * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+     * is standard, and this multiple is considered 1.0.
+     *
+     * WARNING: Travel times will be rounded to the nearest second after this
+     * multiple is applied but before performing any numerical operations, thus,
+     * a small multiple may result in a loss of precision.
+     *
+     * See also `extra_visit_duration_for_visit_type` below.
+     * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return This builder for chaining. + */ + public Builder clearTravelDurationMultiple() { + bitField0_ = (bitField0_ & ~0x00000400); + travelDurationMultiple_ = 0D; + onChanged(); + return this; + } + + private int unloadingPolicy_ = 0; + /** + * + * + *
+     * Unloading policy enforced on the vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return The enum numeric value on the wire for unloadingPolicy. + */ + @java.lang.Override + public int getUnloadingPolicyValue() { + return unloadingPolicy_; + } + /** + * + * + *
+     * Unloading policy enforced on the vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @param value The enum numeric value on the wire for unloadingPolicy to set. + * @return This builder for chaining. + */ + public Builder setUnloadingPolicyValue(int value) { + unloadingPolicy_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Unloading policy enforced on the vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return The unloadingPolicy. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy getUnloadingPolicy() { + com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy result = + com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy.forNumber(unloadingPolicy_); + return result == null + ? com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Unloading policy enforced on the vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @param value The unloadingPolicy to set. + * @return This builder for chaining. + */ + public Builder setUnloadingPolicy( + com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + unloadingPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Unloading policy enforced on the vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return This builder for chaining. + */ + public Builder clearUnloadingPolicy() { + bitField0_ = (bitField0_ & ~0x00000800); + unloadingPolicy_ = 0; + onChanged(); + return this; + } + + private static final class LoadLimitsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> { + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit build( + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder val) { + if (val instanceof com.google.maps.routeoptimization.v1.Vehicle.LoadLimit) { + return (com.google.maps.routeoptimization.v1.Vehicle.LoadLimit) val; + } + return ((com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + defaultEntry() { + return LoadLimitsDefaultEntryHolder.defaultEntry; + } + }; + + private static final LoadLimitsConverter loadLimitsConverter = new LoadLimitsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder> + loadLimits_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder> + internalGetLoadLimits() { + if (loadLimits_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(loadLimitsConverter); + } + return loadLimits_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit, + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder> + internalGetMutableLoadLimits() { + if (loadLimits_ == null) { + loadLimits_ = new com.google.protobuf.MapFieldBuilder<>(loadLimitsConverter); + } + bitField0_ |= 0x00001000; + onChanged(); + return loadLimits_; + } + + public int getLoadLimitsCount() { + return internalGetLoadLimits().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public boolean containsLoadLimits(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLoadLimits().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getLoadLimitsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getLoadLimits() { + return getLoadLimitsMap(); + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public java.util.Map + getLoadLimitsMap() { + return internalGetLoadLimits().getImmutableMap(); + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public /* nullable */ com.google.maps.routeoptimization.v1.Vehicle.LoadLimit + getLoadLimitsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder> + map = internalGetMutableLoadLimits().ensureBuilderMap(); + return map.containsKey(key) ? loadLimitsConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit getLoadLimitsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder> + map = internalGetMutableLoadLimits().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return loadLimitsConverter.build(map.get(key)); + } + + public Builder clearLoadLimits() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableLoadLimits().clear(); + return this; + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + public Builder removeLoadLimits(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLoadLimits().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableLoadLimits() { + bitField0_ |= 0x00001000; + return internalGetMutableLoadLimits().ensureMessageMap(); + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + public Builder putLoadLimits( + java.lang.String key, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLoadLimits().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + public Builder putAllLoadLimits( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimit> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableLoadLimits().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Capacities of the vehicle (weight, volume, # of pallets for example).
+     * The keys in the map are the identifiers of the type of load, consistent
+     * with the keys of the
+     * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+     * field. If a given key is absent from this map, the corresponding capacity
+     * is considered to be limitless.
+     * 
+ * + * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder + putLoadLimitsBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder> + builderMap = internalGetMutableLoadLimits().ensureBuilderMap(); + com.google.maps.routeoptimization.v1.Vehicle.LoadLimitOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.maps.routeoptimization.v1.Vehicle.LoadLimit) { + entry = ((com.google.maps.routeoptimization.v1.Vehicle.LoadLimit) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Builder) entry; + } + + private double costPerHour_; + /** + * + * + *
+     * Vehicle costs: all costs add up and must be in the same unit as
+     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+     *
+     * Cost per hour of the vehicle route. This cost is applied to the total time
+     * taken by the route, and includes travel time, waiting time, and visit time.
+     * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result
+     * in additional latency.
+     * 
+ * + * double cost_per_hour = 16; + * + * @return The costPerHour. + */ + @java.lang.Override + public double getCostPerHour() { + return costPerHour_; + } + /** + * + * + *
+     * Vehicle costs: all costs add up and must be in the same unit as
+     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+     *
+     * Cost per hour of the vehicle route. This cost is applied to the total time
+     * taken by the route, and includes travel time, waiting time, and visit time.
+     * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result
+     * in additional latency.
+     * 
+ * + * double cost_per_hour = 16; + * + * @param value The costPerHour to set. + * @return This builder for chaining. + */ + public Builder setCostPerHour(double value) { + + costPerHour_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Vehicle costs: all costs add up and must be in the same unit as
+     * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+     *
+     * Cost per hour of the vehicle route. This cost is applied to the total time
+     * taken by the route, and includes travel time, waiting time, and visit time.
+     * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result
+     * in additional latency.
+     * 
+ * + * double cost_per_hour = 16; + * + * @return This builder for chaining. + */ + public Builder clearCostPerHour() { + bitField0_ = (bitField0_ & ~0x00002000); + costPerHour_ = 0D; + onChanged(); + return this; + } + + private double costPerTraveledHour_; + /** + * + * + *
+     * Cost per traveled hour of the vehicle route. This cost is applied only to
+     * travel time taken by the route (i.e., that reported in
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]),
+     * and excludes waiting time and visit time.
+     * 
+ * + * double cost_per_traveled_hour = 17; + * + * @return The costPerTraveledHour. + */ + @java.lang.Override + public double getCostPerTraveledHour() { + return costPerTraveledHour_; + } + /** + * + * + *
+     * Cost per traveled hour of the vehicle route. This cost is applied only to
+     * travel time taken by the route (i.e., that reported in
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]),
+     * and excludes waiting time and visit time.
+     * 
+ * + * double cost_per_traveled_hour = 17; + * + * @param value The costPerTraveledHour to set. + * @return This builder for chaining. + */ + public Builder setCostPerTraveledHour(double value) { + + costPerTraveledHour_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cost per traveled hour of the vehicle route. This cost is applied only to
+     * travel time taken by the route (i.e., that reported in
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]),
+     * and excludes waiting time and visit time.
+     * 
+ * + * double cost_per_traveled_hour = 17; + * + * @return This builder for chaining. + */ + public Builder clearCostPerTraveledHour() { + bitField0_ = (bitField0_ & ~0x00004000); + costPerTraveledHour_ = 0D; + onChanged(); + return this; + } + + private double costPerKilometer_; + /** + * + * + *
+     * Cost per kilometer of the vehicle route. This cost is applied to the
+     * distance reported in the
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * and does not apply to any distance implicitly traveled from the
+     * `arrival_location` to the `departure_location` of a single `VisitRequest`.
+     * 
+ * + * double cost_per_kilometer = 18; + * + * @return The costPerKilometer. + */ + @java.lang.Override + public double getCostPerKilometer() { + return costPerKilometer_; + } + /** + * + * + *
+     * Cost per kilometer of the vehicle route. This cost is applied to the
+     * distance reported in the
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * and does not apply to any distance implicitly traveled from the
+     * `arrival_location` to the `departure_location` of a single `VisitRequest`.
+     * 
+ * + * double cost_per_kilometer = 18; + * + * @param value The costPerKilometer to set. + * @return This builder for chaining. + */ + public Builder setCostPerKilometer(double value) { + + costPerKilometer_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Cost per kilometer of the vehicle route. This cost is applied to the
+     * distance reported in the
+     * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+     * and does not apply to any distance implicitly traveled from the
+     * `arrival_location` to the `departure_location` of a single `VisitRequest`.
+     * 
+ * + * double cost_per_kilometer = 18; + * + * @return This builder for chaining. + */ + public Builder clearCostPerKilometer() { + bitField0_ = (bitField0_ & ~0x00008000); + costPerKilometer_ = 0D; + onChanged(); + return this; + } + + private double fixedCost_; + /** + * + * + *
+     * Fixed cost applied if this vehicle is used to handle a shipment.
+     * 
+ * + * double fixed_cost = 19; + * + * @return The fixedCost. + */ + @java.lang.Override + public double getFixedCost() { + return fixedCost_; + } + /** + * + * + *
+     * Fixed cost applied if this vehicle is used to handle a shipment.
+     * 
+ * + * double fixed_cost = 19; + * + * @param value The fixedCost to set. + * @return This builder for chaining. + */ + public Builder setFixedCost(double value) { + + fixedCost_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Fixed cost applied if this vehicle is used to handle a shipment.
+     * 
+ * + * double fixed_cost = 19; + * + * @return This builder for chaining. + */ + public Builder clearFixedCost() { + bitField0_ = (bitField0_ & ~0x00010000); + fixedCost_ = 0D; + onChanged(); + return this; + } + + private boolean usedIfRouteIsEmpty_; + /** + * + * + *
+     * This field only applies to vehicles when their route does not serve any
+     * shipments. It indicates if the vehicle should be considered as used or not
+     * in this case.
+     *
+     * If true, the vehicle goes from its start to its end location even if it
+     * doesn't serve any shipments, and time and distance costs resulting from its
+     * start --> end travel are taken into account.
+     *
+     * Otherwise, it doesn't travel from its start to its end location, and no
+     * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this
+     * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any
+     * information except for the vehicle index and label.
+     * 
+ * + * bool used_if_route_is_empty = 20; + * + * @return The usedIfRouteIsEmpty. + */ + @java.lang.Override + public boolean getUsedIfRouteIsEmpty() { + return usedIfRouteIsEmpty_; + } + /** + * + * + *
+     * This field only applies to vehicles when their route does not serve any
+     * shipments. It indicates if the vehicle should be considered as used or not
+     * in this case.
+     *
+     * If true, the vehicle goes from its start to its end location even if it
+     * doesn't serve any shipments, and time and distance costs resulting from its
+     * start --> end travel are taken into account.
+     *
+     * Otherwise, it doesn't travel from its start to its end location, and no
+     * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this
+     * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any
+     * information except for the vehicle index and label.
+     * 
+ * + * bool used_if_route_is_empty = 20; + * + * @param value The usedIfRouteIsEmpty to set. + * @return This builder for chaining. + */ + public Builder setUsedIfRouteIsEmpty(boolean value) { + + usedIfRouteIsEmpty_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * This field only applies to vehicles when their route does not serve any
+     * shipments. It indicates if the vehicle should be considered as used or not
+     * in this case.
+     *
+     * If true, the vehicle goes from its start to its end location even if it
+     * doesn't serve any shipments, and time and distance costs resulting from its
+     * start --> end travel are taken into account.
+     *
+     * Otherwise, it doesn't travel from its start to its end location, and no
+     * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this
+     * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any
+     * information except for the vehicle index and label.
+     * 
+ * + * bool used_if_route_is_empty = 20; + * + * @return This builder for chaining. + */ + public Builder clearUsedIfRouteIsEmpty() { + bitField0_ = (bitField0_ & ~0x00020000); + usedIfRouteIsEmpty_ = false; + onChanged(); + return this; + } + + private com.google.maps.routeoptimization.v1.Vehicle.DurationLimit routeDurationLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder> + routeDurationLimitBuilder_; + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + * + * @return Whether the routeDurationLimit field is set. + */ + public boolean hasRouteDurationLimit() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + * + * @return The routeDurationLimit. + */ + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getRouteDurationLimit() { + if (routeDurationLimitBuilder_ == null) { + return routeDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : routeDurationLimit_; + } else { + return routeDurationLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + public Builder setRouteDurationLimit( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit value) { + if (routeDurationLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routeDurationLimit_ = value; + } else { + routeDurationLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + public Builder setRouteDurationLimit( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder builderForValue) { + if (routeDurationLimitBuilder_ == null) { + routeDurationLimit_ = builderForValue.build(); + } else { + routeDurationLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + public Builder mergeRouteDurationLimit( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit value) { + if (routeDurationLimitBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) + && routeDurationLimit_ != null + && routeDurationLimit_ + != com.google.maps.routeoptimization.v1.Vehicle.DurationLimit + .getDefaultInstance()) { + getRouteDurationLimitBuilder().mergeFrom(value); + } else { + routeDurationLimit_ = value; + } + } else { + routeDurationLimitBuilder_.mergeFrom(value); + } + if (routeDurationLimit_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + public Builder clearRouteDurationLimit() { + bitField0_ = (bitField0_ & ~0x00040000); + routeDurationLimit_ = null; + if (routeDurationLimitBuilder_ != null) { + routeDurationLimitBuilder_.dispose(); + routeDurationLimitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder + getRouteDurationLimitBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getRouteDurationLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder + getRouteDurationLimitOrBuilder() { + if (routeDurationLimitBuilder_ != null) { + return routeDurationLimitBuilder_.getMessageOrBuilder(); + } else { + return routeDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : routeDurationLimit_; + } + } + /** + * + * + *
+     * Limit applied to the total duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route duration of a vehicle is the
+     * difference between its `vehicle_end_time` and `vehicle_start_time`.
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder> + getRouteDurationLimitFieldBuilder() { + if (routeDurationLimitBuilder_ == null) { + routeDurationLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder>( + getRouteDurationLimit(), getParentForChildren(), isClean()); + routeDurationLimit_ = null; + } + return routeDurationLimitBuilder_; + } + + private com.google.maps.routeoptimization.v1.Vehicle.DurationLimit travelDurationLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder> + travelDurationLimitBuilder_; + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + * + * @return Whether the travelDurationLimit field is set. + */ + public boolean hasTravelDurationLimit() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + * + * @return The travelDurationLimit. + */ + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getTravelDurationLimit() { + if (travelDurationLimitBuilder_ == null) { + return travelDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : travelDurationLimit_; + } else { + return travelDurationLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + public Builder setTravelDurationLimit( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit value) { + if (travelDurationLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelDurationLimit_ = value; + } else { + travelDurationLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + public Builder setTravelDurationLimit( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder builderForValue) { + if (travelDurationLimitBuilder_ == null) { + travelDurationLimit_ = builderForValue.build(); + } else { + travelDurationLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + public Builder mergeTravelDurationLimit( + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit value) { + if (travelDurationLimitBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) + && travelDurationLimit_ != null + && travelDurationLimit_ + != com.google.maps.routeoptimization.v1.Vehicle.DurationLimit + .getDefaultInstance()) { + getTravelDurationLimitBuilder().mergeFrom(value); + } else { + travelDurationLimit_ = value; + } + } else { + travelDurationLimitBuilder_.mergeFrom(value); + } + if (travelDurationLimit_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + public Builder clearTravelDurationLimit() { + bitField0_ = (bitField0_ & ~0x00080000); + travelDurationLimit_ = null; + if (travelDurationLimitBuilder_ != null) { + travelDurationLimitBuilder_.dispose(); + travelDurationLimitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder + getTravelDurationLimitBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getTravelDurationLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + public com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder + getTravelDurationLimitOrBuilder() { + if (travelDurationLimitBuilder_ != null) { + return travelDurationLimitBuilder_.getMessageOrBuilder(); + } else { + return travelDurationLimit_ == null + ? com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.getDefaultInstance() + : travelDurationLimit_; + } + } + /** + * + * + *
+     * Limit applied to the travel duration of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route travel duration is the sum of all its
+     * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+     * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder> + getTravelDurationLimitFieldBuilder() { + if (travelDurationLimitBuilder_ == null) { + travelDurationLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit.Builder, + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder>( + getTravelDurationLimit(), getParentForChildren(), isClean()); + travelDurationLimit_ = null; + } + return travelDurationLimitBuilder_; + } + + private com.google.maps.routeoptimization.v1.DistanceLimit routeDistanceLimit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.DistanceLimit, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder, + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder> + routeDistanceLimitBuilder_; + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * + * @return Whether the routeDistanceLimit field is set. + */ + public boolean hasRouteDistanceLimit() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * + * @return The routeDistanceLimit. + */ + public com.google.maps.routeoptimization.v1.DistanceLimit getRouteDistanceLimit() { + if (routeDistanceLimitBuilder_ == null) { + return routeDistanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : routeDistanceLimit_; + } else { + return routeDistanceLimitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + public Builder setRouteDistanceLimit(com.google.maps.routeoptimization.v1.DistanceLimit value) { + if (routeDistanceLimitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routeDistanceLimit_ = value; + } else { + routeDistanceLimitBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + public Builder setRouteDistanceLimit( + com.google.maps.routeoptimization.v1.DistanceLimit.Builder builderForValue) { + if (routeDistanceLimitBuilder_ == null) { + routeDistanceLimit_ = builderForValue.build(); + } else { + routeDistanceLimitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + public Builder mergeRouteDistanceLimit( + com.google.maps.routeoptimization.v1.DistanceLimit value) { + if (routeDistanceLimitBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) + && routeDistanceLimit_ != null + && routeDistanceLimit_ + != com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance()) { + getRouteDistanceLimitBuilder().mergeFrom(value); + } else { + routeDistanceLimit_ = value; + } + } else { + routeDistanceLimitBuilder_.mergeFrom(value); + } + if (routeDistanceLimit_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + public Builder clearRouteDistanceLimit() { + bitField0_ = (bitField0_ & ~0x00100000); + routeDistanceLimit_ = null; + if (routeDistanceLimitBuilder_ != null) { + routeDistanceLimitBuilder_.dispose(); + routeDistanceLimitBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + public com.google.maps.routeoptimization.v1.DistanceLimit.Builder + getRouteDistanceLimitBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getRouteDistanceLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + public com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder + getRouteDistanceLimitOrBuilder() { + if (routeDistanceLimitBuilder_ != null) { + return routeDistanceLimitBuilder_.getMessageOrBuilder(); + } else { + return routeDistanceLimit_ == null + ? com.google.maps.routeoptimization.v1.DistanceLimit.getDefaultInstance() + : routeDistanceLimit_; + } + } + /** + * + * + *
+     * Limit applied to the total distance of the vehicle's route. In a given
+     * `OptimizeToursResponse`, the route distance is the sum of all its
+     * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+     * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.DistanceLimit, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder, + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder> + getRouteDistanceLimitFieldBuilder() { + if (routeDistanceLimitBuilder_ == null) { + routeDistanceLimitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.DistanceLimit, + com.google.maps.routeoptimization.v1.DistanceLimit.Builder, + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder>( + getRouteDistanceLimit(), getParentForChildren(), isClean()); + routeDistanceLimit_ = null; + } + return routeDistanceLimitBuilder_; + } + + private static final class ExtraVisitDurationForVisitTypeConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, com.google.protobuf.DurationOrBuilder, com.google.protobuf.Duration> { + @java.lang.Override + public com.google.protobuf.Duration build(com.google.protobuf.DurationOrBuilder val) { + if (val instanceof com.google.protobuf.Duration) { + return (com.google.protobuf.Duration) val; + } + return ((com.google.protobuf.Duration.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry + defaultEntry() { + return ExtraVisitDurationForVisitTypeDefaultEntryHolder.defaultEntry; + } + }; + + private static final ExtraVisitDurationForVisitTypeConverter + extraVisitDurationForVisitTypeConverter = new ExtraVisitDurationForVisitTypeConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.protobuf.DurationOrBuilder, + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder> + extraVisitDurationForVisitType_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.protobuf.DurationOrBuilder, + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder> + internalGetExtraVisitDurationForVisitType() { + if (extraVisitDurationForVisitType_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(extraVisitDurationForVisitTypeConverter); + } + return extraVisitDurationForVisitType_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.protobuf.DurationOrBuilder, + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder> + internalGetMutableExtraVisitDurationForVisitType() { + if (extraVisitDurationForVisitType_ == null) { + extraVisitDurationForVisitType_ = + new com.google.protobuf.MapFieldBuilder<>(extraVisitDurationForVisitTypeConverter); + } + bitField0_ |= 0x00200000; + onChanged(); + return extraVisitDurationForVisitType_; + } + + public int getExtraVisitDurationForVisitTypeCount() { + return internalGetExtraVisitDurationForVisitType().ensureBuilderMap().size(); + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public boolean containsExtraVisitDurationForVisitType(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetExtraVisitDurationForVisitType().ensureBuilderMap().containsKey(key); + } + /** Use {@link #getExtraVisitDurationForVisitTypeMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getExtraVisitDurationForVisitType() { + return getExtraVisitDurationForVisitTypeMap(); + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public java.util.Map + getExtraVisitDurationForVisitTypeMap() { + return internalGetExtraVisitDurationForVisitType().getImmutableMap(); + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Duration getExtraVisitDurationForVisitTypeOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Duration defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableExtraVisitDurationForVisitType().ensureBuilderMap(); + return map.containsKey(key) + ? extraVisitDurationForVisitTypeConverter.build(map.get(key)) + : defaultValue; + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + @java.lang.Override + public com.google.protobuf.Duration getExtraVisitDurationForVisitTypeOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableExtraVisitDurationForVisitType().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return extraVisitDurationForVisitTypeConverter.build(map.get(key)); + } + + public Builder clearExtraVisitDurationForVisitType() { + bitField0_ = (bitField0_ & ~0x00200000); + internalGetMutableExtraVisitDurationForVisitType().clear(); + return this; + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + public Builder removeExtraVisitDurationForVisitType(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableExtraVisitDurationForVisitType().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableExtraVisitDurationForVisitType() { + bitField0_ |= 0x00200000; + return internalGetMutableExtraVisitDurationForVisitType().ensureMessageMap(); + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + public Builder putExtraVisitDurationForVisitType( + java.lang.String key, com.google.protobuf.Duration value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableExtraVisitDurationForVisitType().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00200000; + return this; + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + public Builder putAllExtraVisitDurationForVisitType( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableExtraVisitDurationForVisitType().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00200000; + return this; + } + /** + * + * + *
+     * Specifies a map from visit_types strings to durations. The duration is time
+     * in addition to
+     * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+     * to be taken at visits with the specified `visit_types`. This extra visit
+     * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+     * `visit_types`) cannot be empty strings.
+     *
+     * If a visit request has multiple types, a duration will be added for each
+     * type in the map.
+     * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + public com.google.protobuf.Duration.Builder putExtraVisitDurationForVisitTypeBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = + internalGetMutableExtraVisitDurationForVisitType().ensureBuilderMap(); + com.google.protobuf.DurationOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.protobuf.Duration.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.protobuf.Duration) { + entry = ((com.google.protobuf.Duration) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.protobuf.Duration.Builder) entry; + } + + private com.google.maps.routeoptimization.v1.BreakRule breakRule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule, + com.google.maps.routeoptimization.v1.BreakRule.Builder, + com.google.maps.routeoptimization.v1.BreakRuleOrBuilder> + breakRuleBuilder_; + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * + * @return Whether the breakRule field is set. + */ + public boolean hasBreakRule() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * + * @return The breakRule. + */ + public com.google.maps.routeoptimization.v1.BreakRule getBreakRule() { + if (breakRuleBuilder_ == null) { + return breakRule_ == null + ? com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance() + : breakRule_; + } else { + return breakRuleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + public Builder setBreakRule(com.google.maps.routeoptimization.v1.BreakRule value) { + if (breakRuleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + breakRule_ = value; + } else { + breakRuleBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + public Builder setBreakRule( + com.google.maps.routeoptimization.v1.BreakRule.Builder builderForValue) { + if (breakRuleBuilder_ == null) { + breakRule_ = builderForValue.build(); + } else { + breakRuleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + public Builder mergeBreakRule(com.google.maps.routeoptimization.v1.BreakRule value) { + if (breakRuleBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && breakRule_ != null + && breakRule_ != com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance()) { + getBreakRuleBuilder().mergeFrom(value); + } else { + breakRule_ = value; + } + } else { + breakRuleBuilder_.mergeFrom(value); + } + if (breakRule_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + public Builder clearBreakRule() { + bitField0_ = (bitField0_ & ~0x00400000); + breakRule_ = null; + if (breakRuleBuilder_ != null) { + breakRuleBuilder_.dispose(); + breakRuleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + public com.google.maps.routeoptimization.v1.BreakRule.Builder getBreakRuleBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getBreakRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + public com.google.maps.routeoptimization.v1.BreakRuleOrBuilder getBreakRuleOrBuilder() { + if (breakRuleBuilder_ != null) { + return breakRuleBuilder_.getMessageOrBuilder(); + } else { + return breakRule_ == null + ? com.google.maps.routeoptimization.v1.BreakRule.getDefaultInstance() + : breakRule_; + } + } + /** + * + * + *
+     * Describes the break schedule to be enforced on this vehicle.
+     * If empty, no breaks will be scheduled for this vehicle.
+     * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule, + com.google.maps.routeoptimization.v1.BreakRule.Builder, + com.google.maps.routeoptimization.v1.BreakRuleOrBuilder> + getBreakRuleFieldBuilder() { + if (breakRuleBuilder_ == null) { + breakRuleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.BreakRule, + com.google.maps.routeoptimization.v1.BreakRule.Builder, + com.google.maps.routeoptimization.v1.BreakRuleOrBuilder>( + getBreakRule(), getParentForChildren(), isClean()); + breakRule_ = null; + } + return breakRuleBuilder_; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+     * Specifies a label for this vehicle. This label is reported in the response
+     * as the `vehicle_label` of the corresponding
+     * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+     * 
+ * + * string label = 27; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Specifies a label for this vehicle. This label is reported in the response
+     * as the `vehicle_label` of the corresponding
+     * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+     * 
+ * + * string label = 27; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Specifies a label for this vehicle. This label is reported in the response
+     * as the `vehicle_label` of the corresponding
+     * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+     * 
+ * + * string label = 27; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + label_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a label for this vehicle. This label is reported in the response
+     * as the `vehicle_label` of the corresponding
+     * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+     * 
+ * + * string label = 27; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + label_ = getDefaultInstance().getLabel(); + bitField0_ = (bitField0_ & ~0x00800000); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies a label for this vehicle. This label is reported in the response
+     * as the `vehicle_label` of the corresponding
+     * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+     * 
+ * + * string label = 27; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + label_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + private boolean ignore_; + /** + * + * + *
+     * If true, `used_if_route_is_empty` must be false, and this vehicle will
+     * remain unused.
+     *
+     * If a shipment is performed by an ignored vehicle in
+     * `injected_first_solution_routes`, it is skipped in the first solution but
+     * is free to be performed in the response.
+     *
+     * If a shipment is performed by an ignored vehicle in
+     * `injected_solution_constraint` and any related pickup/delivery is
+     * constrained to remain on the vehicle (i.e., not relaxed to level
+     * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response.
+     * If a shipment has a non-empty `allowed_vehicle_indices` field and all of
+     * the allowed vehicles are ignored, it is skipped in the response.
+     * 
+ * + * bool ignore = 28; + * + * @return The ignore. + */ + @java.lang.Override + public boolean getIgnore() { + return ignore_; + } + /** + * + * + *
+     * If true, `used_if_route_is_empty` must be false, and this vehicle will
+     * remain unused.
+     *
+     * If a shipment is performed by an ignored vehicle in
+     * `injected_first_solution_routes`, it is skipped in the first solution but
+     * is free to be performed in the response.
+     *
+     * If a shipment is performed by an ignored vehicle in
+     * `injected_solution_constraint` and any related pickup/delivery is
+     * constrained to remain on the vehicle (i.e., not relaxed to level
+     * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response.
+     * If a shipment has a non-empty `allowed_vehicle_indices` field and all of
+     * the allowed vehicles are ignored, it is skipped in the response.
+     * 
+ * + * bool ignore = 28; + * + * @param value The ignore to set. + * @return This builder for chaining. + */ + public Builder setIgnore(boolean value) { + + ignore_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, `used_if_route_is_empty` must be false, and this vehicle will
+     * remain unused.
+     *
+     * If a shipment is performed by an ignored vehicle in
+     * `injected_first_solution_routes`, it is skipped in the first solution but
+     * is free to be performed in the response.
+     *
+     * If a shipment is performed by an ignored vehicle in
+     * `injected_solution_constraint` and any related pickup/delivery is
+     * constrained to remain on the vehicle (i.e., not relaxed to level
+     * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response.
+     * If a shipment has a non-empty `allowed_vehicle_indices` field and all of
+     * the allowed vehicles are ignored, it is skipped in the response.
+     * 
+ * + * bool ignore = 28; + * + * @return This builder for chaining. + */ + public Builder clearIgnore() { + bitField0_ = (bitField0_ & ~0x01000000); + ignore_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Vehicle) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Vehicle) + private static final com.google.maps.routeoptimization.v1.Vehicle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Vehicle(); + } + + public static com.google.maps.routeoptimization.v1.Vehicle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Vehicle 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.Vehicle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/VehicleOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/VehicleOrBuilder.java new file mode 100644 index 000000000000..5ecd947edd3e --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/VehicleOrBuilder.java @@ -0,0 +1,1177 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface VehicleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Vehicle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The user-defined display name of the vehicle.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 32; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The user-defined display name of the vehicle.
+   * It can be up to 63 characters long and may use UTF-8 characters.
+   * 
+ * + * string display_name = 32; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The travel mode which affects the roads usable by the vehicle and its
+   * speed. See also `travel_duration_multiple`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return The enum numeric value on the wire for travelMode. + */ + int getTravelModeValue(); + /** + * + * + *
+   * The travel mode which affects the roads usable by the vehicle and its
+   * speed. See also `travel_duration_multiple`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * + * @return The travelMode. + */ + com.google.maps.routeoptimization.v1.Vehicle.TravelMode getTravelMode(); + + /** + * + * + *
+   * Geographic location where the vehicle starts before picking up any
+   * shipments. If not specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng start_location = 3; + * + * @return Whether the startLocation field is set. + */ + boolean hasStartLocation(); + /** + * + * + *
+   * Geographic location where the vehicle starts before picking up any
+   * shipments. If not specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng start_location = 3; + * + * @return The startLocation. + */ + com.google.type.LatLng getStartLocation(); + /** + * + * + *
+   * Geographic location where the vehicle starts before picking up any
+   * shipments. If not specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng start_location = 3; + */ + com.google.type.LatLngOrBuilder getStartLocationOrBuilder(); + + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle starts before
+   * picking up any shipments. If neither `start_waypoint` nor `start_location`
+   * is specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * + * @return Whether the startWaypoint field is set. + */ + boolean hasStartWaypoint(); + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle starts before
+   * picking up any shipments. If neither `start_waypoint` nor `start_location`
+   * is specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * + * @return The startWaypoint. + */ + com.google.maps.routeoptimization.v1.Waypoint getStartWaypoint(); + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle starts before
+   * picking up any shipments. If neither `start_waypoint` nor `start_location`
+   * is specified, the vehicle starts at its first pickup.
+   * If the shipment model has duration and distance matrices, `start_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + com.google.maps.routeoptimization.v1.WaypointOrBuilder getStartWaypointOrBuilder(); + + /** + * + * + *
+   * Geographic location where the vehicle ends after it has completed its last
+   * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+   * immediately when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng end_location = 5; + * + * @return Whether the endLocation field is set. + */ + boolean hasEndLocation(); + /** + * + * + *
+   * Geographic location where the vehicle ends after it has completed its last
+   * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+   * immediately when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng end_location = 5; + * + * @return The endLocation. + */ + com.google.type.LatLng getEndLocation(); + /** + * + * + *
+   * Geographic location where the vehicle ends after it has completed its last
+   * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
+   * immediately when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_location`
+   * must not be specified.
+   * 
+ * + * .google.type.LatLng end_location = 5; + */ + com.google.type.LatLngOrBuilder getEndLocationOrBuilder(); + + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle ends after
+   * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+   * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+   * when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * + * @return Whether the endWaypoint field is set. + */ + boolean hasEndWaypoint(); + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle ends after
+   * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+   * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+   * when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * + * @return The endWaypoint. + */ + com.google.maps.routeoptimization.v1.Waypoint getEndWaypoint(); + /** + * + * + *
+   * Waypoint representing a geographic location where the vehicle ends after
+   * it has completed its last `VisitRequest`. If neither `end_waypoint` nor
+   * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
+   * when it completes its last `VisitRequest`.
+   * If the shipment model has duration and distance matrices, `end_waypoint`
+   * must not be specified.
+   * 
+ * + * .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + com.google.maps.routeoptimization.v1.WaypointOrBuilder getEndWaypointOrBuilder(); + + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @return A list containing the startTags. + */ + java.util.List getStartTagsList(); + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @return The count of startTags. + */ + int getStartTagsCount(); + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @param index The index of the element to return. + * @return The startTags at the given index. + */ + java.lang.String getStartTags(int index); + /** + * + * + *
+   * Specifies tags attached to the start of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string start_tags = 7; + * + * @param index The index of the value to return. + * @return The bytes of the startTags at the given index. + */ + com.google.protobuf.ByteString getStartTagsBytes(int index); + + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @return A list containing the endTags. + */ + java.util.List getEndTagsList(); + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @return The count of endTags. + */ + int getEndTagsCount(); + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @param index The index of the element to return. + * @return The endTags at the given index. + */ + java.lang.String getEndTags(int index); + /** + * + * + *
+   * Specifies tags attached to the end of the vehicle's route.
+   *
+   * Empty or duplicate strings are not allowed.
+   * 
+ * + * repeated string end_tags = 8; + * + * @param index The index of the value to return. + * @return The bytes of the endTags at the given index. + */ + com.google.protobuf.ByteString getEndTagsBytes(int index); + + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + java.util.List getStartTimeWindowsList(); + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + com.google.maps.routeoptimization.v1.TimeWindow getStartTimeWindows(int index); + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + int getStartTimeWindowsCount(); + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + java.util.List + getStartTimeWindowsOrBuilderList(); + /** + * + * + *
+   * Time windows during which the vehicle may depart its start location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getStartTimeWindowsOrBuilder(int index); + + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + java.util.List getEndTimeWindowsList(); + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + com.google.maps.routeoptimization.v1.TimeWindow getEndTimeWindows(int index); + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + int getEndTimeWindowsCount(); + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + java.util.List + getEndTimeWindowsOrBuilderList(); + /** + * + * + *
+   * Time windows during which the vehicle may arrive at its end location.
+   * They must be within the global time limits (see
+   * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]
+   * fields). If unspecified, there is no limitation besides those global time
+   * limits.
+   *
+   * Time windows belonging to the same repeated field must be disjoint, i.e. no
+   * time window can overlap with or be adjacent to another, and they must be in
+   * chronological order.
+   *
+   * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
+   * there is a single time window.
+   * 
+ * + * repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + com.google.maps.routeoptimization.v1.TimeWindowOrBuilder getEndTimeWindowsOrBuilder(int index); + + /** + * + * + *
+   * Specifies a multiplicative factor that can be used to increase or decrease
+   * travel times of this vehicle. For example, setting this to 2.0 means
+   * that this vehicle is slower and has travel times that are twice what they
+   * are for standard vehicles. This multiple does not affect visit durations.
+   * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+   * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+   * is standard, and this multiple is considered 1.0.
+   *
+   * WARNING: Travel times will be rounded to the nearest second after this
+   * multiple is applied but before performing any numerical operations, thus,
+   * a small multiple may result in a loss of precision.
+   *
+   * See also `extra_visit_duration_for_visit_type` below.
+   * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return Whether the travelDurationMultiple field is set. + */ + boolean hasTravelDurationMultiple(); + /** + * + * + *
+   * Specifies a multiplicative factor that can be used to increase or decrease
+   * travel times of this vehicle. For example, setting this to 2.0 means
+   * that this vehicle is slower and has travel times that are twice what they
+   * are for standard vehicles. This multiple does not affect visit durations.
+   * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
+   * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
+   * is standard, and this multiple is considered 1.0.
+   *
+   * WARNING: Travel times will be rounded to the nearest second after this
+   * multiple is applied but before performing any numerical operations, thus,
+   * a small multiple may result in a loss of precision.
+   *
+   * See also `extra_visit_duration_for_visit_type` below.
+   * 
+ * + * optional double travel_duration_multiple = 11; + * + * @return The travelDurationMultiple. + */ + double getTravelDurationMultiple(); + + /** + * + * + *
+   * Unloading policy enforced on the vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return The enum numeric value on the wire for unloadingPolicy. + */ + int getUnloadingPolicyValue(); + /** + * + * + *
+   * Unloading policy enforced on the vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * + * @return The unloadingPolicy. + */ + com.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy getUnloadingPolicy(); + + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + int getLoadLimitsCount(); + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + boolean containsLoadLimits(java.lang.String key); + /** Use {@link #getLoadLimitsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getLoadLimits(); + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + java.util.Map + getLoadLimitsMap(); + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + /* nullable */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit getLoadLimitsOrDefault( + java.lang.String key, + /* nullable */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit defaultValue); + /** + * + * + *
+   * Capacities of the vehicle (weight, volume, # of pallets for example).
+   * The keys in the map are the identifiers of the type of load, consistent
+   * with the keys of the
+   * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]
+   * field. If a given key is absent from this map, the corresponding capacity
+   * is considered to be limitless.
+   * 
+ * + * map<string, .google.maps.routeoptimization.v1.Vehicle.LoadLimit> load_limits = 30; + * + */ + com.google.maps.routeoptimization.v1.Vehicle.LoadLimit getLoadLimitsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Vehicle costs: all costs add up and must be in the same unit as
+   * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].
+   *
+   * Cost per hour of the vehicle route. This cost is applied to the total time
+   * taken by the route, and includes travel time, waiting time, and visit time.
+   * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result
+   * in additional latency.
+   * 
+ * + * double cost_per_hour = 16; + * + * @return The costPerHour. + */ + double getCostPerHour(); + + /** + * + * + *
+   * Cost per traveled hour of the vehicle route. This cost is applied only to
+   * travel time taken by the route (i.e., that reported in
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]),
+   * and excludes waiting time and visit time.
+   * 
+ * + * double cost_per_traveled_hour = 17; + * + * @return The costPerTraveledHour. + */ + double getCostPerTraveledHour(); + + /** + * + * + *
+   * Cost per kilometer of the vehicle route. This cost is applied to the
+   * distance reported in the
+   * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]
+   * and does not apply to any distance implicitly traveled from the
+   * `arrival_location` to the `departure_location` of a single `VisitRequest`.
+   * 
+ * + * double cost_per_kilometer = 18; + * + * @return The costPerKilometer. + */ + double getCostPerKilometer(); + + /** + * + * + *
+   * Fixed cost applied if this vehicle is used to handle a shipment.
+   * 
+ * + * double fixed_cost = 19; + * + * @return The fixedCost. + */ + double getFixedCost(); + + /** + * + * + *
+   * This field only applies to vehicles when their route does not serve any
+   * shipments. It indicates if the vehicle should be considered as used or not
+   * in this case.
+   *
+   * If true, the vehicle goes from its start to its end location even if it
+   * doesn't serve any shipments, and time and distance costs resulting from its
+   * start --> end travel are taken into account.
+   *
+   * Otherwise, it doesn't travel from its start to its end location, and no
+   * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this
+   * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any
+   * information except for the vehicle index and label.
+   * 
+ * + * bool used_if_route_is_empty = 20; + * + * @return The usedIfRouteIsEmpty. + */ + boolean getUsedIfRouteIsEmpty(); + + /** + * + * + *
+   * Limit applied to the total duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route duration of a vehicle is the
+   * difference between its `vehicle_end_time` and `vehicle_start_time`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + * @return Whether the routeDurationLimit field is set. + */ + boolean hasRouteDurationLimit(); + /** + * + * + *
+   * Limit applied to the total duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route duration of a vehicle is the
+   * difference between its `vehicle_end_time` and `vehicle_start_time`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * + * @return The routeDurationLimit. + */ + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getRouteDurationLimit(); + /** + * + * + *
+   * Limit applied to the total duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route duration of a vehicle is the
+   * difference between its `vehicle_end_time` and `vehicle_start_time`.
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + */ + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder + getRouteDurationLimitOrBuilder(); + + /** + * + * + *
+   * Limit applied to the travel duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route travel duration is the sum of all its
+   * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + * + * @return Whether the travelDurationLimit field is set. + */ + boolean hasTravelDurationLimit(); + /** + * + * + *
+   * Limit applied to the travel duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route travel duration is the sum of all its
+   * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + * + * @return The travelDurationLimit. + */ + com.google.maps.routeoptimization.v1.Vehicle.DurationLimit getTravelDurationLimit(); + /** + * + * + *
+   * Limit applied to the travel duration of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route travel duration is the sum of all its
+   * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].
+   * 
+ * + * .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * + */ + com.google.maps.routeoptimization.v1.Vehicle.DurationLimitOrBuilder + getTravelDurationLimitOrBuilder(); + + /** + * + * + *
+   * Limit applied to the total distance of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route distance is the sum of all its
+   * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * + * @return Whether the routeDistanceLimit field is set. + */ + boolean hasRouteDistanceLimit(); + /** + * + * + *
+   * Limit applied to the total distance of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route distance is the sum of all its
+   * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * + * @return The routeDistanceLimit. + */ + com.google.maps.routeoptimization.v1.DistanceLimit getRouteDistanceLimit(); + /** + * + * + *
+   * Limit applied to the total distance of the vehicle's route. In a given
+   * `OptimizeToursResponse`, the route distance is the sum of all its
+   * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].
+   * 
+ * + * .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + com.google.maps.routeoptimization.v1.DistanceLimitOrBuilder getRouteDistanceLimitOrBuilder(); + + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + int getExtraVisitDurationForVisitTypeCount(); + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + boolean containsExtraVisitDurationForVisitType(java.lang.String key); + /** Use {@link #getExtraVisitDurationForVisitTypeMap()} instead. */ + @java.lang.Deprecated + java.util.Map getExtraVisitDurationForVisitType(); + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + java.util.Map + getExtraVisitDurationForVisitTypeMap(); + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + /* nullable */ + com.google.protobuf.Duration getExtraVisitDurationForVisitTypeOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Duration defaultValue); + /** + * + * + *
+   * Specifies a map from visit_types strings to durations. The duration is time
+   * in addition to
+   * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration]
+   * to be taken at visits with the specified `visit_types`. This extra visit
+   * duration adds cost if `cost_per_hour` is specified. Keys (i.e.
+   * `visit_types`) cannot be empty strings.
+   *
+   * If a visit request has multiple types, a duration will be added for each
+   * type in the map.
+   * 
+ * + * map<string, .google.protobuf.Duration> extra_visit_duration_for_visit_type = 24; + * + */ + com.google.protobuf.Duration getExtraVisitDurationForVisitTypeOrThrow(java.lang.String key); + + /** + * + * + *
+   * Describes the break schedule to be enforced on this vehicle.
+   * If empty, no breaks will be scheduled for this vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * + * @return Whether the breakRule field is set. + */ + boolean hasBreakRule(); + /** + * + * + *
+   * Describes the break schedule to be enforced on this vehicle.
+   * If empty, no breaks will be scheduled for this vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * + * @return The breakRule. + */ + com.google.maps.routeoptimization.v1.BreakRule getBreakRule(); + /** + * + * + *
+   * Describes the break schedule to be enforced on this vehicle.
+   * If empty, no breaks will be scheduled for this vehicle.
+   * 
+ * + * .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + com.google.maps.routeoptimization.v1.BreakRuleOrBuilder getBreakRuleOrBuilder(); + + /** + * + * + *
+   * Specifies a label for this vehicle. This label is reported in the response
+   * as the `vehicle_label` of the corresponding
+   * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+   * 
+ * + * string label = 27; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+   * Specifies a label for this vehicle. This label is reported in the response
+   * as the `vehicle_label` of the corresponding
+   * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].
+   * 
+ * + * string label = 27; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); + + /** + * + * + *
+   * If true, `used_if_route_is_empty` must be false, and this vehicle will
+   * remain unused.
+   *
+   * If a shipment is performed by an ignored vehicle in
+   * `injected_first_solution_routes`, it is skipped in the first solution but
+   * is free to be performed in the response.
+   *
+   * If a shipment is performed by an ignored vehicle in
+   * `injected_solution_constraint` and any related pickup/delivery is
+   * constrained to remain on the vehicle (i.e., not relaxed to level
+   * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response.
+   * If a shipment has a non-empty `allowed_vehicle_indices` field and all of
+   * the allowed vehicles are ignored, it is skipped in the response.
+   * 
+ * + * bool ignore = 28; + * + * @return The ignore. + */ + boolean getIgnore(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Waypoint.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Waypoint.java new file mode 100644 index 000000000000..6554adb9ef77 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/Waypoint.java @@ -0,0 +1,1178 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +/** + * + * + *
+ * Encapsulates a waypoint. Waypoints mark arrival and departure locations of
+ * VisitRequests, and start and end locations of Vehicles.
+ * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Waypoint} + */ +public final class Waypoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routeoptimization.v1.Waypoint) + WaypointOrBuilder { + private static final long serialVersionUID = 0L; + // Use Waypoint.newBuilder() to construct. + private Waypoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Waypoint() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Waypoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Waypoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Waypoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Waypoint.class, + com.google.maps.routeoptimization.v1.Waypoint.Builder.class); + } + + private int locationTypeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object locationType_; + + public enum LocationTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LOCATION(1), + PLACE_ID(2), + LOCATIONTYPE_NOT_SET(0); + private final int value; + + private LocationTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LocationTypeCase valueOf(int value) { + return forNumber(value); + } + + public static LocationTypeCase forNumber(int value) { + switch (value) { + case 1: + return LOCATION; + case 2: + return PLACE_ID; + case 0: + return LOCATIONTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LocationTypeCase getLocationTypeCase() { + return LocationTypeCase.forNumber(locationTypeCase_); + } + + public static final int LOCATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + * + * @return Whether the location field is set. + */ + @java.lang.Override + public boolean hasLocation() { + return locationTypeCase_ == 1; + } + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + * + * @return The location. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Location getLocation() { + if (locationTypeCase_ == 1) { + return (com.google.maps.routeoptimization.v1.Location) locationType_; + } + return com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.LocationOrBuilder getLocationOrBuilder() { + if (locationTypeCase_ == 1) { + return (com.google.maps.routeoptimization.v1.Location) locationType_; + } + return com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } + + public static final int PLACE_ID_FIELD_NUMBER = 2; + /** + * + * + *
+   * The POI Place ID associated with the waypoint.
+   * 
+ * + * string place_id = 2; + * + * @return Whether the placeId field is set. + */ + public boolean hasPlaceId() { + return locationTypeCase_ == 2; + } + /** + * + * + *
+   * The POI Place ID associated with the waypoint.
+   * 
+ * + * string place_id = 2; + * + * @return The placeId. + */ + public java.lang.String getPlaceId() { + java.lang.Object ref = ""; + if (locationTypeCase_ == 2) { + ref = locationType_; + } + 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(); + if (locationTypeCase_ == 2) { + locationType_ = s; + } + return s; + } + } + /** + * + * + *
+   * The POI Place ID associated with the waypoint.
+   * 
+ * + * string place_id = 2; + * + * @return The bytes for placeId. + */ + public com.google.protobuf.ByteString getPlaceIdBytes() { + java.lang.Object ref = ""; + if (locationTypeCase_ == 2) { + ref = locationType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (locationTypeCase_ == 2) { + locationType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIDE_OF_ROAD_FIELD_NUMBER = 3; + private boolean sideOfRoad_ = false; + /** + * + * + *
+   * Optional. Indicates that the location of this waypoint is meant to have a
+   * preference for the vehicle to stop at a particular side of road. When you
+   * set this value, the route will pass through the location so that the
+   * vehicle can stop at the side of road that the location is biased towards
+   * from the center of the road. This option doesn't work for the 'WALKING'
+   * travel mode.
+   * 
+ * + * bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sideOfRoad. + */ + @java.lang.Override + public boolean getSideOfRoad() { + return sideOfRoad_; + } + + 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 (locationTypeCase_ == 1) { + output.writeMessage(1, (com.google.maps.routeoptimization.v1.Location) locationType_); + } + if (locationTypeCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, locationType_); + } + if (sideOfRoad_ != false) { + output.writeBool(3, sideOfRoad_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (locationTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.maps.routeoptimization.v1.Location) locationType_); + } + if (locationTypeCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, locationType_); + } + if (sideOfRoad_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, sideOfRoad_); + } + 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.Waypoint)) { + return super.equals(obj); + } + com.google.maps.routeoptimization.v1.Waypoint other = + (com.google.maps.routeoptimization.v1.Waypoint) obj; + + if (getSideOfRoad() != other.getSideOfRoad()) return false; + if (!getLocationTypeCase().equals(other.getLocationTypeCase())) return false; + switch (locationTypeCase_) { + case 1: + if (!getLocation().equals(other.getLocation())) return false; + break; + case 2: + if (!getPlaceId().equals(other.getPlaceId())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SIDE_OF_ROAD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSideOfRoad()); + switch (locationTypeCase_) { + case 1: + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + break; + case 2: + hash = (37 * hash) + PLACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getPlaceId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routeoptimization.v1.Waypoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Waypoint 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.Waypoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Waypoint 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.Waypoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routeoptimization.v1.Waypoint 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.Waypoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Waypoint 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.Waypoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routeoptimization.v1.Waypoint 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.Waypoint 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.Waypoint 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.Waypoint 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; + } + /** + * + * + *
+   * Encapsulates a waypoint. Waypoints mark arrival and departure locations of
+   * VisitRequests, and start and end locations of Vehicles.
+   * 
+ * + * Protobuf type {@code google.maps.routeoptimization.v1.Waypoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routeoptimization.v1.Waypoint) + com.google.maps.routeoptimization.v1.WaypointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Waypoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routeoptimization.v1.RouteOptimizationServiceProto + .internal_static_google_maps_routeoptimization_v1_Waypoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routeoptimization.v1.Waypoint.class, + com.google.maps.routeoptimization.v1.Waypoint.Builder.class); + } + + // Construct using com.google.maps.routeoptimization.v1.Waypoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (locationBuilder_ != null) { + locationBuilder_.clear(); + } + sideOfRoad_ = false; + locationTypeCase_ = 0; + locationType_ = 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_Waypoint_descriptor; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint getDefaultInstanceForType() { + return com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint build() { + com.google.maps.routeoptimization.v1.Waypoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routeoptimization.v1.Waypoint buildPartial() { + com.google.maps.routeoptimization.v1.Waypoint result = + new com.google.maps.routeoptimization.v1.Waypoint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.routeoptimization.v1.Waypoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sideOfRoad_ = sideOfRoad_; + } + } + + private void buildPartialOneofs(com.google.maps.routeoptimization.v1.Waypoint result) { + result.locationTypeCase_ = locationTypeCase_; + result.locationType_ = this.locationType_; + if (locationTypeCase_ == 1 && locationBuilder_ != null) { + result.locationType_ = locationBuilder_.build(); + } + } + + @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.Waypoint) { + return mergeFrom((com.google.maps.routeoptimization.v1.Waypoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routeoptimization.v1.Waypoint other) { + if (other == com.google.maps.routeoptimization.v1.Waypoint.getDefaultInstance()) return this; + if (other.getSideOfRoad() != false) { + setSideOfRoad(other.getSideOfRoad()); + } + switch (other.getLocationTypeCase()) { + case LOCATION: + { + mergeLocation(other.getLocation()); + break; + } + case PLACE_ID: + { + locationTypeCase_ = 2; + locationType_ = other.locationType_; + onChanged(); + break; + } + case LOCATIONTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getLocationFieldBuilder().getBuilder(), extensionRegistry); + locationTypeCase_ = 1; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + locationTypeCase_ = 2; + locationType_ = s; + break; + } // case 18 + case 24: + { + sideOfRoad_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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 locationTypeCase_ = 0; + private java.lang.Object locationType_; + + public LocationTypeCase getLocationTypeCase() { + return LocationTypeCase.forNumber(locationTypeCase_); + } + + public Builder clearLocationType() { + locationTypeCase_ = 0; + locationType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Location, + com.google.maps.routeoptimization.v1.Location.Builder, + com.google.maps.routeoptimization.v1.LocationOrBuilder> + locationBuilder_; + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + * + * @return Whether the location field is set. + */ + @java.lang.Override + public boolean hasLocation() { + return locationTypeCase_ == 1; + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + * + * @return The location. + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.Location getLocation() { + if (locationBuilder_ == null) { + if (locationTypeCase_ == 1) { + return (com.google.maps.routeoptimization.v1.Location) locationType_; + } + return com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } else { + if (locationTypeCase_ == 1) { + return locationBuilder_.getMessage(); + } + return com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + public Builder setLocation(com.google.maps.routeoptimization.v1.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + locationType_ = value; + onChanged(); + } else { + locationBuilder_.setMessage(value); + } + locationTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + public Builder setLocation( + com.google.maps.routeoptimization.v1.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + locationType_ = builderForValue.build(); + onChanged(); + } else { + locationBuilder_.setMessage(builderForValue.build()); + } + locationTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + public Builder mergeLocation(com.google.maps.routeoptimization.v1.Location value) { + if (locationBuilder_ == null) { + if (locationTypeCase_ == 1 + && locationType_ + != com.google.maps.routeoptimization.v1.Location.getDefaultInstance()) { + locationType_ = + com.google.maps.routeoptimization.v1.Location.newBuilder( + (com.google.maps.routeoptimization.v1.Location) locationType_) + .mergeFrom(value) + .buildPartial(); + } else { + locationType_ = value; + } + onChanged(); + } else { + if (locationTypeCase_ == 1) { + locationBuilder_.mergeFrom(value); + } else { + locationBuilder_.setMessage(value); + } + } + locationTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + public Builder clearLocation() { + if (locationBuilder_ == null) { + if (locationTypeCase_ == 1) { + locationTypeCase_ = 0; + locationType_ = null; + onChanged(); + } + } else { + if (locationTypeCase_ == 1) { + locationTypeCase_ = 0; + locationType_ = null; + } + locationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + public com.google.maps.routeoptimization.v1.Location.Builder getLocationBuilder() { + return getLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + @java.lang.Override + public com.google.maps.routeoptimization.v1.LocationOrBuilder getLocationOrBuilder() { + if ((locationTypeCase_ == 1) && (locationBuilder_ != null)) { + return locationBuilder_.getMessageOrBuilder(); + } else { + if (locationTypeCase_ == 1) { + return (com.google.maps.routeoptimization.v1.Location) locationType_; + } + return com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Location, + com.google.maps.routeoptimization.v1.Location.Builder, + com.google.maps.routeoptimization.v1.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + if (!(locationTypeCase_ == 1)) { + locationType_ = com.google.maps.routeoptimization.v1.Location.getDefaultInstance(); + } + locationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routeoptimization.v1.Location, + com.google.maps.routeoptimization.v1.Location.Builder, + com.google.maps.routeoptimization.v1.LocationOrBuilder>( + (com.google.maps.routeoptimization.v1.Location) locationType_, + getParentForChildren(), + isClean()); + locationType_ = null; + } + locationTypeCase_ = 1; + onChanged(); + return locationBuilder_; + } + + /** + * + * + *
+     * The POI Place ID associated with the waypoint.
+     * 
+ * + * string place_id = 2; + * + * @return Whether the placeId field is set. + */ + @java.lang.Override + public boolean hasPlaceId() { + return locationTypeCase_ == 2; + } + /** + * + * + *
+     * The POI Place ID associated with the waypoint.
+     * 
+ * + * string place_id = 2; + * + * @return The placeId. + */ + @java.lang.Override + public java.lang.String getPlaceId() { + java.lang.Object ref = ""; + if (locationTypeCase_ == 2) { + ref = locationType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (locationTypeCase_ == 2) { + locationType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The POI Place ID associated with the waypoint.
+     * 
+ * + * string place_id = 2; + * + * @return The bytes for placeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPlaceIdBytes() { + java.lang.Object ref = ""; + if (locationTypeCase_ == 2) { + ref = locationType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (locationTypeCase_ == 2) { + locationType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The POI Place ID associated with the waypoint.
+     * 
+ * + * string place_id = 2; + * + * @param value The placeId to set. + * @return This builder for chaining. + */ + public Builder setPlaceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationTypeCase_ = 2; + locationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The POI Place ID associated with the waypoint.
+     * 
+ * + * string place_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearPlaceId() { + if (locationTypeCase_ == 2) { + locationTypeCase_ = 0; + locationType_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The POI Place ID associated with the waypoint.
+     * 
+ * + * string place_id = 2; + * + * @param value The bytes for placeId to set. + * @return This builder for chaining. + */ + public Builder setPlaceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationTypeCase_ = 2; + locationType_ = value; + onChanged(); + return this; + } + + private boolean sideOfRoad_; + /** + * + * + *
+     * Optional. Indicates that the location of this waypoint is meant to have a
+     * preference for the vehicle to stop at a particular side of road. When you
+     * set this value, the route will pass through the location so that the
+     * vehicle can stop at the side of road that the location is biased towards
+     * from the center of the road. This option doesn't work for the 'WALKING'
+     * travel mode.
+     * 
+ * + * bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sideOfRoad. + */ + @java.lang.Override + public boolean getSideOfRoad() { + return sideOfRoad_; + } + /** + * + * + *
+     * Optional. Indicates that the location of this waypoint is meant to have a
+     * preference for the vehicle to stop at a particular side of road. When you
+     * set this value, the route will pass through the location so that the
+     * vehicle can stop at the side of road that the location is biased towards
+     * from the center of the road. This option doesn't work for the 'WALKING'
+     * travel mode.
+     * 
+ * + * bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The sideOfRoad to set. + * @return This builder for chaining. + */ + public Builder setSideOfRoad(boolean value) { + + sideOfRoad_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Indicates that the location of this waypoint is meant to have a
+     * preference for the vehicle to stop at a particular side of road. When you
+     * set this value, the route will pass through the location so that the
+     * vehicle can stop at the side of road that the location is biased towards
+     * from the center of the road. This option doesn't work for the 'WALKING'
+     * travel mode.
+     * 
+ * + * bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSideOfRoad() { + bitField0_ = (bitField0_ & ~0x00000004); + sideOfRoad_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.maps.routeoptimization.v1.Waypoint) + } + + // @@protoc_insertion_point(class_scope:google.maps.routeoptimization.v1.Waypoint) + private static final com.google.maps.routeoptimization.v1.Waypoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routeoptimization.v1.Waypoint(); + } + + public static com.google.maps.routeoptimization.v1.Waypoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Waypoint 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.Waypoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/WaypointOrBuilder.java b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/WaypointOrBuilder.java new file mode 100644 index 000000000000..fb748697db94 --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/java/com/google/maps/routeoptimization/v1/WaypointOrBuilder.java @@ -0,0 +1,121 @@ +/* + * 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.3 +package com.google.maps.routeoptimization.v1; + +public interface WaypointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routeoptimization.v1.Waypoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + * + * @return Whether the location field is set. + */ + boolean hasLocation(); + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + * + * @return The location. + */ + com.google.maps.routeoptimization.v1.Location getLocation(); + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routeoptimization.v1.Location location = 1; + */ + com.google.maps.routeoptimization.v1.LocationOrBuilder getLocationOrBuilder(); + + /** + * + * + *
+   * The POI Place ID associated with the waypoint.
+   * 
+ * + * string place_id = 2; + * + * @return Whether the placeId field is set. + */ + boolean hasPlaceId(); + /** + * + * + *
+   * The POI Place ID associated with the waypoint.
+   * 
+ * + * string place_id = 2; + * + * @return The placeId. + */ + java.lang.String getPlaceId(); + /** + * + * + *
+   * The POI Place ID associated with the waypoint.
+   * 
+ * + * string place_id = 2; + * + * @return The bytes for placeId. + */ + com.google.protobuf.ByteString getPlaceIdBytes(); + + /** + * + * + *
+   * Optional. Indicates that the location of this waypoint is meant to have a
+   * preference for the vehicle to stop at a particular side of road. When you
+   * set this value, the route will pass through the location so that the
+   * vehicle can stop at the side of road that the location is biased towards
+   * from the center of the road. This option doesn't work for the 'WALKING'
+   * travel mode.
+   * 
+ * + * bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sideOfRoad. + */ + boolean getSideOfRoad(); + + com.google.maps.routeoptimization.v1.Waypoint.LocationTypeCase getLocationTypeCase(); +} diff --git a/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/proto/google/maps/routeoptimization/v1/route_optimization_service.proto b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/proto/google/maps/routeoptimization/v1/route_optimization_service.proto new file mode 100644 index 000000000000..26b51bd3cdba --- /dev/null +++ b/java-maps-routeoptimization/proto-google-maps-routeoptimization-v1/src/main/proto/google/maps/routeoptimization/v1/route_optimization_service.proto @@ -0,0 +1,2537 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.maps.routeoptimization.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/latlng.proto"; + +option csharp_namespace = "Google.Maps.RouteOptimization.V1"; +option go_package = "cloud.google.com/go/maps/routeoptimization/apiv1/routeoptimizationpb;routeoptimizationpb"; +option java_multiple_files = true; +option java_outer_classname = "RouteOptimizationServiceProto"; +option java_package = "com.google.maps.routeoptimization.v1"; +option php_namespace = "Google\\Maps\\RouteOptimization\\V1"; +option ruby_package = "Google::Maps::RouteOptimization::V1"; + +// A service for optimizing vehicle tours. +// +// Validity of certain types of fields: +// +// * `google.protobuf.Timestamp` +// * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00. +// * seconds must be in [0, 253402300799], +// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. +// * nanos must be unset or set to 0. +// * `google.protobuf.Duration` +// * seconds must be in [0, 253402300799], +// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. +// * nanos must be unset or set to 0. +// * `google.type.LatLng` +// * latitude must be in [-90.0, 90.0]. +// * longitude must be in [-180.0, 180.0]. +// * at least one of latitude and longitude must be non-zero. +// +service RouteOptimization { + option (google.api.default_host) = "routeoptimization.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + // `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of + // routes to be performed by vehicles minimizing the overall cost. + // + // A `ShipmentModel` model consists mainly of `Shipment`s that need to be + // carried out and `Vehicle`s that can be used to transport the `Shipment`s. + // The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, + // they assign a series of `Visit`s to each vehicle, where a `Visit` + // corresponds to a `VisitRequest`, which is a pickup or delivery for a + // `Shipment`. + // + // The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that + // minimizes the total cost where cost has many components defined in the + // `ShipmentModel`. + rpc OptimizeTours(OptimizeToursRequest) returns (OptimizeToursResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:optimizeTours" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*}:optimizeTours" + body: "*" + } + }; + } + + // Optimizes vehicle tours for one or more `OptimizeToursRequest` + // messages as a batch. + // + // This method is a Long Running Operation (LRO). The inputs for optimization + // (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` + // messages) are read/written from/to Cloud Storage in user-specified + // format. Like the `OptimizeTours` method, each `OptimizeToursRequest` + // contains a `ShipmentModel` and returns an `OptimizeToursResponse` + // containing `ShipmentRoute`s, which are a set of routes to be performed by + // vehicles minimizing the overall cost. + rpc BatchOptimizeTours(BatchOptimizeToursRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:batchOptimizeTours" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*}:batchOptimizeTours" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "BatchOptimizeToursResponse" + metadata_type: "BatchOptimizeToursMetadata" + }; + } +} + +// Request to batch optimize tours as an asynchronous operation. +// Each input file should contain one `OptimizeToursRequest`, and each output +// file will contain one `OptimizeToursResponse`. The request contains +// information to read/write and parse the files. All the input and output files +// should be under the same project. +message BatchOptimizeToursRequest { + // Information for solving one optimization model asynchronously. + message AsyncModelConfig { + // Optional. User defined model name, can be used as alias by users to keep + // track of models. + string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Information about the input model. + InputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired output location information. + OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Target project and location to make a call. + // + // Format: + // * `projects/{project-id}` + // * `projects/{project-id}/locations/{location-id}` + // + // If no location is specified, a region will be chosen automatically. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input/Output information each purchase model, such as file paths + // and data formats. + repeated AsyncModelConfig model_configs = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response to a `BatchOptimizeToursRequest`. This is returned in +// the Long Running Operation after the operation is complete. +message BatchOptimizeToursResponse {} + +// Operation metadata for `BatchOptimizeToursRequest` calls. +message BatchOptimizeToursMetadata {} + +// Request to be given to a tour optimization solver which defines the +// shipment model to solve as well as optimization parameters. +message OptimizeToursRequest { + // Defines how the solver should handle the request. In all modes but + // `VALIDATE_ONLY`, if the request is invalid, you will receive an + // `INVALID_REQUEST` error. See + // [max_validation_errors][google.maps.routeoptimization.v1.OptimizeToursRequest.max_validation_errors] + // to cap the number of errors returned. + enum SolvingMode { + // Solve the model. + DEFAULT_SOLVE = 0; + + // Only validates the model without solving it: populates as many + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // as possible. + VALIDATE_ONLY = 1; + + // Only populates + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // or + // [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments], + // and doesn't actually solve the rest of the request (`status` and `routes` + // are unset in the response). + // If infeasibilities in `injected_solution_constraint` routes are detected + // they are populated in the + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // field and + // [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments] + // is left empty. + // + // *IMPORTANT*: not all infeasible shipments are returned here, but only the + // ones that are detected as infeasible during preprocessing. + DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + } + + // Mode defining the behavior of the search, trading off latency versus + // solution quality. In all modes, the global request deadline is enforced. + enum SearchMode { + // Unspecified search mode, equivalent to `RETURN_FAST`. + SEARCH_MODE_UNSPECIFIED = 0; + + // Stop the search after finding the first good solution. + RETURN_FAST = 1; + + // Spend all the available time to search for better solutions. + CONSUME_ALL_AVAILABLE_TIME = 2; + } + + // Required. Target project or location to make a call. + // + // Format: + // * `projects/{project-id}` + // * `projects/{project-id}/locations/{location-id}` + // + // If no location is specified, a region will be chosen automatically. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // If this timeout is set, the server returns a response before the timeout + // period has elapsed or the server deadline for synchronous requests is + // reached, whichever is sooner. + // + // For asynchronous requests, the server will generate a solution (if + // possible) before the timeout has elapsed. + google.protobuf.Duration timeout = 2; + + // Shipment model to solve. + ShipmentModel model = 3; + + // By default, the solving mode is `DEFAULT_SOLVE` (0). + SolvingMode solving_mode = 4; + + // Search mode used to solve the request. + SearchMode search_mode = 6; + + // Guide the optimization algorithm in finding a first solution that is + // similar to a previous solution. + // + // The model is constrained when the first solution is built. + // Any shipments not performed on a route are implicitly skipped in the first + // solution, but they may be performed in successive solutions. + // + // The solution must satisfy some basic validity assumptions: + // + // * for all routes, `vehicle_index` must be in range and not be duplicated. + // * for all visits, `shipment_index` and `visit_request_index` must be + // in range. + // * a shipment may only be referenced on one route. + // * the pickup of a pickup-delivery shipment must be performed before + // the delivery. + // * no more than one pickup alternative or delivery alternative of + // a shipment may be performed. + // * for all routes, times are increasing (i.e., `vehicle_start_time + // <= visits[0].start_time <= visits[1].start_time ... + // <= vehicle_end_time`). + // * a shipment may only be performed on a vehicle that is allowed. A + // vehicle is allowed if + // [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + // is empty or its `vehicle_index` is included in + // [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + // + // If the injected solution is not feasible, a validation error is not + // necessarily returned and an error indicating infeasibility may be returned + // instead. + repeated ShipmentRoute injected_first_solution_routes = 7; + + // Constrain the optimization algorithm to find a final solution that is + // similar to a previous solution. For example, this may be used to freeze + // portions of routes which have already been completed or which are to be + // completed but must not be modified. + // + // If the injected solution is not feasible, a validation error is not + // necessarily returned and an error indicating infeasibility may be returned + // instead. + InjectedSolutionConstraint injected_solution_constraint = 8; + + // If non-empty, the given routes will be refreshed, without modifying their + // underlying sequence of visits or travel times: only other details will be + // updated. This does not solve the model. + // + // As of 2020/11, this only populates the polylines of non-empty routes and + // requires that `populate_polylines` is true. + // + // The `route_polyline` fields of the passed-in routes may be inconsistent + // with route `transitions`. + // + // This field must not be used together with `injected_first_solution_routes` + // or `injected_solution_constraint`. + // + // `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + // Polylines are still populated between all visits in all non-empty routes + // regardless of whether the related shipments or vehicles are ignored. + repeated ShipmentRoute refresh_details_routes = 9; + + // If true: + // + // * uses + // [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + // instead of `vehicle_index` to + // match routes in an injected solution with vehicles in the request; + // reuses the mapping of original + // [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + // to new + // [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + // to update + // [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + // if non-empty, but the mapping must be unambiguous (i.e., multiple + // `ShipmentRoute`s must not share the same original `vehicle_index`). + // * uses + // [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + // instead of `shipment_index` + // to match visits in an injected solution with shipments in the request; + // * uses + // [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + // instead of + // [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + // to + // match skipped shipments in the injected solution with request + // shipments. + // + // This interpretation applies to the `injected_first_solution_routes`, + // `injected_solution_constraint`, and `refresh_details_routes` fields. + // It can be used when shipment or vehicle indices in the request have + // changed since the solution was created, perhaps because shipments or + // vehicles have been removed from or added to the request. + // + // If true, labels in the following categories must appear at most once in + // their category: + // + // * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + // request; + // * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + // the request; + // * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + // * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + // the injected solution (except pickup/delivery visit pairs, whose + // `shipment_label` must appear twice). + // + // If a `vehicle_label` in the injected solution does not correspond to a + // request vehicle, the corresponding route is removed from the solution + // along with its visits. If a `shipment_label` in the injected solution does + // not correspond to a request shipment, the corresponding visit is removed + // from the solution. If a + // [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + // in the injected solution does not correspond to a request shipment, the + // `SkippedShipment` is removed from the solution. + // + // Removing route visits or entire routes from an injected solution may + // have an effect on the implied constraints, which may lead to change in + // solution, validation errors, or infeasibility. + // + // NOTE: The caller must ensure that each + // [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + // [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + // identifies a vehicle (resp. shipment) entity used across the two relevant + // requests: the past request that produced the `OptimizeToursResponse` used + // in the injected solution and the current request that includes the injected + // solution. The uniqueness checks described above are not enough to guarantee + // this requirement. + bool interpret_injected_solutions_using_labels = 10; + + // Consider traffic estimation in calculating `ShipmentRoute` fields + // [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + // [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + // and `vehicle_end_time`; in setting the + // [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + // field, and in calculating the + // [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + // field. + bool consider_road_traffic = 11; + + // If true, polylines will be populated in response `ShipmentRoute`s. + bool populate_polylines = 12; + + // If true, polylines will be populated in response + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + bool populate_transition_polylines = 13; + + // If this is set, then the request can have a deadline + // (see https://grpc.io/blog/deadlines) of up to 60 minutes. + // Otherwise, the maximum deadline is only 30 minutes. + // Note that long-lived requests have a significantly larger (but still small) + // risk of interruption. + bool allow_large_deadline_despite_interruption_risk = 14; + + // If true, travel distances will be computed using geodesic distances instead + // of Google Maps distances, and travel times will be computed using geodesic + // distances with a speed defined by `geodesic_meters_per_second`. + bool use_geodesic_distances = 15; + + // When `use_geodesic_distances` is true, this field must be set and defines + // the speed applied to compute travel times. Its value must be at least 1.0 + // meters/seconds. + optional double geodesic_meters_per_second = 16; + + // Truncates the number of validation errors returned. These errors are + // typically attached to an INVALID_ARGUMENT error payload as a BadRequest + // error detail (https://cloud.google.com/apis/design/errors#error_details), + // unless solving_mode=VALIDATE_ONLY: see the + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // field. + // This defaults to 100 and is capped at 10,000. + optional int32 max_validation_errors = 5; + + // Label that may be used to identify this request, reported back in the + // [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + string label = 17; +} + +// Response after solving a tour optimization problem containing the routes +// followed by each vehicle, the shipments which have been skipped and the +// overall cost of the solution. +message OptimizeToursResponse { + // Overall metrics, aggregated over all routes. + message Metrics { + // Aggregated over the routes. Each metric is the sum (or max, for loads) + // over all + // [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + // fields of the same name. + AggregatedMetrics aggregated_route_metrics = 1; + + // Number of mandatory shipments skipped. + int32 skipped_mandatory_shipment_count = 2; + + // Number of vehicles used. Note: if a vehicle route is empty and + // [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + // is true, the vehicle is considered used. + int32 used_vehicle_count = 3; + + // The earliest start time for a used vehicle, computed as the minimum over + // all used vehicles of + // [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + google.protobuf.Timestamp earliest_vehicle_start_time = 4; + + // The latest end time for a used vehicle, computed as the maximum over all + // used vehicles of + // [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + google.protobuf.Timestamp latest_vehicle_end_time = 5; + + // Cost of the solution, broken down by cost-related request fields. + // The keys are proto paths, relative to the input OptimizeToursRequest, + // e.g. "model.shipments.pickups.cost", and the values are the total cost + // generated by the corresponding cost field, aggregated over the whole + // solution. In other words, costs["model.shipments.pickups.cost"] is the + // sum of all pickup costs over the solution. All costs defined in the model + // are reported in detail here with the exception of costs related to + // TransitionAttributes that are only reported in an aggregated way as of + // 2022/01. + map costs = 10; + + // Total cost of the solution. The sum of all values in the costs map. + double total_cost = 6; + } + + // Routes computed for each vehicle; the i-th route corresponds to the i-th + // vehicle in the model. + repeated ShipmentRoute routes = 1; + + // Copy of the + // [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + // if a label was specified in the request. + string request_label = 3; + + // The list of all shipments skipped. + repeated SkippedShipment skipped_shipments = 4; + + // List of all the validation errors that we were able to detect + // independently. See the "MULTIPLE ERRORS" explanation for the + // [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + // message. + repeated OptimizeToursValidationError validation_errors = 5; + + // Duration, distance and usage metrics for this solution. + Metrics metrics = 6; +} + +// 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 +message ShipmentModel { + // Specifies a duration and distance matrix from visit and vehicle start + // locations to visit and vehicle end locations. + message DurationDistanceMatrix { + // Specifies a row of the duration and distance matrix. + message Row { + // 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; + + // 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; + } + + // 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 Row rows = 1; + + // 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; + } + + // 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. + message PrecedenceRule { + // Shipment index of the "first" event. This field must be specified. + optional int32 first_index = 1; + + // Indicates if the "first" event is a delivery. + bool first_is_delivery = 3; + + // Shipment index of the "second" event. This field must be specified. + optional int32 second_index = 2; + + // Indicates if the "second" event is a delivery. + bool second_is_delivery = 4; + + // The offset between the "first" and "second" event. It can be negative. + google.protobuf.Duration offset_duration = 5; + } + + // Set of shipments which must be performed in the model. + repeated Shipment shipments = 1; + + // Set of vehicles which can be used to perform visits. + repeated Vehicle vehicles = 2; + + // 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; + + // 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; + + // 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; + + // 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; + + // 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 DurationDistanceMatrix duration_distance_matrices = 8; + + // 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; + + // 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; + + // Transition attributes added to the model. + repeated TransitionAttributes transition_attributes = 11; + + // Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + repeated ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + + // Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + repeated ShipmentTypeRequirement shipment_type_requirements = 13; + + // Set of precedence rules which must be enforced in the model. + repeated PrecedenceRule precedence_rules = 14; +} + +// The shipment of a single item, from one of its pickups to one of its +// deliveries. For the shipment to be considered as performed, a unique vehicle +// must visit one of its pickup locations (and decrease its spare capacities +// accordingly), then visit one of its delivery locations later on (and +// therefore re-increase its spare capacities accordingly). +message Shipment { + // Request for a visit which can be done by a vehicle: it has a geo-location + // (or two, see below), opening and closing times represented by time windows, + // and a service duration time (time spent by the vehicle once it has arrived + // to pickup or drop off goods). + message VisitRequest { + // The geo-location where the vehicle arrives when performing this + // `VisitRequest`. If the shipment model has duration distance matrices, + // `arrival_location` must not be specified. + google.type.LatLng arrival_location = 1; + + // The waypoint where the vehicle arrives when performing this + // `VisitRequest`. If the shipment model has duration distance matrices, + // `arrival_waypoint` must not be specified. + Waypoint arrival_waypoint = 2; + + // The geo-location where the vehicle departs after completing this + // `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + // If the shipment model has duration distance matrices, + // `departure_location` must not be specified. + google.type.LatLng departure_location = 3; + + // The waypoint where the vehicle departs after completing this + // `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + // If the shipment model has duration distance matrices, + // `departure_waypoint` must not be specified. + Waypoint departure_waypoint = 4; + + // Specifies tags attached to the visit request. + // Empty or duplicate strings are not allowed. + repeated string tags = 5; + + // Time windows which constrain the arrival time at a visit. + // Note that a vehicle may depart outside of the arrival time window, i.e. + // arrival time + duration do not need to be inside a time window. This can + // result in waiting time if the vehicle arrives before + // [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + // + // The absence of `TimeWindow` means that the vehicle can perform this visit + // at any time. + // + // Time windows must be disjoint, i.e. no time window must overlap with or + // be adjacent to another, and they must be in increasing order. + // + // `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + // be set if there is a single time window. + repeated TimeWindow time_windows = 6; + + // Duration of the visit, i.e. time spent by the vehicle between arrival + // and departure (to be added to the possible waiting time; see + // `time_windows`). + google.protobuf.Duration duration = 7; + + // Cost to service this visit request on a vehicle route. This can be used + // to pay different costs for each alternative pickup or delivery of a + // shipment. This cost must be in the same unit as `Shipment.penalty_cost` + // and must not be negative. + double cost = 8; + + // Load demands of this visit request. This is just like + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + // field, except that it only applies to this + // [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + // instead of the whole + // [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + // here are added to the demands listed in + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + map load_demands = 12; + + // Specifies the types of the visit. This may be used to allocate additional + // time required for a vehicle to complete this visit (see + // [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + // + // A type can only appear once. + repeated string visit_types = 10; + + // Specifies a label for this `VisitRequest`. This label is reported in the + // response as `visit_label` in the corresponding + // [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + string label = 11; + } + + // When performing a visit, a predefined amount may be added to the vehicle + // load if it's a pickup, or subtracted if it's a delivery. This message + // defines such amount. See + // [load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + message Load { + // The amount by which the load of the vehicle performing the corresponding + // visit will vary. Since it is an integer, users are advised to choose an + // appropriate unit to avoid loss of precision. Must be ≥ 0. + int64 amount = 2; + } + + // The user-defined display name of the shipment. + // It can be up to 63 characters long and may use UTF-8 characters. + string display_name = 16; + + // Set of pickup alternatives associated to the shipment. If not specified, + // the vehicle only needs to visit a location corresponding to the deliveries. + repeated VisitRequest pickups = 1; + + // Set of delivery alternatives associated to the shipment. If not specified, + // the vehicle only needs to visit a location corresponding to the pickups. + repeated VisitRequest deliveries = 2; + + // Load demands of the shipment (for example weight, volume, number of + // pallets etc). The keys in the map should be identifiers describing the type + // of the corresponding load, ideally also including the units. + // For example: "weight_kg", "volume_gallons", "pallet_count", etc. + // If a given key does not appear in the map, the corresponding load is + // considered as null. + map load_demands = 14; + + // If the shipment is not completed, this penalty is added to the overall + // cost of the routes. A shipment is considered completed if one of its pickup + // and delivery alternatives is visited. The cost may be expressed in the + // same unit used for all other cost-related fields in the model and must be + // positive. + // + // *IMPORTANT*: If this penalty is not specified, it is considered infinite, + // i.e. the shipment must be completed. + optional double penalty_cost = 4; + + // The set of vehicles that may perform this shipment. If empty, all vehicles + // may perform it. Vehicles are given by their index in the `ShipmentModel`'s + // `vehicles` list. + repeated int32 allowed_vehicle_indices = 5; + + // Specifies the cost that is incurred when this shipment is delivered by each + // vehicle. If specified, it must have EITHER: + // + // * the same number of elements as `costs_per_vehicle_indices`. + // `costs_per_vehicle[i]` corresponds to vehicle + // `costs_per_vehicle_indices[i]` of the model. + // * the same number of elements as there are vehicles in the model. The + // i-th element corresponds to vehicle #i of the model. + // + // These costs must be in the same unit as `penalty_cost` and must not be + // negative. Leave this field empty, if there are no such costs. + repeated double costs_per_vehicle = 6; + + // Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + // it must have the same number of elements as `costs_per_vehicle`. A vehicle + // index may not be specified more than once. If a vehicle is excluded from + // `costs_per_vehicle_indices`, its cost is zero. + repeated int32 costs_per_vehicle_indices = 7; + + // Specifies the maximum relative detour time compared to the shortest path + // from pickup to delivery. If specified, it must be nonnegative, and the + // shipment must contain at least a pickup and a delivery. + // + // For example, let t be the shortest time taken to go from the selected + // pickup alternative directly to the selected delivery alternative. Then + // setting `pickup_to_delivery_relative_detour_limit` enforces: + // + // ``` + // start_time(delivery) - start_time(pickup) <= + // std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + // ``` + // + // If both relative and absolute limits are specified on the same shipment, + // the more constraining limit is used for each possible pickup/delivery pair. + // As of 2017/10, detours are only supported when travel durations do not + // depend on vehicles. + optional double pickup_to_delivery_relative_detour_limit = 8; + + // Specifies the maximum absolute detour time compared to the shortest path + // from pickup to delivery. If specified, it must be nonnegative, and the + // shipment must contain at least a pickup and a delivery. + // + // For example, let t be the shortest time taken to go from the selected + // pickup alternative directly to the selected delivery alternative. Then + // setting `pickup_to_delivery_absolute_detour_limit` enforces: + // + // ``` + // start_time(delivery) - start_time(pickup) <= + // t + pickup_to_delivery_absolute_detour_limit + // ``` + // + // If both relative and absolute limits are specified on the same shipment, + // the more constraining limit is used for each possible pickup/delivery pair. + // As of 2017/10, detours are only supported when travel durations do not + // depend on vehicles. + google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + + // Specifies the maximum duration from start of pickup to start of delivery of + // a shipment. If specified, it must be nonnegative, and the shipment must + // contain at least a pickup and a delivery. This does not depend on which + // alternatives are selected for pickup and delivery, nor on vehicle speed. + // This can be specified alongside maximum detour constraints: the solution + // will respect both specifications. + google.protobuf.Duration pickup_to_delivery_time_limit = 10; + + // Non-empty string specifying a "type" for this shipment. + // This feature can be used to define incompatibilities or requirements + // between `shipment_types` (see `shipment_type_incompatibilities` and + // `shipment_type_requirements` in `ShipmentModel`). + // + // Differs from `visit_types` which is specified for a single visit: All + // pickup/deliveries belonging to the same shipment share the same + // `shipment_type`. + string shipment_type = 11; + + // Specifies a label for this shipment. This label is reported in the response + // in the `shipment_label` of the corresponding + // [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + string label = 12; + + // If true, skip this shipment, but don't apply a `penalty_cost`. + // + // Ignoring a shipment results in a validation error when there are any + // `shipment_type_requirements` in the model. + // + // Ignoring a shipment that is performed in `injected_first_solution_routes` + // or `injected_solution_constraint` is permitted; the solver removes the + // related pickup/delivery visits from the performing route. + // `precedence_rules` that reference ignored shipments will also be ignored. + bool ignore = 13; +} + +// Specifies incompatibilties between shipments depending on their +// shipment_type. The appearance of incompatible shipments on the same route is +// restricted based on the incompatibility mode. +message ShipmentTypeIncompatibility { + // Modes defining how the appearance of incompatible shipments are restricted + // on the same route. + enum IncompatibilityMode { + // Unspecified incompatibility mode. This value should never be used. + INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + + // In this mode, two shipments with incompatible types can never share the + // same vehicle. + NOT_PERFORMED_BY_SAME_VEHICLE = 1; + + // For two shipments with incompatible types with the + // `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode: + // + // * If both are pickups only (no deliveries) or deliveries only (no + // pickups), they cannot share the same vehicle at all. + // * If one of the shipments has a delivery and the other a pickup, the two + // shipments can share the same vehicle iff the former shipment is + // delivered before the latter is picked up. + NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + } + + // List of incompatible types. Two shipments having different `shipment_types` + // among those listed are "incompatible". + repeated string types = 1; + + // Mode applied to the incompatibility. + IncompatibilityMode incompatibility_mode = 2; +} + +// Specifies requirements between shipments based on their shipment_type. +// The specifics of the requirement are defined by the requirement mode. +message ShipmentTypeRequirement { + // Modes defining the appearance of dependent shipments on a route. + enum RequirementMode { + // Unspecified requirement mode. This value should never be used. + REQUIREMENT_MODE_UNSPECIFIED = 0; + + // In this mode, all "dependent" shipments must share the same vehicle as at + // least one of their "required" shipments. + PERFORMED_BY_SAME_VEHICLE = 1; + + // With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent" + // shipments need to have at least one "required" shipment on their vehicle + // at the time of their pickup. + // + // A "dependent" shipment pickup must therefore have either: + // + // * A delivery-only "required" shipment delivered on the route after, or + // * A "required" shipment picked up on the route before it, and if the + // "required" shipment has a delivery, this delivery must be performed + // after the "dependent" shipment's pickup. + IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + + // Same as before, except the "dependent" shipments need to have a + // "required" shipment on their vehicle at the time of their *delivery*. + IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + } + + // List of alternative shipment types required by the + // `dependent_shipment_types`. + repeated string required_shipment_type_alternatives = 1; + + // All shipments with a type in the `dependent_shipment_types` field require + // at least one shipment of type `required_shipment_type_alternatives` to be + // visited on the same route. + // + // NOTE: Chains of requirements such that a `shipment_type` depends on itself + // are not allowed. + repeated string dependent_shipment_types = 2; + + // Mode applied to the requirement. + RequirementMode requirement_mode = 3; +} + +// Models a vehicle in a shipment problem. Solving a shipment problem will +// build a route starting from `start_location` and ending at `end_location` +// for this vehicle. A route is a sequence of visits (see `ShipmentRoute`). +message Vehicle { + // Travel modes which can be used by vehicles. + // + // These should be a subset of the Google Maps Platform Routes Preferred API + // travel modes, see: + // https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode. + enum TravelMode { + // Unspecified travel mode, equivalent to `DRIVING`. + TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel mode corresponding to driving directions (car, ...). + DRIVING = 1; + + // Travel mode corresponding to walking directions. + WALKING = 2; + } + + // Policy on how a vehicle can be unloaded. Applies only to shipments having + // both a pickup and a delivery. + // + // Other shipments are free to occur anywhere on the route independent of + // `unloading_policy`. + enum UnloadingPolicy { + // Unspecified unloading policy; deliveries must just occur after their + // corresponding pickups. + UNLOADING_POLICY_UNSPECIFIED = 0; + + // Deliveries must occur in reverse order of pickups + LAST_IN_FIRST_OUT = 1; + + // Deliveries must occur in the same order as pickups + FIRST_IN_FIRST_OUT = 2; + } + + // Defines a load limit applying to a vehicle, e.g. "this truck may only + // carry up to 3500 kg". See + // [load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits]. + message LoadLimit { + // Interval of acceptable load amounts. + message Interval { + // A minimum acceptable load. Must be ≥ 0. + // If they're both specified, + // [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + // must be ≤ + // [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + int64 min = 1; + + // A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + // load is unrestricted by this message. + // If they're both specified, + // [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + // must be ≤ + // [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + optional int64 max = 2; + } + + // The maximum acceptable amount of load. + optional int64 max_load = 1; + + // A soft limit of the load. See + // [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + int64 soft_max_load = 2; + + // If the load ever exceeds + // [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + // along this vehicle's route, the following cost penalty applies (only once + // per vehicle): (load - + // [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + // * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + // add up and must be in the same unit as + // [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + double cost_per_unit_above_soft_max = 3; + + // The acceptable load interval of the vehicle at the start of the route. + Interval start_load_interval = 4; + + // The acceptable load interval of the vehicle at the end of the route. + Interval end_load_interval = 5; + } + + // A limit defining a maximum duration of the route of a vehicle. It can be + // either hard or soft. + // + // When a soft limit field is defined, both the soft max threshold and its + // associated cost must be defined together. + message DurationLimit { + // A hard limit constraining the duration to be at most max_duration. + google.protobuf.Duration max_duration = 1; + + // A soft limit not enforcing a maximum duration limit, but when violated + // makes the route incur a cost. This cost adds up to other costs defined in + // the model, with the same unit. + // + // If defined, `soft_max_duration` must be nonnegative. If max_duration is + // also defined, `soft_max_duration` must be less than max_duration. + google.protobuf.Duration soft_max_duration = 2; + + // Cost per hour incurred if the `soft_max_duration` threshold is violated. + // The additional cost is 0 if the duration is under the threshold, + // otherwise the cost depends on the duration as follows: + // ``` + // cost_per_hour_after_soft_max * (duration - soft_max_duration) + // ``` + // The cost must be nonnegative. + optional double cost_per_hour_after_soft_max = 3; + + // A soft limit not enforcing a maximum duration limit, but when violated + // makes the route incur a cost, quadratic in the duration. This cost adds + // up to other costs defined in the model, with the same unit. + // + // If defined, `quadratic_soft_max_duration` must be nonnegative. If + // `max_duration` is also defined, `quadratic_soft_max_duration` must be + // less than `max_duration`, and the difference must be no larger than one + // day: + // + // `max_duration - quadratic_soft_max_duration <= 86400 seconds` + google.protobuf.Duration quadratic_soft_max_duration = 4; + + // Cost per square hour incurred if the + // `quadratic_soft_max_duration` threshold is violated. + // + // The additional cost is 0 if the duration is under the threshold, + // otherwise the cost depends on the duration as follows: + // + // ``` + // cost_per_square_hour_after_quadratic_soft_max * + // (duration - quadratic_soft_max_duration)^2 + // ``` + // + // The cost must be nonnegative. + optional double cost_per_square_hour_after_quadratic_soft_max = 5; + } + + // The user-defined display name of the vehicle. + // It can be up to 63 characters long and may use UTF-8 characters. + string display_name = 32; + + // The travel mode which affects the roads usable by the vehicle and its + // speed. See also `travel_duration_multiple`. + TravelMode travel_mode = 1; + + // Geographic location where the vehicle starts before picking up any + // shipments. If not specified, the vehicle starts at its first pickup. + // If the shipment model has duration and distance matrices, `start_location` + // must not be specified. + google.type.LatLng start_location = 3; + + // Waypoint representing a geographic location where the vehicle starts before + // picking up any shipments. If neither `start_waypoint` nor `start_location` + // is specified, the vehicle starts at its first pickup. + // If the shipment model has duration and distance matrices, `start_waypoint` + // must not be specified. + Waypoint start_waypoint = 4; + + // Geographic location where the vehicle ends after it has completed its last + // `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + // immediately when it completes its last `VisitRequest`. + // If the shipment model has duration and distance matrices, `end_location` + // must not be specified. + google.type.LatLng end_location = 5; + + // Waypoint representing a geographic location where the vehicle ends after + // it has completed its last `VisitRequest`. If neither `end_waypoint` nor + // `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + // when it completes its last `VisitRequest`. + // If the shipment model has duration and distance matrices, `end_waypoint` + // must not be specified. + Waypoint end_waypoint = 6; + + // Specifies tags attached to the start of the vehicle's route. + // + // Empty or duplicate strings are not allowed. + repeated string start_tags = 7; + + // Specifies tags attached to the end of the vehicle's route. + // + // Empty or duplicate strings are not allowed. + repeated string end_tags = 8; + + // Time windows during which the vehicle may depart its start location. + // They must be within the global time limits (see + // [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + // fields). If unspecified, there is no limitation besides those global time + // limits. + // + // Time windows belonging to the same repeated field must be disjoint, i.e. no + // time window can overlap with or be adjacent to another, and they must be in + // chronological order. + // + // `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + // there is a single time window. + repeated TimeWindow start_time_windows = 9; + + // Time windows during which the vehicle may arrive at its end location. + // They must be within the global time limits (see + // [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + // fields). If unspecified, there is no limitation besides those global time + // limits. + // + // Time windows belonging to the same repeated field must be disjoint, i.e. no + // time window can overlap with or be adjacent to another, and they must be in + // chronological order. + // + // `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + // there is a single time window. + repeated TimeWindow end_time_windows = 10; + + // Specifies a multiplicative factor that can be used to increase or decrease + // travel times of this vehicle. For example, setting this to 2.0 means + // that this vehicle is slower and has travel times that are twice what they + // are for standard vehicles. This multiple does not affect visit durations. + // It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + // specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + // is standard, and this multiple is considered 1.0. + // + // WARNING: Travel times will be rounded to the nearest second after this + // multiple is applied but before performing any numerical operations, thus, + // a small multiple may result in a loss of precision. + // + // See also `extra_visit_duration_for_visit_type` below. + optional double travel_duration_multiple = 11; + + // Unloading policy enforced on the vehicle. + UnloadingPolicy unloading_policy = 12; + + // Capacities of the vehicle (weight, volume, # of pallets for example). + // The keys in the map are the identifiers of the type of load, consistent + // with the keys of the + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + // field. If a given key is absent from this map, the corresponding capacity + // is considered to be limitless. + map load_limits = 30; + + // Vehicle costs: all costs add up and must be in the same unit as + // [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + // + // Cost per hour of the vehicle route. This cost is applied to the total time + // taken by the route, and includes travel time, waiting time, and visit time. + // Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + // in additional latency. + double cost_per_hour = 16; + + // Cost per traveled hour of the vehicle route. This cost is applied only to + // travel time taken by the route (i.e., that reported in + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + // and excludes waiting time and visit time. + double cost_per_traveled_hour = 17; + + // Cost per kilometer of the vehicle route. This cost is applied to the + // distance reported in the + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + // and does not apply to any distance implicitly traveled from the + // `arrival_location` to the `departure_location` of a single `VisitRequest`. + double cost_per_kilometer = 18; + + // Fixed cost applied if this vehicle is used to handle a shipment. + double fixed_cost = 19; + + // This field only applies to vehicles when their route does not serve any + // shipments. It indicates if the vehicle should be considered as used or not + // in this case. + // + // If true, the vehicle goes from its start to its end location even if it + // doesn't serve any shipments, and time and distance costs resulting from its + // start --> end travel are taken into account. + // + // Otherwise, it doesn't travel from its start to its end location, and no + // `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + // vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + // information except for the vehicle index and label. + bool used_if_route_is_empty = 20; + + // Limit applied to the total duration of the vehicle's route. In a given + // `OptimizeToursResponse`, the route duration of a vehicle is the + // difference between its `vehicle_end_time` and `vehicle_start_time`. + DurationLimit route_duration_limit = 21; + + // Limit applied to the travel duration of the vehicle's route. In a given + // `OptimizeToursResponse`, the route travel duration is the sum of all its + // [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + DurationLimit travel_duration_limit = 22; + + // Limit applied to the total distance of the vehicle's route. In a given + // `OptimizeToursResponse`, the route distance is the sum of all its + // [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + DistanceLimit route_distance_limit = 23; + + // Specifies a map from visit_types strings to durations. The duration is time + // in addition to + // [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + // to be taken at visits with the specified `visit_types`. This extra visit + // duration adds cost if `cost_per_hour` is specified. Keys (i.e. + // `visit_types`) cannot be empty strings. + // + // If a visit request has multiple types, a duration will be added for each + // type in the map. + map extra_visit_duration_for_visit_type = + 24; + + // Describes the break schedule to be enforced on this vehicle. + // If empty, no breaks will be scheduled for this vehicle. + BreakRule break_rule = 25; + + // Specifies a label for this vehicle. This label is reported in the response + // as the `vehicle_label` of the corresponding + // [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + string label = 27; + + // If true, `used_if_route_is_empty` must be false, and this vehicle will + // remain unused. + // + // If a shipment is performed by an ignored vehicle in + // `injected_first_solution_routes`, it is skipped in the first solution but + // is free to be performed in the response. + // + // If a shipment is performed by an ignored vehicle in + // `injected_solution_constraint` and any related pickup/delivery is + // constrained to remain on the vehicle (i.e., not relaxed to level + // `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + // If a shipment has a non-empty `allowed_vehicle_indices` field and all of + // the allowed vehicles are ignored, it is skipped in the response. + bool ignore = 28; +} + +// Time windows constrain the time of an event, such as the arrival time at a +// visit, or the start and end time of a vehicle. +// +// Hard time window bounds, `start_time` and `end_time`, enforce the earliest +// and latest time of the event, such that `start_time <= event_time <= +// end_time`. The soft time window lower bound, `soft_start_time`, expresses a +// preference for the event to happen at or after `soft_start_time` by incurring +// a cost proportional to how long before soft_start_time the event occurs. The +// soft time window upper bound, `soft_end_time`, expresses a preference for the +// event to happen at or before `soft_end_time` by incurring a cost proportional +// to how long after `soft_end_time` the event occurs. `start_time`, `end_time`, +// `soft_start_time` and `soft_end_time` should be within the global time limits +// (see +// [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] +// and +// [ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time]) +// and should respect: +// ``` +// 0 <= `start_time` <= `soft_start_time` <= `end_time` and +// 0 <= `start_time` <= `soft_end_time` <= `end_time`. +// ``` +message TimeWindow { + // The hard time window start time. If unspecified it will be set to + // `ShipmentModel.global_start_time`. + google.protobuf.Timestamp start_time = 1; + + // The hard time window end time. If unspecified it will be set to + // `ShipmentModel.global_end_time`. + google.protobuf.Timestamp end_time = 2; + + // The soft start time of the time window. + google.protobuf.Timestamp soft_start_time = 3; + + // The soft end time of the time window. + google.protobuf.Timestamp soft_end_time = 4; + + // A cost per hour added to other costs in the model if the event occurs + // before soft_start_time, computed as: + // + // ``` + // max(0, soft_start_time - t.seconds) + // * cost_per_hour_before_soft_start_time / 3600, + // t being the time of the event. + // ``` + // + // This cost must be positive, and the field can only be set if + // soft_start_time has been set. + optional double cost_per_hour_before_soft_start_time = 5; + + // A cost per hour added to other costs in the model if the event occurs after + // `soft_end_time`, computed as: + // + // ``` + // max(0, t.seconds - soft_end_time.seconds) + // * cost_per_hour_after_soft_end_time / 3600, + // t being the time of the event. + // ``` + // + // This cost must be positive, and the field can only be set if + // `soft_end_time` has been set. + optional double cost_per_hour_after_soft_end_time = 6; +} + +// A limit defining a maximum distance which can be traveled. It can be either +// hard or soft. +// +// If a soft limit is defined, both `soft_max_meters` and +// `cost_per_kilometer_above_soft_max` must be defined and be nonnegative. +message DistanceLimit { + // A hard limit constraining the distance to be at most max_meters. The limit + // must be nonnegative. + optional int64 max_meters = 1; + + // A soft limit not enforcing a maximum distance limit, but when violated + // results in a cost which adds up to other costs defined in the model, + // with the same unit. + // + // If defined soft_max_meters must be less than max_meters and must be + // nonnegative. + optional int64 soft_max_meters = 2; + + // Cost per kilometer incurred if distance is above `soft_max_meters` limit. + // The additional cost is 0 if the distance is under the limit, otherwise the + // formula used to compute the cost is the following: + // ``` + // (distance_meters - soft_max_meters) / 1000.0 * + // cost_per_kilometer_above_soft_max. + // ``` + // The cost must be nonnegative. + optional double cost_per_kilometer_above_soft_max = 3; +} + +// Specifies attributes of transitions between two consecutive visits on a +// route. Several `TransitionAttributes` may apply to the same transition: in +// that case, all extra costs add up and the strictest constraint or limit +// applies (following natural "AND" semantics). +message TransitionAttributes { + // Tags defining the set of (src->dst) transitions these attributes apply to. + // + // A source visit or vehicle start matches iff its + // [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + // or + // [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + // either contains `src_tag` or does not contain `excluded_src_tag` (depending + // on which of these two fields is non-empty). + string src_tag = 1; + + // See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + // non-empty. + string excluded_src_tag = 2; + + // A destination visit or vehicle end matches iff its + // [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + // or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + // either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + // on which of these two fields is non-empty). + string dst_tag = 3; + + // See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + // non-empty. + string excluded_dst_tag = 4; + + // Specifies a cost for performing this transition. This is in the same unit + // as all other costs in the model and must not be negative. It is applied on + // top of all other existing costs. + double cost = 5; + + // Specifies a cost per kilometer applied to the distance traveled while + // performing this transition. It adds up to any + // [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + // specified on vehicles. + double cost_per_kilometer = 6; + + // Specifies a limit on the distance traveled while performing this + // transition. + // + // As of 2021/06, only soft limits are supported. + DistanceLimit distance_limit = 7; + + // Specifies a delay incurred when performing this transition. + // + // This delay always occurs *after* finishing the source visit and *before* + // starting the destination visit. + google.protobuf.Duration delay = 8; +} + +// Encapsulates a waypoint. Waypoints mark arrival and departure locations of +// VisitRequests, and start and end locations of Vehicles. +message Waypoint { + // Different ways to represent a location. + oneof location_type { + // A point specified using geographic coordinates, including an optional + // heading. + Location location = 1; + + // The POI Place ID associated with the waypoint. + string place_id = 2; + } + + // Optional. Indicates that the location of this waypoint is meant to have a + // preference for the vehicle to stop at a particular side of road. When you + // set this value, the route will pass through the location so that the + // vehicle can stop at the side of road that the location is biased towards + // from the center of the road. This option doesn't work for the 'WALKING' + // travel mode. + bool side_of_road = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Encapsulates a location (a geographic point, and an optional heading). +message Location { + // The waypoint's geographic coordinates. + google.type.LatLng lat_lng = 1; + + // The compass heading associated with the direction of the flow of traffic. + // This value is used to specify the side of the road to use for pickup and + // drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + // of due North, 90 specifies a heading of due East, etc. + optional int32 heading = 2; +} + +// Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break +// is a contiguous period of time during which the vehicle remains idle at its +// current position and cannot perform any visit. A break may occur: +// +// * during the travel between two visits (which includes the time right +// before or right after a visit, but not in the middle of a visit), in +// which case it extends the corresponding transit time between the visits, +// * or before the vehicle start (the vehicle may not start in the middle of +// a break), in which case it does not affect the vehicle start time. +// * or after the vehicle end (ditto, with the vehicle end time). +message BreakRule { + // The sequence of breaks (i.e. their number and order) that apply to each + // vehicle must be known beforehand. The repeated `BreakRequest`s define + // that sequence, in the order in which they must occur. Their time windows + // (`earliest_start_time` / `latest_start_time`) may overlap, but they must + // be compatible with the order (this is checked). + message BreakRequest { + // Required. Lower bound (inclusive) on the start of the break. + google.protobuf.Timestamp earliest_start_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Upper bound (inclusive) on the start of the break. + google.protobuf.Timestamp latest_start_time = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Minimum duration of the break. Must be positive. + google.protobuf.Duration min_duration = 3 + [(google.api.field_behavior) = REQUIRED]; + } + + // One may further constrain the frequency and duration of the breaks + // specified above, by enforcing a minimum break frequency, such as + // "There must be a break of at least 1 hour every 12 hours". Assuming that + // this can be interpreted as "Within any sliding time window of 12h, there + // must be at least one break of at least one hour", that example would + // translate to the following `FrequencyConstraint`: + // ``` + // { + // min_break_duration { seconds: 3600 } # 1 hour. + // max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11). + // } + // ``` + // + // The timing and duration of the breaks in the solution will respect all + // such constraints, in addition to the time windows and minimum durations + // already specified in the `BreakRequest`. + // + // A `FrequencyConstraint` may in practice apply to non-consecutive breaks. + // For example, the following schedule honors the "1h every 12h" example: + // ``` + // 04:00 vehicle start + // .. performing travel and visits .. + // 09:00 1 hour break + // 10:00 end of the break + // .. performing travel and visits .. + // 12:00 20-min lunch break + // 12:20 end of the break + // .. performing travel and visits .. + // 21:00 1 hour break + // 22:00 end of the break + // .. performing travel and visits .. + // 23:59 vehicle end + // ``` + message FrequencyConstraint { + // Required. Minimum break duration for this constraint. Nonnegative. + // See description of `FrequencyConstraint`. + google.protobuf.Duration min_break_duration = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Maximum allowed span of any interval of time in the route that + // does not include at least partially a break of `duration >= + // min_break_duration`. Must be positive. + google.protobuf.Duration max_inter_break_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Sequence of breaks. See the `BreakRequest` message. + repeated BreakRequest break_requests = 1; + + // Several `FrequencyConstraint` may apply. They must all be satisfied by + // the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + repeated FrequencyConstraint frequency_constraints = 2; +} + +// A vehicle's route can be decomposed, along the time axis, like this (we +// assume there are n visits): +// ``` +// | | | | | T[2], | | | +// | Transition | Visit #0 | | | V[2], | | | +// | #0 | aka | T[1] | V[1] | ... | V[n-1] | T[n] | +// | aka T[0] | V[0] | | | V[n-2],| | | +// | | | | | T[n-1] | | | +// ^ ^ ^ ^ ^ ^ ^ ^ +// vehicle V[0].start V[0].end V[1]. V[1]. V[n]. V[n]. vehicle +// start (arrival) (departure) start end start end end +// ``` +// Note that we make a difference between: +// +// * "punctual events", such as the vehicle start and end and each visit's start +// and end (aka arrival and departure). They happen at a given second. +// * "time intervals", such as the visits themselves, and the transition between +// visits. Though time intervals can sometimes have zero duration, i.e. start +// and end at the same second, they often have a positive duration. +// +// Invariants: +// +// * If there are n visits, there are n+1 transitions. +// * A visit is always surrounded by a transition before it (same index) and a +// transition after it (index + 1). +// * The vehicle start is always followed by transition #0. +// * The vehicle end is always preceded by transition #n. +// +// Zooming in, here is what happens during a `Transition` and a `Visit`: +// ``` +// ---+-------------------------------------+-----------------------------+--> +// | TRANSITION[i] | VISIT[i] | +// | | | +// | * TRAVEL: the vehicle moves from | PERFORM the visit: | +// | VISIT[i-1].departure_location to | | +// | VISIT[i].arrival_location, which | * Spend some time: | +// | takes a given travel duration | the "visit duration". | +// | and distance | | +// | | * Load or unload | +// | * BREAKS: the driver may have | some quantities from the | +// | breaks (e.g. lunch break). | vehicle: the "demand". | +// | | | +// | * WAIT: the driver/vehicle does | | +// | nothing. This can happen for | | +// | many reasons, for example when | | +// | the vehicle reaches the next | | +// | event's destination before the | | +// | start of its time window | | +// | | | +// | * DELAY: *right before* the next | | +// | arrival. E.g. the vehicle and/or | | +// | driver spends time unloading. | | +// | | | +// ---+-------------------------------------+-----------------------------+--> +// ^ ^ ^ +// V[i-1].end V[i].start V[i].end +// ``` +// Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged +// during a transition. +// +// * They don't overlap. +// * The DELAY is unique and *must* be a contiguous period of time right +// before the next visit (or vehicle end). Thus, it suffice to know the +// delay duration to know its start and end time. +// * The BREAKS are contiguous, non-overlapping periods of time. The +// response specifies the start time and duration of each break. +// * TRAVEL and WAIT are "preemptable": they can be interrupted several times +// during this transition. Clients can assume that travel happens "as soon as +// possible" and that "wait" fills the remaining time. +// +// A (complex) example: +// ``` +// TRANSITION[i] +// --++-----+-----------------------------------------------------------++--> +// || | | | | | | || +// || T | B | T | | B | | D || +// || r | r | r | W | r | W | e || +// || a | e | a | a | e | a | l || +// || v | a | v | i | a | i | a || +// || e | k | e | t | k | t | y || +// || l | | l | | | | || +// || | | | | | | || +// --++-----------------------------------------------------------------++--> +// ``` +message ShipmentRoute { + // A visit performed during a route. This visit corresponds to a pickup or a + // delivery of a `Shipment`. + message Visit { + // Index of the `shipments` field in the source + // [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + int32 shipment_index = 1; + + // If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + // corresponds to a delivery. + bool is_pickup = 2; + + // Index of `VisitRequest` in either the pickup or delivery field of the + // `Shipment` (see `is_pickup`). + int32 visit_request_index = 3; + + // Time at which the visit starts. Note that the vehicle may arrive earlier + // than this at the visit location. Times are consistent with the + // `ShipmentModel`. + google.protobuf.Timestamp start_time = 4; + + // Total visit load demand as the sum of the shipment and the visit request + // `load_demands`. The values are negative if the visit is a delivery. + // Demands are reported for the same types as the + // [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + // (see this field). + map load_demands = 11; + + // Extra detour time due to the shipments visited on the route before the + // visit and to the potential waiting time induced by time windows. + // If the visit is a delivery, the detour is computed from the corresponding + // pickup visit and is equal to: + // ``` + // start_time(delivery) - start_time(pickup) + // - (duration(pickup) + travel duration from the pickup location + // to the delivery location). + // ``` + // Otherwise, it is computed from the vehicle `start_location` and is equal + // to: + // ``` + // start_time - vehicle_start_time - travel duration from + // the vehicle's `start_location` to the visit. + // ``` + google.protobuf.Duration detour = 6; + + // Copy of the corresponding `Shipment.label`, if specified in the + // `Shipment`. + string shipment_label = 7; + + // Copy of the corresponding + // [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + // if specified in the `VisitRequest`. + string visit_label = 8; + } + + // Transition between two events on the route. See the description of + // [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + // + // If the vehicle does not have a `start_location` and/or `end_location`, the + // corresponding travel metrics are 0. + message Transition { + // Travel duration during this transition. + google.protobuf.Duration travel_duration = 1; + + // Distance traveled during the transition. + double travel_distance_meters = 2; + + // When traffic is requested via + // [OptimizeToursRequest.consider_road_traffic] + // [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + // and the traffic info couldn't be retrieved for a `Transition`, this + // boolean is set to true. This may be temporary (rare hiccup in the + // realtime traffic servers) or permanent (no data for this location). + bool traffic_info_unavailable = 3; + + // Sum of the delay durations applied to this transition. If any, the delay + // starts exactly `delay_duration` seconds before the next event (visit or + // vehicle end). See + // [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + google.protobuf.Duration delay_duration = 4; + + // Sum of the duration of the breaks occurring during this transition, if + // any. Details about each break's start time and duration are stored in + // [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + google.protobuf.Duration break_duration = 5; + + // Time spent waiting during this transition. Wait duration corresponds to + // idle time and does not include break time. Also note that this wait time + // may be split into several non-contiguous intervals. + google.protobuf.Duration wait_duration = 6; + + // Total duration of the transition, provided for convenience. It is equal + // to: + // + // * next visit `start_time` (or `vehicle_end_time` if this is the last + // transition) - this transition's `start_time`; + // * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + // additionally holds: `total_duration = travel_duration + delay_duration + // + break_duration + wait_duration`. + google.protobuf.Duration total_duration = 7; + + // Start time of this transition. + google.protobuf.Timestamp start_time = 8; + + // The encoded polyline representation of the route followed during the + // transition. + // This field is only populated if [populate_transition_polylines] + // [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + // is set to true. + EncodedPolyline route_polyline = 9; + + // Vehicle loads during this transition, for each type that either appears + // in this vehicle's + // [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + // or that have non-zero + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + // on some shipment performed on this route. + // + // The loads during the first transition are the starting loads of the + // vehicle route. Then, after each visit, the visit's `load_demands` are + // either added or subtracted to get the next transition's loads, depending + // on whether the visit was a pickup or a delivery. + map vehicle_loads = 11; + } + + // Reports the actual load of the vehicle at some point along the route, + // for a given type (see + // [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]). + message VehicleLoad { + // The amount of load on the vehicle, for the given type. The unit of load + // is usually indicated by the type. See + // [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + int64 amount = 1; + } + + // The encoded representation of a polyline. More information on polyline + // encoding can be found here: + // https://developers.google.com/maps/documentation/utilities/polylinealgorithm + // https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding. + message EncodedPolyline { + // String representing encoded points of the polyline. + string points = 1; + } + + // Data representing the execution of a break. + message Break { + // Start time of a break. + google.protobuf.Timestamp start_time = 1; + + // Duration of a break. + google.protobuf.Duration duration = 2; + } + + // Vehicle performing the route, identified by its index in the source + // `ShipmentModel`. + int32 vehicle_index = 1; + + // Label of the vehicle performing this route, equal to + // `ShipmentModel.vehicles(vehicle_index).label`, if specified. + string vehicle_label = 2; + + // Time at which the vehicle starts its route. + google.protobuf.Timestamp vehicle_start_time = 5; + + // Time at which the vehicle finishes its route. + google.protobuf.Timestamp vehicle_end_time = 6; + + // Ordered sequence of visits representing a route. + // visits[i] is the i-th visit in the route. + // If this field is empty, the vehicle is considered as unused. + repeated Visit visits = 7; + + // Ordered list of transitions for the route. + repeated Transition transitions = 8; + + // When + // [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + // is set to true, this field indicates that inconsistencies in route timings + // are predicted using traffic-based travel duration estimates. There may be + // insufficient time to complete traffic-adjusted travel, delays, and breaks + // between visits, before the first visit, or after the last visit, while + // still satisfying the visit and vehicle time windows. For example, + // + // ``` + // start_time(previous_visit) + duration(previous_visit) + + // travel_duration(previous_visit, next_visit) > start_time(next_visit) + // ``` + // + // Arrival at next_visit will likely happen later than its current + // time window due the increased estimate of travel time + // `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + // may be forced to overlap with a visit due to an increase in travel time + // estimates and visit or break time window restrictions. + bool has_traffic_infeasibilities = 9; + + // The encoded polyline representation of the route. + // This field is only populated if + // [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + // is set to true. + EncodedPolyline route_polyline = 10; + + // Breaks scheduled for the vehicle performing this route. + // The `breaks` sequence represents time intervals, each starting at the + // corresponding `start_time` and lasting `duration` seconds. + repeated Break breaks = 11; + + // Duration, distance and load metrics for this route. The fields of + // [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + // summed over all + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + // or + // [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + // depending on the context. + AggregatedMetrics metrics = 12; + + // Cost of the route, broken down by cost-related request fields. + // The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + // "model.shipments.pickups.cost", and the values are the total cost + // generated by the corresponding cost field, aggregated over the whole route. + // In other words, costs["model.shipments.pickups.cost"] is the sum of all + // pickup costs over the route. All costs defined in the model are reported in + // detail here with the exception of costs related to TransitionAttributes + // that are only reported in an aggregated way as of 2022/01. + map route_costs = 17; + + // Total cost of the route. The sum of all costs in the cost map. + double route_total_cost = 18; +} + +// Specifies details of unperformed shipments in a solution. For trivial cases +// and/or if we are able to identify the cause for skipping, we report the +// reason here. +message SkippedShipment { + // If we can explain why the shipment was skipped, reasons will be listed + // here. If the reason is not the same for all vehicles, `reason` will have + // more than 1 element. A skipped shipment cannot have duplicate reasons, + // i.e. where all fields are the same except for `example_vehicle_index`. + // Example: + // ``` + // reasons { + // code: DEMAND_EXCEEDS_VEHICLE_CAPACITY + // example_vehicle_index: 1 + // example_exceeded_capacity_type: "Apples" + // } + // reasons { + // code: DEMAND_EXCEEDS_VEHICLE_CAPACITY + // example_vehicle_index: 3 + // example_exceeded_capacity_type: "Pears" + // } + // reasons { + // code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT + // example_vehicle_index: 1 + // } + // ``` + // The skipped shipment is incompatible with all vehicles. The reasons may + // be different for all vehicles but at least one vehicle's "Apples" + // capacity would be exceeded (including vehicle 1), at least one vehicle's + // "Pears" capacity would be exceeded (including vehicle 3) and at least one + // vehicle's distance limit would be exceeded (including vehicle 1). + message Reason { + // Code identifying the reason type. The order here is meaningless. In + // particular, it gives no indication of whether a given reason will + // appear before another in the solution, if both apply. + enum Code { + // This should never be used. If we are unable to understand why a + // shipment was skipped, we simply return an empty set of reasons. + CODE_UNSPECIFIED = 0; + + // There is no vehicle in the model making all shipments infeasible. + NO_VEHICLE = 1; + + // The demand of the shipment exceeds a vehicle's capacity for some + // capacity types, one of which is `example_exceeded_capacity_type`. + DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + + // The minimum distance necessary to perform this shipment, i.e. from + // the vehicle's `start_location` to the shipment's pickup and/or delivery + // locations and to the vehicle's end location exceeds the vehicle's + // `route_distance_limit`. + // + // Note that for this computation we use the geodesic distances. + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + + // The minimum time necessary to perform this shipment, including travel + // time, wait time and service time exceeds the vehicle's + // `route_duration_limit`. + // + // Note: travel time is computed in the best-case scenario, namely as + // geodesic distance x 36 m/s (roughly 130 km/hour). + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + + // Same as above but we only compare minimum travel time and the + // vehicle's `travel_duration_limit`. + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + + // The vehicle cannot perform this shipment in the best-case scenario + // (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time + // computation) if it starts at its earliest start time: the total time + // would make the vehicle end after its latest end time. + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + + // The `allowed_vehicle_indices` field of the shipment is not empty and + // this vehicle does not belong to it. + VEHICLE_NOT_ALLOWED = 7; + } + + // Refer to the comments of Code. + Code code = 1; + + // If the reason is related to a shipment-vehicle incompatibility, this + // field provides the index of one relevant vehicle. + optional int32 example_vehicle_index = 2; + + // If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + // capacity type that is exceeded. + string example_exceeded_capacity_type = 3; + } + + // The index corresponds to the index of the shipment in the source + // `ShipmentModel`. + int32 index = 1; + + // Copy of the corresponding + // [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + // specified in the `Shipment`. + string label = 2; + + // A list of reasons that explain why the shipment was skipped. See comment + // above `Reason`. + repeated Reason reasons = 3; +} + +// Aggregated metrics for +// [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute] (resp. for +// [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse] +// over all +// [Transition][google.maps.routeoptimization.v1.ShipmentRoute.Transition] +// and/or [Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit] (resp. +// over all [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]) +// elements. +message AggregatedMetrics { + // Number of shipments performed. Note that a pickup and delivery pair only + // counts once. + int32 performed_shipment_count = 1; + + // Total travel duration for a route or a solution. + google.protobuf.Duration travel_duration = 2; + + // Total wait duration for a route or a solution. + google.protobuf.Duration wait_duration = 3; + + // Total delay duration for a route or a solution. + google.protobuf.Duration delay_duration = 4; + + // Total break duration for a route or a solution. + google.protobuf.Duration break_duration = 5; + + // Total visit duration for a route or a solution. + google.protobuf.Duration visit_duration = 6; + + // The total duration should be equal to the sum of all durations above. + // For routes, it also corresponds to: + // ``` + // [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + // - + // [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + // ``` + google.protobuf.Duration total_duration = 7; + + // Total travel distance for a route or a solution. + double travel_distance_meters = 8; + + // Maximum load achieved over the entire route (resp. solution), for each of + // the quantities on this route (resp. solution), computed as the maximum over + // all + // [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + // (resp. + // [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + map max_loads = 9; +} + +// Solution injected in the request including information about which visits +// must be constrained and how they must be constrained. +message InjectedSolutionConstraint { + // For a group of vehicles, specifies at what threshold(s) constraints on + // visits will be relaxed and to which level. Shipments listed in + // the `skipped_shipment` field are constrained to be skipped; i.e., they + // cannot be performed. + message ConstraintRelaxation { + // If `relaxations` is empty, the start time and sequence of all visits + // on `routes` are fully constrained and no new visits may be inserted or + // added to those routes. Also, a vehicle's start and end time in + // `routes` is fully constrained, unless the vehicle is empty (i.e., has no + // visits and has `used_if_route_is_empty` set to false in the model). + // + // `relaxations(i).level` specifies the constraint relaxation level applied + // to a visit #j that satisfies: + // + // * `route.visits(j).start_time >= relaxations(i).threshold_time` AND + // * `j + 1 >= relaxations(i).threshold_visit_count` + // + // Similarly, the vehicle start is relaxed to `relaxations(i).level` if it + // satisfies: + // + // * `vehicle_start_time >= relaxations(i).threshold_time` AND + // * `relaxations(i).threshold_visit_count == 0` + // and the vehicle end is relaxed to `relaxations(i).level` if it satisfies: + // * `vehicle_end_time >= relaxations(i).threshold_time` AND + // * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count` + // + // To apply a relaxation level if a visit meets the `threshold_visit_count` + // OR the `threshold_time` add two `relaxations` with the same `level`: + // one with only `threshold_visit_count` set and the other with only + // `threshold_time` set. If a visit satisfies the conditions of multiple + // `relaxations`, the most relaxed level applies. As a result, from the + // vehicle start through the route visits in order to the vehicle end, the + // relaxation level becomes more relaxed: i.e., the relaxation level is + // non-decreasing as the route progresses. + // + // The timing and sequence of route visits that do not satisfy the + // threshold conditions of any `relaxations` are fully constrained + // and no visits may be inserted into these sequences. Also, if a + // vehicle start or end does not satisfy the conditions of any + // relaxation the time is fixed, unless the vehicle is empty. + message Relaxation { + // Expresses the different constraint relaxation levels, which are + // applied for a visit and those that follow when it satisfies the + // threshold conditions. + // + // The enumeration below is in order of increasing relaxation. + enum Level { + // Implicit default relaxation level: no constraints are relaxed, + // i.e., all visits are fully constrained. + // + // This value must not be explicitly used in `level`. + LEVEL_UNSPECIFIED = 0; + + // Visit start times and vehicle start/end times will be relaxed, but + // each visit remains bound to the same vehicle and the visit sequence + // must be observed: no visit can be inserted between them or before + // them. + RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + + // Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence + // is also relaxed: visits remain simply bound to their vehicle. + RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + + // Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the + // vehicle is also relaxed: visits are completely free at or after the + // threshold time and can potentially become unperformed. + RELAX_ALL_AFTER_THRESHOLD = 3; + } + + // The constraint relaxation level that applies when the conditions + // at or after `threshold_time` AND at least `threshold_visit_count` are + // satisfied. + Level level = 1; + + // The time at or after which the relaxation `level` may be applied. + google.protobuf.Timestamp threshold_time = 2; + + // The number of visits at or after which the relaxation `level` may be + // applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + // applied directly at the vehicle start. + // + // If it is `route.visits_size() + 1`, the `level` may only be applied to + // the vehicle end. If it is more than `route.visits_size() + 1`, + // `level` is not applied at all for that route. + int32 threshold_visit_count = 3; + } + + // All the visit constraint relaxations that will apply to visits on + // routes with vehicles in `vehicle_indices`. + repeated Relaxation relaxations = 1; + + // Specifies the vehicle indices to which the visit constraint + // `relaxations` apply. If empty, this is considered the default and the + // `relaxations` apply to all vehicles that are not specified in other + // `constraint_relaxations`. There can be at most one default, i.e., at + // most one constraint relaxation field is allowed empty + // `vehicle_indices`. A vehicle index can only be listed once, even within + // several `constraint_relaxations`. + // + // A vehicle index is mapped the same as + // [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + // if `interpret_injected_solutions_using_labels` is true (see `fields` + // comment). + repeated int32 vehicle_indices = 2; + } + + // Routes of the solution to inject. Some routes may be omitted from the + // original solution. The routes and skipped shipments must satisfy the basic + // validity assumptions listed for `injected_first_solution_routes`. + repeated ShipmentRoute routes = 1; + + // Skipped shipments of the solution to inject. Some may be omitted from the + // original solution. See the `routes` field. + repeated SkippedShipment skipped_shipments = 2; + + // For zero or more groups of vehicles, specifies when and how much to relax + // constraints. If this field is empty, all non-empty vehicle routes are + // fully constrained. + repeated ConstraintRelaxation constraint_relaxations = 3; +} + +// Describes an error encountered when validating an `OptimizeToursRequest`. +message OptimizeToursValidationError { + // Specifies a context for the validation error. A `FieldReference` always + // refers to a given field in this file and follows the same hierarchical + // structure. For example, we may specify element #2 of `start_time_windows` + // of vehicle #5 using: + // ``` + // name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 } + // ``` + // We however omit top-level entities such as `OptimizeToursRequest` or + // `ShipmentModel` to avoid crowding the message. + message FieldReference { + // Name of the field, e.g., "vehicles". + string name = 1; + + oneof index_or_key { + // Index of the field if repeated. + int32 index = 2; + + // Key if the field is a map. + string key = 4; + } + + // Recursively nested sub-field, if needed. + FieldReference sub_field = 3; + } + + // A validation error is defined by the pair (`code`, `display_name`) which + // are always present. + // + // Other fields (below) provide more context about the error. + // + // *MULTIPLE ERRORS*: + // When there are multiple errors, the validation process tries to output + // several of them. Much like a compiler, this is an imperfect process. Some + // validation errors will be "fatal", meaning that they stop the entire + // validation process. This is the case for `display_name="UNSPECIFIED"` + // errors, among others. Some may cause the validation process to skip other + // errors. + // + // *STABILITY*: + // `code` and `display_name` should be very stable. But new codes and + // display names may appear over time, which may cause a given (invalid) + // request to yield a different (`code`, `display_name`) pair because the new + // error hid the old one (see "MULTIPLE ERRORS"). + // + // *REFERENCE*: A list of all (code, name) pairs: + // + // * UNSPECIFIED = 0; + // * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + // the deadline. + // + // * REQUEST_OPTIONS_ERROR = 12; + // * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + // * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + // * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + // * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + // * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + // * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + // = 1207; + // * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + // * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + // * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + // * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + // * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + // * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + // * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + // * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + // * INJECTED_SOLUTION_ERROR = 20; + // * INJECTED_SOLUTION_MISSING_LABEL = 2000; + // * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + // * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + // * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + // * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + // * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + // * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + // * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + // * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + // * SHIPMENT_MODEL_ERROR = 22; + // * SHIPMENT_MODEL_TOO_LARGE = 2200; + // * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + // * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + // * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + // * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + // * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + // * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + // * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + // * INDEX_ERROR = 24; + // * TAG_ERROR = 26; + // * TIME_WINDOW_ERROR = 28; + // * TIME_WINDOW_INVALID_START_TIME = 2800; + // * TIME_WINDOW_INVALID_END_TIME = 2801; + // * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + // * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + // * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + // * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + // * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + // * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + // * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + // = 2808; + // * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + // * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + // = 2810; + // * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + // * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + // * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + // * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + // * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + // * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + // * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + // = 2817; + // * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + // * TRANSITION_ATTRIBUTES_ERROR = 30; + // * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + // * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + // * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + // * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + // * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + // * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + // * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + // * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + // * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + // * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + // * AMOUNT_ERROR = 31; + // * AMOUNT_NEGATIVE_VALUE = 3100; + // * LOAD_LIMIT_ERROR = 33; + // * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + // * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + // * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + // * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + // * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + // * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + // * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + // * INTERVAL_ERROR = 34; + // * INTERVAL_MIN_EXCEEDS_MAX = 3401; + // * INTERVAL_NEGATIVE_MIN = 3402; + // * INTERVAL_NEGATIVE_MAX = 3403; + // * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + // * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + // * DISTANCE_LIMIT_ERROR = 36; + // * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + // * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + // * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + // * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + // * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + // * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + // * DURATION_LIMIT_ERROR = 38; + // * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + // * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + // * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + // * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + // * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + // * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + // = 3807; + // * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + // = 3808; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + // * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + // * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + // = 3812; + // * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + // * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + // = 3815; + // * SHIPMENT_ERROR = 40; + // * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + // * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + // * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + // = 4001; + // * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + // * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + // * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + // * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + // * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + // * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + // * SHIPMENT_INVALID_PENALTY_COST = 4006; + // * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + // * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + // * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + // * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + // * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + // * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + // * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + // * VEHICLE_ERROR = 42; + // * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + // * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + // * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + // * VEHICLE_EMPTY_START_TAG = 4203; + // * VEHICLE_DUPLICATE_START_TAG = 4204; + // * VEHICLE_EMPTY_END_TAG = 4205; + // * VEHICLE_DUPLICATE_END_TAG = 4206; + // * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + // * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + // * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + // * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + // * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + // * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + // * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + // * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + // * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + // * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + // * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + // * VEHICLE_INVALID_COST_PER_HOUR = 4218; + // * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + // * VEHICLE_INVALID_FIXED_COST = 4220; + // * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + // * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + // = 4223; + // * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + // * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + // * VISIT_REQUEST_ERROR = 44; + // * VISIT_REQUEST_EMPTY_TAG = 4400; + // * VISIT_REQUEST_DUPLICATE_TAG = 4401; + // * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + // * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + // * PRECEDENCE_ERROR = 46; + // * BREAK_ERROR = 48; + // * BREAK_RULE_EMPTY = 4800; + // * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + // * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + // * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + // * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + // * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + // * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + // * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + // * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + // * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + // * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + // * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + // * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + // = 4812; + // * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + // * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + // * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + // * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + // * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + // * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + // * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + // * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + // * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + // * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + // * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + // * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + // * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + // * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + // * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + // * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + // * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + // * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + // * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + // * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + // * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + // * VEHICLE_OPERATOR_ERROR = 54; + // * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + // * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + // * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + // * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + // * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + // * DURATION_SECONDS_MATRIX_ERROR = 56; + // * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + // * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + int32 code = 1; + + // The error display name. + string display_name = 2; + + // An error context may involve 0, 1 (most of the time) or more fields. For + // example, referring to vehicle #4 and shipment #2's first pickup can be + // done as follows: + // ``` + // fields { name: "vehicles" index: 4} + // fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + // ``` + // Note, however, that the cardinality of `fields` should not change for a + // given error code. + repeated FieldReference fields = 3; + + // Human-readable string describing the error. There is a 1:1 mapping + // between `code` and `error_message` (when code != "UNSPECIFIED"). + // + // *STABILITY*: Not stable: the error message associated to a given `code` may + // change (hopefully to clarify it) over time. Please rely on the + // `display_name` and `code` instead. + string error_message = 4; + + // May contain the value(s) of the field(s). This is not always available. You + // should absolutely not rely on it and use it only for manual model + // debugging. + string offending_values = 5; +} + +// Specify an input for +// [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours]. +message InputConfig { + // Required. + oneof source { + // A Google Cloud Storage location. This must be a single object (file). + GcsSource gcs_source = 1; + } + + // Required. The input data format. + DataFormat data_format = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Specify a destination for +// [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours] +// results. +message OutputConfig { + // Required. + oneof destination { + // The Google Cloud Storage location to write the output to. + GcsDestination gcs_destination = 1; + } + + // Required. The output data format. + DataFormat data_format = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the input file will be read from. +message GcsSource { + // Required. URI of a Google Cloud Storage object with the format + // `gs://bucket/path/to/object`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output file(s) will be written +// to. +message GcsDestination { + // Required. Google Cloud Storage URI. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Data formats for input and output files. +enum DataFormat { + // Invalid value, format must not be UNSPECIFIED. + DATA_FORMAT_UNSPECIFIED = 0; + + // JavaScript Object Notation. + JSON = 1; + + // Protocol Buffers text format. See + // https://protobuf.dev/reference/protobuf/textformat-spec/ + PROTO_TEXT = 2; +} diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/AsyncBatchOptimizeTours.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/AsyncBatchOptimizeTours.java new file mode 100644 index 000000000000..a780d692d8c7 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/AsyncBatchOptimizeTours.java @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import java.util.ArrayList; + +public class AsyncBatchOptimizeTours { + + public static void main(String[] args) throws Exception { + asyncBatchOptimizeTours(); + } + + public static void asyncBatchOptimizeTours() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) { + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .addAllModelConfigs(new ArrayList()) + .build(); + ApiFuture future = + routeOptimizationClient.batchOptimizeToursCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/AsyncBatchOptimizeToursLRO.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/AsyncBatchOptimizeToursLRO.java new file mode 100644 index 000000000000..2e4b1e1457fb --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/AsyncBatchOptimizeToursLRO.java @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse; +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import java.util.ArrayList; + +public class AsyncBatchOptimizeToursLRO { + + public static void main(String[] args) throws Exception { + asyncBatchOptimizeToursLRO(); + } + + public static void asyncBatchOptimizeToursLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) { + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .addAllModelConfigs(new ArrayList()) + .build(); + OperationFuture future = + routeOptimizationClient.batchOptimizeToursOperationCallable().futureCall(request); + // Do something. + BatchOptimizeToursResponse response = future.get(); + } + } +} +// [END routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_LRO_async] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/SyncBatchOptimizeTours.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/SyncBatchOptimizeTours.java new file mode 100644 index 000000000000..c8df15e3b516 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/batchoptimizetours/SyncBatchOptimizeTours.java @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_sync] +import com.google.maps.routeoptimization.v1.BatchOptimizeToursRequest; +import com.google.maps.routeoptimization.v1.BatchOptimizeToursResponse; +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import java.util.ArrayList; + +public class SyncBatchOptimizeTours { + + public static void main(String[] args) throws Exception { + syncBatchOptimizeTours(); + } + + public static void syncBatchOptimizeTours() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) { + BatchOptimizeToursRequest request = + BatchOptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .addAllModelConfigs(new ArrayList()) + .build(); + BatchOptimizeToursResponse response = + routeOptimizationClient.batchOptimizeToursAsync(request).get(); + } + } +} +// [END routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_sync] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetCredentialsProvider.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..c4d3c9ac71c7 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import com.google.maps.routeoptimization.v1.RouteOptimizationSettings; +import com.google.maps.routeoptimization.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RouteOptimizationSettings routeOptimizationSettings = + RouteOptimizationSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RouteOptimizationClient routeOptimizationClient = + RouteOptimizationClient.create(routeOptimizationSettings); + } +} +// [END routeoptimization_v1_generated_RouteOptimization_Create_SetCredentialsProvider_sync] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetCredentialsProvider1.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..42b46c751e03 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_Create_SetCredentialsProvider1_sync] +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import com.google.maps.routeoptimization.v1.RouteOptimizationSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RouteOptimizationSettings routeOptimizationSettings = + RouteOptimizationSettings.newHttpJsonBuilder().build(); + RouteOptimizationClient routeOptimizationClient = + RouteOptimizationClient.create(routeOptimizationSettings); + } +} +// [END routeoptimization_v1_generated_RouteOptimization_Create_SetCredentialsProvider1_sync] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetEndpoint.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b46fdbf14d34 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_Create_SetEndpoint_sync] +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import com.google.maps.routeoptimization.v1.RouteOptimizationSettings; +import com.google.maps.routeoptimization.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RouteOptimizationSettings routeOptimizationSettings = + RouteOptimizationSettings.newBuilder().setEndpoint(myEndpoint).build(); + RouteOptimizationClient routeOptimizationClient = + RouteOptimizationClient.create(routeOptimizationSettings); + } +} +// [END routeoptimization_v1_generated_RouteOptimization_Create_SetEndpoint_sync] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/optimizetours/AsyncOptimizeTours.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/optimizetours/AsyncOptimizeTours.java new file mode 100644 index 000000000000..3d58c7cb3f67 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/optimizetours/AsyncOptimizeTours.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async] +import com.google.api.core.ApiFuture; +import com.google.maps.routeoptimization.v1.InjectedSolutionConstraint; +import com.google.maps.routeoptimization.v1.OptimizeToursRequest; +import com.google.maps.routeoptimization.v1.OptimizeToursResponse; +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import com.google.maps.routeoptimization.v1.ShipmentModel; +import com.google.maps.routeoptimization.v1.ShipmentRoute; +import com.google.protobuf.Duration; +import java.util.ArrayList; + +public class AsyncOptimizeTours { + + public static void main(String[] args) throws Exception { + asyncOptimizeTours(); + } + + public static void asyncOptimizeTours() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) { + OptimizeToursRequest request = + OptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .setTimeout(Duration.newBuilder().build()) + .setModel(ShipmentModel.newBuilder().build()) + .addAllInjectedFirstSolutionRoutes(new ArrayList()) + .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build()) + .addAllRefreshDetailsRoutes(new ArrayList()) + .setInterpretInjectedSolutionsUsingLabels(true) + .setConsiderRoadTraffic(true) + .setPopulatePolylines(true) + .setPopulateTransitionPolylines(true) + .setAllowLargeDeadlineDespiteInterruptionRisk(true) + .setUseGeodesicDistances(true) + .setGeodesicMetersPerSecond(-2129658905) + .setMaxValidationErrors(-1367418922) + .setLabel("label102727412") + .build(); + ApiFuture future = + routeOptimizationClient.optimizeToursCallable().futureCall(request); + // Do something. + OptimizeToursResponse response = future.get(); + } + } +} +// [END routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/optimizetours/SyncOptimizeTours.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/optimizetours/SyncOptimizeTours.java new file mode 100644 index 000000000000..40972619dd14 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimization/optimizetours/SyncOptimizeTours.java @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimization_OptimizeTours_sync] +import com.google.maps.routeoptimization.v1.InjectedSolutionConstraint; +import com.google.maps.routeoptimization.v1.OptimizeToursRequest; +import com.google.maps.routeoptimization.v1.OptimizeToursResponse; +import com.google.maps.routeoptimization.v1.RouteOptimizationClient; +import com.google.maps.routeoptimization.v1.ShipmentModel; +import com.google.maps.routeoptimization.v1.ShipmentRoute; +import com.google.protobuf.Duration; +import java.util.ArrayList; + +public class SyncOptimizeTours { + + public static void main(String[] args) throws Exception { + syncOptimizeTours(); + } + + public static void syncOptimizeTours() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RouteOptimizationClient routeOptimizationClient = RouteOptimizationClient.create()) { + OptimizeToursRequest request = + OptimizeToursRequest.newBuilder() + .setParent("parent-995424086") + .setTimeout(Duration.newBuilder().build()) + .setModel(ShipmentModel.newBuilder().build()) + .addAllInjectedFirstSolutionRoutes(new ArrayList()) + .setInjectedSolutionConstraint(InjectedSolutionConstraint.newBuilder().build()) + .addAllRefreshDetailsRoutes(new ArrayList()) + .setInterpretInjectedSolutionsUsingLabels(true) + .setConsiderRoadTraffic(true) + .setPopulatePolylines(true) + .setPopulateTransitionPolylines(true) + .setAllowLargeDeadlineDespiteInterruptionRisk(true) + .setUseGeodesicDistances(true) + .setGeodesicMetersPerSecond(-2129658905) + .setMaxValidationErrors(-1367418922) + .setLabel("label102727412") + .build(); + OptimizeToursResponse response = routeOptimizationClient.optimizeTours(request); + } + } +} +// [END routeoptimization_v1_generated_RouteOptimization_OptimizeTours_sync] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimizationsettings/optimizetours/SyncOptimizeTours.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimizationsettings/optimizetours/SyncOptimizeTours.java new file mode 100644 index 000000000000..76cdcd822b41 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/routeoptimizationsettings/optimizetours/SyncOptimizeTours.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.samples; + +// [START routeoptimization_v1_generated_RouteOptimizationSettings_OptimizeTours_sync] +import com.google.maps.routeoptimization.v1.RouteOptimizationSettings; +import java.time.Duration; + +public class SyncOptimizeTours { + + public static void main(String[] args) throws Exception { + syncOptimizeTours(); + } + + public static void syncOptimizeTours() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RouteOptimizationSettings.Builder routeOptimizationSettingsBuilder = + RouteOptimizationSettings.newBuilder(); + routeOptimizationSettingsBuilder + .optimizeToursSettings() + .setRetrySettings( + routeOptimizationSettingsBuilder + .optimizeToursSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RouteOptimizationSettings routeOptimizationSettings = routeOptimizationSettingsBuilder.build(); + } +} +// [END routeoptimization_v1_generated_RouteOptimizationSettings_OptimizeTours_sync] diff --git a/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/stub/routeoptimizationstubsettings/optimizetours/SyncOptimizeTours.java b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/stub/routeoptimizationstubsettings/optimizetours/SyncOptimizeTours.java new file mode 100644 index 000000000000..0451de9ef504 --- /dev/null +++ b/java-maps-routeoptimization/samples/snippets/generated/com/google/maps/routeoptimization/v1/stub/routeoptimizationstubsettings/optimizetours/SyncOptimizeTours.java @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package com.google.maps.routeoptimization.v1.stub.samples; + +// [START routeoptimization_v1_generated_RouteOptimizationStubSettings_OptimizeTours_sync] +import com.google.maps.routeoptimization.v1.stub.RouteOptimizationStubSettings; +import java.time.Duration; + +public class SyncOptimizeTours { + + public static void main(String[] args) throws Exception { + syncOptimizeTours(); + } + + public static void syncOptimizeTours() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RouteOptimizationStubSettings.Builder routeOptimizationSettingsBuilder = + RouteOptimizationStubSettings.newBuilder(); + routeOptimizationSettingsBuilder + .optimizeToursSettings() + .setRetrySettings( + routeOptimizationSettingsBuilder + .optimizeToursSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RouteOptimizationStubSettings routeOptimizationSettings = + routeOptimizationSettingsBuilder.build(); + } +} +// [END routeoptimization_v1_generated_RouteOptimizationStubSettings_OptimizeTours_sync] diff --git a/pom.xml b/pom.xml index 3a811bd99a07..4646dfd8fbdb 100644 --- a/pom.xml +++ b/pom.xml @@ -116,6 +116,7 @@ java-maps-addressvalidation java-maps-mapsplatformdatasets java-maps-places + java-maps-routeoptimization java-maps-routing java-maps-solar java-mediatranslation diff --git a/versions.txt b/versions.txt index 33570af274b1..f817dc9e68c2 100644 --- a/versions.txt +++ b/versions.txt @@ -767,3 +767,6 @@ proto-google-shopping-merchant-notifications-v1beta:0.1.0:0.2.0-SNAPSHOT grpc-google-shopping-merchant-notifications-v1beta:0.1.0:0.2.0-SNAPSHOT ad-manager:0.1.0:0.2.0-SNAPSHOT proto-ad-manager-v1:0.1.0:0.2.0-SNAPSHOT +google-maps-routeoptimization:0.0.0:0.0.1-SNAPSHOT +proto-google-maps-routeoptimization-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-maps-routeoptimization-v1:0.0.0:0.0.1-SNAPSHOT