diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1de473ea7732..531655430ebc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -85,6 +85,7 @@ "java-language": "2.6.0", "java-life-sciences": "0.7.0", "java-managed-identities": "1.3.0", + "java-maps-routiting": "0.0.0", "java-mediatranslation": "0.11.0", "java-memcache": "2.5.0", "java-monitoring-dashboards": "2.7.0", diff --git a/generation/generate_gapic_bom.sh b/generation/generate_gapic_bom.sh index 48c651c14518..252cccb0bbea 100755 --- a/generation/generate_gapic_bom.sh +++ b/generation/generate_gapic_bom.sh @@ -17,6 +17,11 @@ for bom_directory in $(find . -maxdepth 3 -name 'google-*-bom' | sort --dictiona artifactId_line=$(grep --max-count=1 'artifactId' "${pom_file}") version_line=$(grep --max-count=1 'x-version-update' "${pom_file}") + if [[ "$groupId_line" == *"com.google.maps"* ]]; then + # The gapic bom includes cloud libraries + continue + fi + bom_lines+=" \n\ ${groupId_line}\n\ ${artifactId_line}\n\ diff --git a/java-maps-routiting/.OwlBot.yaml b/java-maps-routiting/.OwlBot.yaml new file mode 100644 index 000000000000..02ff91e9105b --- /dev/null +++ b/java-maps-routiting/.OwlBot.yaml @@ -0,0 +1,33 @@ +# Copyright 2022 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-routiting/grpc-google-.*/src" +- "/java-maps-routiting/proto-google-.*/src" +- "/java-maps-routiting/google-.*/src" + +deep-preserve-regex: +- "/java-maps-routiting/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/maps/routing/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-maps-routiting/$1/proto-google-maps-routes-$1/src" +- source: "/google/maps/routing/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-maps-routiting/$1/grpc-google-maps-routes-$1/src" +- source: "/google/maps/routing/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-maps-routiting/$1/google-maps-routes/src" + + +api-name: java-maps-routiting \ No newline at end of file diff --git a/java-maps-routiting/.repo-metadata.json b/java-maps-routiting/.repo-metadata.json new file mode 100644 index 000000000000..b31db717fee3 --- /dev/null +++ b/java-maps-routiting/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "api_shortname": "maps-routiting", + "name_pretty": "Routes API", + "product_documentation": "https://developers.google.com/maps/documentation/routes", + "api_description": "Routes API is the next generation, performance optimized version of the existing Directions API and Distance Matrix API. It helps you find the ideal route from A to Z, calculates ETAs and distances for matrices of origin and destination locations, and also offers new features.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-maps-routes/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-maps-routiting", + "repo_short": "java-maps-routiting", + "distribution_name": "com.google.maps:google-maps-routes", + "api_id": "routes.googleapis.com", + "library_type": "GAPIC_AUTO" +} \ No newline at end of file diff --git a/java-maps-routiting/README.md b/java-maps-routiting/README.md new file mode 100644 index 000000000000..4963606edf2f --- /dev/null +++ b/java-maps-routiting/README.md @@ -0,0 +1,201 @@ +# Google Routes API Client for Java + +Java idiomatic client for [Routes 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, add this to your pom.xml file: + + +```xml + + com.google.maps + google-maps-routes + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.maps:google-maps-routes:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.maps" % "google-maps-routes" % "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 Routes API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Routes API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Routes API [API enabled][enable-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 SDK][cloud-sdk] 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-routes` library. See the [Quickstart](#quickstart) section +to add `google-maps-routes` as a dependency in your code. + +## About Routes API + + +[Routes API][product-docs] Routes API is the next generation, performance optimized version of the existing Directions API and Distance Matrix API. It helps you find the ideal route from A to Z, calculates ETAs and distances for matrices of origin and destination locations, and also offers new features. + +See the [Routes API client library docs][javadocs] to learn how to +use this Routes API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Routes API uses gRPC 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/routes +[javadocs]: https://cloud.google.com/java/docs/reference/google-maps-routes/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routiting/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-routes.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.maps%20AND%20a:google-maps-routes&core=gav +[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-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-maps-routiting/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-maps-routiting/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-maps-routiting/blob/main/LICENSE + +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=routes.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-routiting/google-maps-routes-bom/pom.xml b/java-maps-routiting/google-maps-routes-bom/pom.xml new file mode 100644 index 000000000000..11c639fbb7f4 --- /dev/null +++ b/java-maps-routiting/google-maps-routes-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.maps + google-maps-routes-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 0.2.1-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Routes API BOM + + BOM for Routes API + + + + true + + + + + + com.google.maps + google-maps-routes + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-maps-routes-v2 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-maps-routes-v2 + 0.0.1-SNAPSHOT + + + + diff --git a/java-maps-routiting/google-maps-routes/pom.xml b/java-maps-routiting/google-maps-routes/pom.xml new file mode 100644 index 000000000000..0e7606509b00 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.maps + google-maps-routes + 0.0.1-SNAPSHOT + jar + Google Routes API + Routes API Routes API is the next generation, performance optimized version of the existing Directions API and Distance Matrix API. It helps you find the ideal route from A to Z, calculates ETAs and distances for matrices of origin and destination locations, and also offers new features. + + com.google.maps + google-maps-routes-parent + 0.0.1-SNAPSHOT + + + google-maps-routes + + + + 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.api.grpc + proto-google-maps-routes-v2 + + + 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.api.grpc + grpc-google-maps-routes-v2 + 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-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/RoutesClient.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/RoutesClient.java new file mode 100644 index 000000000000..3f782d06b6a1 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/RoutesClient.java @@ -0,0 +1,417 @@ +/* + * Copyright 2022 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.routing.v2; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.maps.routing.v2.stub.RoutesStub; +import com.google.maps.routing.v2.stub.RoutesStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The Routes API. + * + *

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 (RoutesClient routesClient = RoutesClient.create()) {
+ *   ComputeRoutesRequest request =
+ *       ComputeRoutesRequest.newBuilder()
+ *           .setOrigin(Waypoint.newBuilder().build())
+ *           .setDestination(Waypoint.newBuilder().build())
+ *           .addAllIntermediates(new ArrayList())
+ *           .setTravelMode(RouteTravelMode.forNumber(0))
+ *           .setRoutingPreference(RoutingPreference.forNumber(0))
+ *           .setPolylineQuality(PolylineQuality.forNumber(0))
+ *           .setPolylineEncoding(PolylineEncoding.forNumber(0))
+ *           .setDepartureTime(Timestamp.newBuilder().build())
+ *           .setComputeAlternativeRoutes(true)
+ *           .setRouteModifiers(RouteModifiers.newBuilder().build())
+ *           .setLanguageCode("languageCode-2092349083")
+ *           .setUnits(Units.forNumber(0))
+ *           .addAllRequestedReferenceRoutes(new ArrayList())
+ *           .build();
+ *   ComputeRoutesResponse response = routesClient.computeRoutes(request);
+ * }
+ * }
+ * + *

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

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

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 RoutesSettings 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
+ * RoutesSettings routesSettings =
+ *     RoutesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RoutesClient routesClient = RoutesClient.create(routesSettings);
+ * }
+ * + *

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
+ * RoutesSettings routesSettings = RoutesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RoutesClient routesClient = RoutesClient.create(routesSettings);
+ * }
+ * + *

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
+ * RoutesSettings routesSettings = RoutesSettings.newHttpJsonBuilder().build();
+ * RoutesClient routesClient = RoutesClient.create(routesSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class RoutesClient implements BackgroundResource { + private final RoutesSettings settings; + private final RoutesStub stub; + + /** Constructs an instance of RoutesClient with default settings. */ + public static final RoutesClient create() throws IOException { + return create(RoutesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RoutesClient, 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 RoutesClient create(RoutesSettings settings) throws IOException { + return new RoutesClient(settings); + } + + /** + * Constructs an instance of RoutesClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(RoutesSettings). + */ + public static final RoutesClient create(RoutesStub stub) { + return new RoutesClient(stub); + } + + /** + * Constructs an instance of RoutesClient, 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 RoutesClient(RoutesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RoutesStubSettings) settings.getStubSettings()).createStub(); + } + + protected RoutesClient(RoutesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RoutesSettings getSettings() { + return settings; + } + + public RoutesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the primary route along with optional alternate routes, given a set of terminal and + * intermediate waypoints. + * + *

**NOTE:** This method requires that you specify a response field mask in the + * input. You can provide the response field mask by using URL parameter `$fields` or `fields`, or + * by using an HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and + * headers](https://cloud.google.com/apis/docs/system-parameters). The value is a comma separated + * list of field paths. See detailed documentation about [how to construct the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + *

For example, in this method: + * + *

+ * + *

Google discourage the use of the wildcard (`*`) response field mask, or specifying the + * field mask at the top level (`routes`), because: + * + *

+ * + *

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 (RoutesClient routesClient = RoutesClient.create()) {
+   *   ComputeRoutesRequest request =
+   *       ComputeRoutesRequest.newBuilder()
+   *           .setOrigin(Waypoint.newBuilder().build())
+   *           .setDestination(Waypoint.newBuilder().build())
+   *           .addAllIntermediates(new ArrayList())
+   *           .setTravelMode(RouteTravelMode.forNumber(0))
+   *           .setRoutingPreference(RoutingPreference.forNumber(0))
+   *           .setPolylineQuality(PolylineQuality.forNumber(0))
+   *           .setPolylineEncoding(PolylineEncoding.forNumber(0))
+   *           .setDepartureTime(Timestamp.newBuilder().build())
+   *           .setComputeAlternativeRoutes(true)
+   *           .setRouteModifiers(RouteModifiers.newBuilder().build())
+   *           .setLanguageCode("languageCode-2092349083")
+   *           .setUnits(Units.forNumber(0))
+   *           .addAllRequestedReferenceRoutes(new ArrayList())
+   *           .build();
+   *   ComputeRoutesResponse response = routesClient.computeRoutes(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 ComputeRoutesResponse computeRoutes(ComputeRoutesRequest request) { + return computeRoutesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the primary route along with optional alternate routes, given a set of terminal and + * intermediate waypoints. + * + *

**NOTE:** This method requires that you specify a response field mask in the + * input. You can provide the response field mask by using URL parameter `$fields` or `fields`, or + * by using an HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and + * headers](https://cloud.google.com/apis/docs/system-parameters). The value is a comma separated + * list of field paths. See detailed documentation about [how to construct the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + *

For example, in this method: + * + *

+ * + *

Google discourage the use of the wildcard (`*`) response field mask, or specifying the + * field mask at the top level (`routes`), because: + * + *

+ * + *

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 (RoutesClient routesClient = RoutesClient.create()) {
+   *   ComputeRoutesRequest request =
+   *       ComputeRoutesRequest.newBuilder()
+   *           .setOrigin(Waypoint.newBuilder().build())
+   *           .setDestination(Waypoint.newBuilder().build())
+   *           .addAllIntermediates(new ArrayList())
+   *           .setTravelMode(RouteTravelMode.forNumber(0))
+   *           .setRoutingPreference(RoutingPreference.forNumber(0))
+   *           .setPolylineQuality(PolylineQuality.forNumber(0))
+   *           .setPolylineEncoding(PolylineEncoding.forNumber(0))
+   *           .setDepartureTime(Timestamp.newBuilder().build())
+   *           .setComputeAlternativeRoutes(true)
+   *           .setRouteModifiers(RouteModifiers.newBuilder().build())
+   *           .setLanguageCode("languageCode-2092349083")
+   *           .setUnits(Units.forNumber(0))
+   *           .addAllRequestedReferenceRoutes(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       routesClient.computeRoutesCallable().futureCall(request);
+   *   // Do something.
+   *   ComputeRoutesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable computeRoutesCallable() { + return stub.computeRoutesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Takes in a list of origins and destinations and returns a stream containing route information + * for each combination of origin and destination. + * + *

**NOTE:** This method requires that you specify a response field mask in the + * input. You can provide the response field mask by using the URL parameter `$fields` or + * `fields`, or by using the HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL + * parameters and headers](https://cloud.google.com/apis/docs/system-parameters). The value is a + * comma separated list of field paths. See this detailed documentation about [how to construct + * the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + *

For example, in this method: + * + *

+ * + *

It is critical that you include `status` in your field mask as otherwise all messages will + * appear to be OK. Google discourages the use of the wildcard (`*`) response field mask, + * because: + * + *

+ * + *

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 (RoutesClient routesClient = RoutesClient.create()) {
+   *   ComputeRouteMatrixRequest request =
+   *       ComputeRouteMatrixRequest.newBuilder()
+   *           .addAllOrigins(new ArrayList())
+   *           .addAllDestinations(new ArrayList())
+   *           .setTravelMode(RouteTravelMode.forNumber(0))
+   *           .setRoutingPreference(RoutingPreference.forNumber(0))
+   *           .setDepartureTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ServerStream stream =
+   *       routesClient.computeRouteMatrixCallable().call(request);
+   *   for (RouteMatrixElement response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable + computeRouteMatrixCallable() { + return stub.computeRouteMatrixCallable(); + } + + @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-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/RoutesSettings.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/RoutesSettings.java new file mode 100644 index 000000000000..1e4eae9ddd14 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/RoutesSettings.java @@ -0,0 +1,214 @@ +/* + * Copyright 2022 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.routing.v2; + +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.maps.routing.v2.stub.RoutesStubSettings; +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 RoutesClient}. + * + *

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

    + *
  • The default service address (routes.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 computeRoutes 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
+ * RoutesSettings.Builder routesSettingsBuilder = RoutesSettings.newBuilder();
+ * routesSettingsBuilder
+ *     .computeRoutesSettings()
+ *     .setRetrySettings(
+ *         routesSettingsBuilder.computeRoutesSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RoutesSettings routesSettings = routesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RoutesSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to computeRoutes. */ + public UnaryCallSettings computeRoutesSettings() { + return ((RoutesStubSettings) getStubSettings()).computeRoutesSettings(); + } + + /** Returns the object with the settings used for calls to computeRouteMatrix. */ + public ServerStreamingCallSettings + computeRouteMatrixSettings() { + return ((RoutesStubSettings) getStubSettings()).computeRouteMatrixSettings(); + } + + public static final RoutesSettings create(RoutesStubSettings stub) throws IOException { + return new RoutesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RoutesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RoutesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RoutesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RoutesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RoutesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RoutesStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RoutesStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RoutesStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 RoutesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RoutesSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RoutesStubSettings.newBuilder(clientContext)); + } + + protected Builder(RoutesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RoutesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RoutesStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(RoutesStubSettings.newHttpJsonBuilder()); + } + + public RoutesStubSettings.Builder getStubSettingsBuilder() { + return ((RoutesStubSettings.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 computeRoutes. */ + public UnaryCallSettings.Builder + computeRoutesSettings() { + return getStubSettingsBuilder().computeRoutesSettings(); + } + + /** Returns the builder for the settings used for calls to computeRouteMatrix. */ + public ServerStreamingCallSettings.Builder + computeRouteMatrixSettings() { + return getStubSettingsBuilder().computeRouteMatrixSettings(); + } + + @Override + public RoutesSettings build() throws IOException { + return new RoutesSettings(this); + } + } +} diff --git a/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/gapic_metadata.json b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/gapic_metadata.json new file mode 100644 index 000000000000..11cb7ba144fd --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/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.routing.v2", + "libraryPackage": "com.google.maps.routing.v2", + "services": { + "Routes": { + "clients": { + "grpc": { + "libraryClient": "RoutesClient", + "rpcs": { + "ComputeRouteMatrix": { + "methods": ["computeRouteMatrixCallable"] + }, + "ComputeRoutes": { + "methods": ["computeRoutes", "computeRoutesCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/package-info.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/package-info.java new file mode 100644 index 000000000000..63ad08c7e946 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/package-info.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 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 Routes API + * + *

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

======================= RoutesClient ======================= + * + *

Service Description: The Routes API. + * + *

Sample for RoutesClient: + * + *

{@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 (RoutesClient routesClient = RoutesClient.create()) {
+ *   ComputeRoutesRequest request =
+ *       ComputeRoutesRequest.newBuilder()
+ *           .setOrigin(Waypoint.newBuilder().build())
+ *           .setDestination(Waypoint.newBuilder().build())
+ *           .addAllIntermediates(new ArrayList())
+ *           .setTravelMode(RouteTravelMode.forNumber(0))
+ *           .setRoutingPreference(RoutingPreference.forNumber(0))
+ *           .setPolylineQuality(PolylineQuality.forNumber(0))
+ *           .setPolylineEncoding(PolylineEncoding.forNumber(0))
+ *           .setDepartureTime(Timestamp.newBuilder().build())
+ *           .setComputeAlternativeRoutes(true)
+ *           .setRouteModifiers(RouteModifiers.newBuilder().build())
+ *           .setLanguageCode("languageCode-2092349083")
+ *           .setUnits(Units.forNumber(0))
+ *           .addAllRequestedReferenceRoutes(new ArrayList())
+ *           .build();
+ *   ComputeRoutesResponse response = routesClient.computeRoutes(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.maps.routing.v2; + +import javax.annotation.Generated; diff --git a/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/GrpcRoutesCallableFactory.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/GrpcRoutesCallableFactory.java new file mode 100644 index 000000000000..099984012490 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/GrpcRoutesCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 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.routing.v2.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 Routes service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcRoutesCallableFactory 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-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/GrpcRoutesStub.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/GrpcRoutesStub.java new file mode 100644 index 000000000000..84ee51421787 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/GrpcRoutesStub.java @@ -0,0 +1,182 @@ +/* + * Copyright 2022 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.routing.v2.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.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.maps.routing.v2.ComputeRouteMatrixRequest; +import com.google.maps.routing.v2.ComputeRoutesRequest; +import com.google.maps.routing.v2.ComputeRoutesResponse; +import com.google.maps.routing.v2.RouteMatrixElement; +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 Routes service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcRoutesStub extends RoutesStub { + private static final MethodDescriptor + computeRoutesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.maps.routing.v2.Routes/ComputeRoutes") + .setRequestMarshaller( + ProtoUtils.marshaller(ComputeRoutesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ComputeRoutesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + computeRouteMatrixMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.maps.routing.v2.Routes/ComputeRouteMatrix") + .setRequestMarshaller( + ProtoUtils.marshaller(ComputeRouteMatrixRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RouteMatrixElement.getDefaultInstance())) + .build(); + + private final UnaryCallable computeRoutesCallable; + private final ServerStreamingCallable + computeRouteMatrixCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRoutesStub create(RoutesStubSettings settings) throws IOException { + return new GrpcRoutesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRoutesStub create(ClientContext clientContext) throws IOException { + return new GrpcRoutesStub(RoutesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRoutesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRoutesStub( + RoutesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRoutesStub, 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 GrpcRoutesStub(RoutesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRoutesCallableFactory()); + } + + /** + * Constructs an instance of GrpcRoutesStub, 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 GrpcRoutesStub( + RoutesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings computeRoutesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(computeRoutesMethodDescriptor) + .build(); + GrpcCallSettings + computeRouteMatrixTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(computeRouteMatrixMethodDescriptor) + .build(); + + this.computeRoutesCallable = + callableFactory.createUnaryCallable( + computeRoutesTransportSettings, settings.computeRoutesSettings(), clientContext); + this.computeRouteMatrixCallable = + callableFactory.createServerStreamingCallable( + computeRouteMatrixTransportSettings, + settings.computeRouteMatrixSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable computeRoutesCallable() { + return computeRoutesCallable; + } + + @Override + public ServerStreamingCallable + computeRouteMatrixCallable() { + return computeRouteMatrixCallable; + } + + @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-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/HttpJsonRoutesCallableFactory.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/HttpJsonRoutesCallableFactory.java new file mode 100644 index 000000000000..7980b5a5f099 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/HttpJsonRoutesCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.routing.v2.stub; + +import com.google.api.core.BetaApi; +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 Routes service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRoutesCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/HttpJsonRoutesStub.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/HttpJsonRoutesStub.java new file mode 100644 index 000000000000..aee263055476 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/HttpJsonRoutesStub.java @@ -0,0 +1,249 @@ +/* + * Copyright 2022 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.routing.v2.stub; + +import com.google.api.core.BetaApi; +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.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.rpc.ClientContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.maps.routing.v2.ComputeRouteMatrixRequest; +import com.google.maps.routing.v2.ComputeRoutesRequest; +import com.google.maps.routing.v2.ComputeRoutesResponse; +import com.google.maps.routing.v2.RouteMatrixElement; +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 Routes service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRoutesStub extends RoutesStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + computeRoutesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.maps.routing.v2.Routes/ComputeRoutes") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/directions/v2:computeRoutes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ComputeRoutesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + computeRouteMatrixMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.maps.routing.v2.Routes/ComputeRouteMatrix") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/distanceMatrix/v2:computeRouteMatrix", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RouteMatrixElement.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable computeRoutesCallable; + private final ServerStreamingCallable + computeRouteMatrixCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRoutesStub create(RoutesStubSettings settings) throws IOException { + return new HttpJsonRoutesStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRoutesStub create(ClientContext clientContext) throws IOException { + return new HttpJsonRoutesStub(RoutesStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRoutesStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRoutesStub( + RoutesStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRoutesStub, 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 HttpJsonRoutesStub(RoutesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonRoutesCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRoutesStub, 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 HttpJsonRoutesStub( + RoutesStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + computeRoutesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(computeRoutesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + computeRouteMatrixTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(computeRouteMatrixMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.computeRoutesCallable = + callableFactory.createUnaryCallable( + computeRoutesTransportSettings, settings.computeRoutesSettings(), clientContext); + this.computeRouteMatrixCallable = + callableFactory.createServerStreamingCallable( + computeRouteMatrixTransportSettings, + settings.computeRouteMatrixSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(computeRoutesMethodDescriptor); + methodDescriptors.add(computeRouteMatrixMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable computeRoutesCallable() { + return computeRoutesCallable; + } + + @Override + public ServerStreamingCallable + computeRouteMatrixCallable() { + return computeRouteMatrixCallable; + } + + @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-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/RoutesStub.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/RoutesStub.java new file mode 100644 index 000000000000..f1751077a0b5 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/RoutesStub.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.routing.v2.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.maps.routing.v2.ComputeRouteMatrixRequest; +import com.google.maps.routing.v2.ComputeRoutesRequest; +import com.google.maps.routing.v2.ComputeRoutesResponse; +import com.google.maps.routing.v2.RouteMatrixElement; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Routes service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class RoutesStub implements BackgroundResource { + + public UnaryCallable computeRoutesCallable() { + throw new UnsupportedOperationException("Not implemented: computeRoutesCallable()"); + } + + public ServerStreamingCallable + computeRouteMatrixCallable() { + throw new UnsupportedOperationException("Not implemented: computeRouteMatrixCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/RoutesStubSettings.java b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/RoutesStubSettings.java new file mode 100644 index 000000000000..7c6b2776fec5 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/main/java/com/google/maps/routing/v2/stub/RoutesStubSettings.java @@ -0,0 +1,337 @@ +/* + * Copyright 2022 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.routing.v2.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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.maps.routing.v2.ComputeRouteMatrixRequest; +import com.google.maps.routing.v2.ComputeRoutesRequest; +import com.google.maps.routing.v2.ComputeRoutesResponse; +import com.google.maps.routing.v2.RouteMatrixElement; +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 RoutesStub}. + * + *

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

    + *
  • The default service address (routes.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 computeRoutes 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
+ * RoutesStubSettings.Builder routesSettingsBuilder = RoutesStubSettings.newBuilder();
+ * routesSettingsBuilder
+ *     .computeRoutesSettings()
+ *     .setRetrySettings(
+ *         routesSettingsBuilder.computeRoutesSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RoutesStubSettings routesSettings = routesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RoutesStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings + computeRoutesSettings; + private final ServerStreamingCallSettings + computeRouteMatrixSettings; + + /** Returns the object with the settings used for calls to computeRoutes. */ + public UnaryCallSettings computeRoutesSettings() { + return computeRoutesSettings; + } + + /** Returns the object with the settings used for calls to computeRouteMatrix. */ + public ServerStreamingCallSettings + computeRouteMatrixSettings() { + return computeRouteMatrixSettings; + } + + public RoutesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRoutesStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRoutesStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** 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 "routes.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "routes.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RoutesStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(RoutesStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RoutesStubSettings.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 RoutesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + computeRoutesSettings = settingsBuilder.computeRoutesSettings().build(); + computeRouteMatrixSettings = settingsBuilder.computeRouteMatrixSettings().build(); + } + + /** Builder for RoutesStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + computeRoutesSettings; + private final ServerStreamingCallSettings.Builder + computeRouteMatrixSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + 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().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); + + computeRoutesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + computeRouteMatrixSettings = ServerStreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(computeRoutesSettings); + initDefaults(this); + } + + protected Builder(RoutesStubSettings settings) { + super(settings); + + computeRoutesSettings = settings.computeRoutesSettings.toBuilder(); + computeRouteMatrixSettings = settings.computeRouteMatrixSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(computeRoutesSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .computeRoutesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .computeRouteMatrixSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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 computeRoutes. */ + public UnaryCallSettings.Builder + computeRoutesSettings() { + return computeRoutesSettings; + } + + /** Returns the builder for the settings used for calls to computeRouteMatrix. */ + public ServerStreamingCallSettings.Builder + computeRouteMatrixSettings() { + return computeRouteMatrixSettings; + } + + @Override + public RoutesStubSettings build() throws IOException { + return new RoutesStubSettings(this); + } + } +} diff --git a/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/MockRoutes.java b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/MockRoutes.java new file mode 100644 index 000000000000..007397a79402 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/MockRoutes.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.routing.v2; + +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 MockRoutes implements MockGrpcService { + private final MockRoutesImpl serviceImpl; + + public MockRoutes() { + serviceImpl = new MockRoutesImpl(); + } + + @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-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/MockRoutesImpl.java b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/MockRoutesImpl.java new file mode 100644 index 000000000000..74a8f2ca1375 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/MockRoutesImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright 2022 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.routing.v2; + +import com.google.api.core.BetaApi; +import com.google.maps.routing.v2.RoutesGrpc.RoutesImplBase; +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 MockRoutesImpl extends RoutesImplBase { + private List requests; + private Queue responses; + + public MockRoutesImpl() { + 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 computeRoutes( + ComputeRoutesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ComputeRoutesResponse) { + requests.add(request); + responseObserver.onNext(((ComputeRoutesResponse) 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 ComputeRoutes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ComputeRoutesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void computeRouteMatrix( + ComputeRouteMatrixRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RouteMatrixElement) { + requests.add(request); + responseObserver.onNext(((RouteMatrixElement) 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 ComputeRouteMatrix, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RouteMatrixElement.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/RoutesClientHttpJsonTest.java b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/RoutesClientHttpJsonTest.java new file mode 100644 index 000000000000..7a4988ad6f20 --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/RoutesClientHttpJsonTest.java @@ -0,0 +1,160 @@ +/* + * Copyright 2022 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.routing.v2; + +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.maps.routing.v2.stub.HttpJsonRoutesStub; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +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 RoutesClientHttpJsonTest { + private static MockHttpService mockService; + private static RoutesClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRoutesStub.getMethodDescriptors(), RoutesSettings.getDefaultEndpoint()); + RoutesSettings settings = + RoutesSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RoutesSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RoutesClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void computeRoutesTest() throws Exception { + ComputeRoutesResponse expectedResponse = + ComputeRoutesResponse.newBuilder() + .addAllRoutes(new ArrayList()) + .setFallbackInfo(FallbackInfo.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ComputeRoutesRequest request = + ComputeRoutesRequest.newBuilder() + .setOrigin(Waypoint.newBuilder().build()) + .setDestination(Waypoint.newBuilder().build()) + .addAllIntermediates(new ArrayList()) + .setTravelMode(RouteTravelMode.forNumber(0)) + .setRoutingPreference(RoutingPreference.forNumber(0)) + .setPolylineQuality(PolylineQuality.forNumber(0)) + .setPolylineEncoding(PolylineEncoding.forNumber(0)) + .setDepartureTime(Timestamp.newBuilder().build()) + .setComputeAlternativeRoutes(true) + .setRouteModifiers(RouteModifiers.newBuilder().build()) + .setLanguageCode("languageCode-2092349083") + .setUnits(Units.forNumber(0)) + .addAllRequestedReferenceRoutes(new ArrayList()) + .build(); + + ComputeRoutesResponse actualResponse = client.computeRoutes(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 computeRoutesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ComputeRoutesRequest request = + ComputeRoutesRequest.newBuilder() + .setOrigin(Waypoint.newBuilder().build()) + .setDestination(Waypoint.newBuilder().build()) + .addAllIntermediates(new ArrayList()) + .setTravelMode(RouteTravelMode.forNumber(0)) + .setRoutingPreference(RoutingPreference.forNumber(0)) + .setPolylineQuality(PolylineQuality.forNumber(0)) + .setPolylineEncoding(PolylineEncoding.forNumber(0)) + .setDepartureTime(Timestamp.newBuilder().build()) + .setComputeAlternativeRoutes(true) + .setRouteModifiers(RouteModifiers.newBuilder().build()) + .setLanguageCode("languageCode-2092349083") + .setUnits(Units.forNumber(0)) + .addAllRequestedReferenceRoutes(new ArrayList()) + .build(); + client.computeRoutes(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void computeRouteMatrixTest() throws Exception {} + + @Test + public void computeRouteMatrixExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } +} diff --git a/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/RoutesClientTest.java b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/RoutesClientTest.java new file mode 100644 index 000000000000..7d2436fa9f3d --- /dev/null +++ b/java-maps-routiting/google-maps-routes/src/test/java/com/google/maps/routing/v2/RoutesClientTest.java @@ -0,0 +1,232 @@ +/* + * Copyright 2022 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.routing.v2; + +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.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +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 RoutesClientTest { + private static MockRoutes mockRoutes; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RoutesClient client; + + @BeforeClass + public static void startStaticServer() { + mockRoutes = new MockRoutes(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockRoutes)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RoutesSettings settings = + RoutesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RoutesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void computeRoutesTest() throws Exception { + ComputeRoutesResponse expectedResponse = + ComputeRoutesResponse.newBuilder() + .addAllRoutes(new ArrayList()) + .setFallbackInfo(FallbackInfo.newBuilder().build()) + .build(); + mockRoutes.addResponse(expectedResponse); + + ComputeRoutesRequest request = + ComputeRoutesRequest.newBuilder() + .setOrigin(Waypoint.newBuilder().build()) + .setDestination(Waypoint.newBuilder().build()) + .addAllIntermediates(new ArrayList()) + .setTravelMode(RouteTravelMode.forNumber(0)) + .setRoutingPreference(RoutingPreference.forNumber(0)) + .setPolylineQuality(PolylineQuality.forNumber(0)) + .setPolylineEncoding(PolylineEncoding.forNumber(0)) + .setDepartureTime(Timestamp.newBuilder().build()) + .setComputeAlternativeRoutes(true) + .setRouteModifiers(RouteModifiers.newBuilder().build()) + .setLanguageCode("languageCode-2092349083") + .setUnits(Units.forNumber(0)) + .addAllRequestedReferenceRoutes(new ArrayList()) + .build(); + + ComputeRoutesResponse actualResponse = client.computeRoutes(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRoutes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ComputeRoutesRequest actualRequest = ((ComputeRoutesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getOrigin(), actualRequest.getOrigin()); + Assert.assertEquals(request.getDestination(), actualRequest.getDestination()); + Assert.assertEquals(request.getIntermediatesList(), actualRequest.getIntermediatesList()); + Assert.assertEquals(request.getTravelMode(), actualRequest.getTravelMode()); + Assert.assertEquals(request.getRoutingPreference(), actualRequest.getRoutingPreference()); + Assert.assertEquals(request.getPolylineQuality(), actualRequest.getPolylineQuality()); + Assert.assertEquals(request.getPolylineEncoding(), actualRequest.getPolylineEncoding()); + Assert.assertEquals(request.getDepartureTime(), actualRequest.getDepartureTime()); + Assert.assertEquals( + request.getComputeAlternativeRoutes(), actualRequest.getComputeAlternativeRoutes()); + Assert.assertEquals(request.getRouteModifiers(), actualRequest.getRouteModifiers()); + Assert.assertEquals(request.getLanguageCode(), actualRequest.getLanguageCode()); + Assert.assertEquals(request.getUnits(), actualRequest.getUnits()); + Assert.assertEquals( + request.getRequestedReferenceRoutesList(), actualRequest.getRequestedReferenceRoutesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void computeRoutesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRoutes.addException(exception); + + try { + ComputeRoutesRequest request = + ComputeRoutesRequest.newBuilder() + .setOrigin(Waypoint.newBuilder().build()) + .setDestination(Waypoint.newBuilder().build()) + .addAllIntermediates(new ArrayList()) + .setTravelMode(RouteTravelMode.forNumber(0)) + .setRoutingPreference(RoutingPreference.forNumber(0)) + .setPolylineQuality(PolylineQuality.forNumber(0)) + .setPolylineEncoding(PolylineEncoding.forNumber(0)) + .setDepartureTime(Timestamp.newBuilder().build()) + .setComputeAlternativeRoutes(true) + .setRouteModifiers(RouteModifiers.newBuilder().build()) + .setLanguageCode("languageCode-2092349083") + .setUnits(Units.forNumber(0)) + .addAllRequestedReferenceRoutes(new ArrayList()) + .build(); + client.computeRoutes(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void computeRouteMatrixTest() throws Exception { + RouteMatrixElement expectedResponse = + RouteMatrixElement.newBuilder() + .setOriginIndex(2078721657) + .setDestinationIndex(-1296954015) + .setStatus(Status.newBuilder().build()) + .setCondition(RouteMatrixElementCondition.forNumber(0)) + .setDistanceMeters(1958857108) + .setDuration(Duration.newBuilder().build()) + .setStaticDuration(Duration.newBuilder().build()) + .setTravelAdvisory(RouteTravelAdvisory.newBuilder().build()) + .setFallbackInfo(FallbackInfo.newBuilder().build()) + .build(); + mockRoutes.addResponse(expectedResponse); + ComputeRouteMatrixRequest request = + ComputeRouteMatrixRequest.newBuilder() + .addAllOrigins(new ArrayList()) + .addAllDestinations(new ArrayList()) + .setTravelMode(RouteTravelMode.forNumber(0)) + .setRoutingPreference(RoutingPreference.forNumber(0)) + .setDepartureTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.computeRouteMatrixCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void computeRouteMatrixExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRoutes.addException(exception); + ComputeRouteMatrixRequest request = + ComputeRouteMatrixRequest.newBuilder() + .addAllOrigins(new ArrayList()) + .addAllDestinations(new ArrayList()) + .setTravelMode(RouteTravelMode.forNumber(0)) + .setRoutingPreference(RoutingPreference.forNumber(0)) + .setDepartureTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.computeRouteMatrixCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-maps-routiting/grpc-google-maps-routes-v2/pom.xml b/java-maps-routiting/grpc-google-maps-routes-v2/pom.xml new file mode 100644 index 000000000000..4b4814ec2da1 --- /dev/null +++ b/java-maps-routiting/grpc-google-maps-routes-v2/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-maps-routes-v2 + 0.0.1-SNAPSHOT + grpc-google-maps-routes-v2 + GRPC library for google-maps-routes + + com.google.maps + google-maps-routes-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.api.grpc + proto-google-maps-routes-v2 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-maps-routiting/grpc-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutesGrpc.java b/java-maps-routiting/grpc-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutesGrpc.java new file mode 100644 index 000000000000..c58e60777cda --- /dev/null +++ b/java-maps-routiting/grpc-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutesGrpc.java @@ -0,0 +1,663 @@ +/* + * Copyright 2020 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.routing.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The Routes API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/maps/routing/v2/routes_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RoutesGrpc { + + private RoutesGrpc() {} + + public static final String SERVICE_NAME = "google.maps.routing.v2.Routes"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.maps.routing.v2.ComputeRoutesRequest, + com.google.maps.routing.v2.ComputeRoutesResponse> + getComputeRoutesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ComputeRoutes", + requestType = com.google.maps.routing.v2.ComputeRoutesRequest.class, + responseType = com.google.maps.routing.v2.ComputeRoutesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.routing.v2.ComputeRoutesRequest, + com.google.maps.routing.v2.ComputeRoutesResponse> + getComputeRoutesMethod() { + io.grpc.MethodDescriptor< + com.google.maps.routing.v2.ComputeRoutesRequest, + com.google.maps.routing.v2.ComputeRoutesResponse> + getComputeRoutesMethod; + if ((getComputeRoutesMethod = RoutesGrpc.getComputeRoutesMethod) == null) { + synchronized (RoutesGrpc.class) { + if ((getComputeRoutesMethod = RoutesGrpc.getComputeRoutesMethod) == null) { + RoutesGrpc.getComputeRoutesMethod = + getComputeRoutesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ComputeRoutes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routing.v2.ComputeRoutesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routing.v2.ComputeRoutesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new RoutesMethodDescriptorSupplier("ComputeRoutes")) + .build(); + } + } + } + return getComputeRoutesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.routing.v2.ComputeRouteMatrixRequest, + com.google.maps.routing.v2.RouteMatrixElement> + getComputeRouteMatrixMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ComputeRouteMatrix", + requestType = com.google.maps.routing.v2.ComputeRouteMatrixRequest.class, + responseType = com.google.maps.routing.v2.RouteMatrixElement.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.maps.routing.v2.ComputeRouteMatrixRequest, + com.google.maps.routing.v2.RouteMatrixElement> + getComputeRouteMatrixMethod() { + io.grpc.MethodDescriptor< + com.google.maps.routing.v2.ComputeRouteMatrixRequest, + com.google.maps.routing.v2.RouteMatrixElement> + getComputeRouteMatrixMethod; + if ((getComputeRouteMatrixMethod = RoutesGrpc.getComputeRouteMatrixMethod) == null) { + synchronized (RoutesGrpc.class) { + if ((getComputeRouteMatrixMethod = RoutesGrpc.getComputeRouteMatrixMethod) == null) { + RoutesGrpc.getComputeRouteMatrixMethod = + getComputeRouteMatrixMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ComputeRouteMatrix")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routing.v2.ComputeRouteMatrixRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.routing.v2.RouteMatrixElement.getDefaultInstance())) + .setSchemaDescriptor(new RoutesMethodDescriptorSupplier("ComputeRouteMatrix")) + .build(); + } + } + } + return getComputeRouteMatrixMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RoutesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RoutesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RoutesStub(channel, callOptions); + } + }; + return RoutesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RoutesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RoutesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RoutesBlockingStub(channel, callOptions); + } + }; + return RoutesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RoutesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RoutesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RoutesFutureStub(channel, callOptions); + } + }; + return RoutesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The Routes API.
+   * 
+ */ + public abstract static class RoutesImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns the primary route along with optional alternate routes, given a set
+     * of terminal and intermediate waypoints.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using URL parameter
+     * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask`
+     * (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See detailed documentation about
+     * [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of Route-level duration, distance, and polyline (an example
+     * production setup):
+     *   `X-Goog-FieldMask:
+     *   routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline`
+     * Google discourage the use of the wildcard (`*`) response field mask, or
+     * specifying the field mask at the top level (`routes`), because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need
+     * in your production job ensures stable latency performance. We might add
+     * more response fields in the future, and those new fields might require
+     * extra computation time. If you select all fields, or if you select all
+     * fields at the top level, then you might experience performance degradation
+     * because any new field we add will be automatically included in the
+     * response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public void computeRoutes( + com.google.maps.routing.v2.ComputeRoutesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getComputeRoutesMethod(), responseObserver); + } + + /** + * + * + *
+     * Takes in a list of origins and destinations and returns a stream containing
+     * route information for each combination of origin and destination.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using the URL
+     * parameter `$fields` or `fields`, or by using the HTTP/gRPC header
+     * `X-Goog-FieldMask` (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See this detailed documentation
+     * about [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of route durations, distances, element status, condition, and
+     *   element indices (an example production setup):
+     *   `X-Goog-FieldMask:
+     *   originIndex,destinationIndex,status,condition,distanceMeters,duration`
+     * It is critical that you include `status` in your field mask as otherwise
+     * all messages will appear to be OK. Google discourages the use of the
+     * wildcard (`*`) response field mask, because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need in your production job ensures
+     * stable latency performance. We might add more response fields in the
+     * future, and those new fields might require extra computation time. If you
+     * select all fields, or if you select all fields at the top level, then you
+     * might experience performance degradation because any new field we add will
+     * be automatically included in the response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public void computeRouteMatrix( + com.google.maps.routing.v2.ComputeRouteMatrixRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getComputeRouteMatrixMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getComputeRoutesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.routing.v2.ComputeRoutesRequest, + com.google.maps.routing.v2.ComputeRoutesResponse>( + this, METHODID_COMPUTE_ROUTES))) + .addMethod( + getComputeRouteMatrixMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.maps.routing.v2.ComputeRouteMatrixRequest, + com.google.maps.routing.v2.RouteMatrixElement>( + this, METHODID_COMPUTE_ROUTE_MATRIX))) + .build(); + } + } + + /** + * + * + *
+   * The Routes API.
+   * 
+ */ + public static final class RoutesStub extends io.grpc.stub.AbstractAsyncStub { + private RoutesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RoutesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RoutesStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the primary route along with optional alternate routes, given a set
+     * of terminal and intermediate waypoints.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using URL parameter
+     * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask`
+     * (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See detailed documentation about
+     * [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of Route-level duration, distance, and polyline (an example
+     * production setup):
+     *   `X-Goog-FieldMask:
+     *   routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline`
+     * Google discourage the use of the wildcard (`*`) response field mask, or
+     * specifying the field mask at the top level (`routes`), because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need
+     * in your production job ensures stable latency performance. We might add
+     * more response fields in the future, and those new fields might require
+     * extra computation time. If you select all fields, or if you select all
+     * fields at the top level, then you might experience performance degradation
+     * because any new field we add will be automatically included in the
+     * response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public void computeRoutes( + com.google.maps.routing.v2.ComputeRoutesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getComputeRoutesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Takes in a list of origins and destinations and returns a stream containing
+     * route information for each combination of origin and destination.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using the URL
+     * parameter `$fields` or `fields`, or by using the HTTP/gRPC header
+     * `X-Goog-FieldMask` (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See this detailed documentation
+     * about [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of route durations, distances, element status, condition, and
+     *   element indices (an example production setup):
+     *   `X-Goog-FieldMask:
+     *   originIndex,destinationIndex,status,condition,distanceMeters,duration`
+     * It is critical that you include `status` in your field mask as otherwise
+     * all messages will appear to be OK. Google discourages the use of the
+     * wildcard (`*`) response field mask, because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need in your production job ensures
+     * stable latency performance. We might add more response fields in the
+     * future, and those new fields might require extra computation time. If you
+     * select all fields, or if you select all fields at the top level, then you
+     * might experience performance degradation because any new field we add will
+     * be automatically included in the response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public void computeRouteMatrix( + com.google.maps.routing.v2.ComputeRouteMatrixRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getComputeRouteMatrixMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The Routes API.
+   * 
+ */ + public static final class RoutesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RoutesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RoutesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RoutesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the primary route along with optional alternate routes, given a set
+     * of terminal and intermediate waypoints.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using URL parameter
+     * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask`
+     * (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See detailed documentation about
+     * [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of Route-level duration, distance, and polyline (an example
+     * production setup):
+     *   `X-Goog-FieldMask:
+     *   routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline`
+     * Google discourage the use of the wildcard (`*`) response field mask, or
+     * specifying the field mask at the top level (`routes`), because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need
+     * in your production job ensures stable latency performance. We might add
+     * more response fields in the future, and those new fields might require
+     * extra computation time. If you select all fields, or if you select all
+     * fields at the top level, then you might experience performance degradation
+     * because any new field we add will be automatically included in the
+     * response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public com.google.maps.routing.v2.ComputeRoutesResponse computeRoutes( + com.google.maps.routing.v2.ComputeRoutesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getComputeRoutesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Takes in a list of origins and destinations and returns a stream containing
+     * route information for each combination of origin and destination.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using the URL
+     * parameter `$fields` or `fields`, or by using the HTTP/gRPC header
+     * `X-Goog-FieldMask` (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See this detailed documentation
+     * about [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of route durations, distances, element status, condition, and
+     *   element indices (an example production setup):
+     *   `X-Goog-FieldMask:
+     *   originIndex,destinationIndex,status,condition,distanceMeters,duration`
+     * It is critical that you include `status` in your field mask as otherwise
+     * all messages will appear to be OK. Google discourages the use of the
+     * wildcard (`*`) response field mask, because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need in your production job ensures
+     * stable latency performance. We might add more response fields in the
+     * future, and those new fields might require extra computation time. If you
+     * select all fields, or if you select all fields at the top level, then you
+     * might experience performance degradation because any new field we add will
+     * be automatically included in the response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public java.util.Iterator computeRouteMatrix( + com.google.maps.routing.v2.ComputeRouteMatrixRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getComputeRouteMatrixMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The Routes API.
+   * 
+ */ + public static final class RoutesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RoutesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RoutesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RoutesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns the primary route along with optional alternate routes, given a set
+     * of terminal and intermediate waypoints.
+     * **NOTE:** This method requires that you specify a response field mask in
+     * the input. You can provide the response field mask by using URL parameter
+     * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask`
+     * (see the [available URL parameters and
+     * headers](https://cloud.google.com/apis/docs/system-parameters). The value
+     * is a comma separated list of field paths. See detailed documentation about
+     * [how to construct the field
+     * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
+     * For example, in this method:
+     * * Field mask of all available fields (for manual inspection):
+     *   `X-Goog-FieldMask: *`
+     * * Field mask of Route-level duration, distance, and polyline (an example
+     * production setup):
+     *   `X-Goog-FieldMask:
+     *   routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline`
+     * Google discourage the use of the wildcard (`*`) response field mask, or
+     * specifying the field mask at the top level (`routes`), because:
+     * * Selecting only the fields that you need helps our server save computation
+     * cycles, allowing us to return the result to you with a lower latency.
+     * * Selecting only the fields that you need
+     * in your production job ensures stable latency performance. We might add
+     * more response fields in the future, and those new fields might require
+     * extra computation time. If you select all fields, or if you select all
+     * fields at the top level, then you might experience performance degradation
+     * because any new field we add will be automatically included in the
+     * response.
+     * * Selecting only the fields that you need results in a smaller response
+     * size, and thus higher network throughput.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.routing.v2.ComputeRoutesResponse> + computeRoutes(com.google.maps.routing.v2.ComputeRoutesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getComputeRoutesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_COMPUTE_ROUTES = 0; + private static final int METHODID_COMPUTE_ROUTE_MATRIX = 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 RoutesImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RoutesImplBase 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_COMPUTE_ROUTES: + serviceImpl.computeRoutes( + (com.google.maps.routing.v2.ComputeRoutesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COMPUTE_ROUTE_MATRIX: + serviceImpl.computeRouteMatrix( + (com.google.maps.routing.v2.ComputeRouteMatrixRequest) 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(); + } + } + } + + private abstract static class RoutesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RoutesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Routes"); + } + } + + private static final class RoutesFileDescriptorSupplier extends RoutesBaseDescriptorSupplier { + RoutesFileDescriptorSupplier() {} + } + + private static final class RoutesMethodDescriptorSupplier extends RoutesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RoutesMethodDescriptorSupplier(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 (RoutesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RoutesFileDescriptorSupplier()) + .addMethod(getComputeRoutesMethod()) + .addMethod(getComputeRouteMatrixMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-maps-routiting/owlbot.py b/java-maps-routiting/owlbot.py new file mode 100644 index 000000000000..554e11767c10 --- /dev/null +++ b/java-maps-routiting/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 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(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-routiting/pom.xml b/java-maps-routiting/pom.xml new file mode 100644 index 000000000000..e899504b1d0d --- /dev/null +++ b/java-maps-routiting/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.maps + google-maps-routes-parent + pom + 0.0.1-SNAPSHOT + Google Routes API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 0.2.1-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-maps-routes-parent + + + + + + com.google.maps + google-maps-routes + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-maps-routes-v2 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-maps-routes-v2 + 0.0.1-SNAPSHOT + + + + + + google-maps-routes + grpc-google-maps-routes-v2 + proto-google-maps-routes-v2 + google-maps-routes-bom + + + diff --git a/java-maps-routiting/proto-google-maps-routes-v2/clirr-ignored-differences.xml b/java-maps-routiting/proto-google-maps-routes-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..aa32c51df19e --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/maps/routing/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/maps/routing/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/maps/routing/v2/*OrBuilder + boolean has*(*) + + diff --git a/java-maps-routiting/proto-google-maps-routes-v2/pom.xml b/java-maps-routiting/proto-google-maps-routes-v2/pom.xml new file mode 100644 index 000000000000..d987039823d2 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-maps-routes-v2 + 0.0.1-SNAPSHOT + proto-google-maps-routes-v2 + Proto library for google-maps-routes + + com.google.maps + google-maps-routes-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-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRouteMatrixRequest.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRouteMatrixRequest.java new file mode 100644 index 000000000000..48d661e9795e --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRouteMatrixRequest.java @@ -0,0 +1,2386 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * ComputeRouteMatrix request message
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.ComputeRouteMatrixRequest} + */ +public final class ComputeRouteMatrixRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.ComputeRouteMatrixRequest) + ComputeRouteMatrixRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComputeRouteMatrixRequest.newBuilder() to construct. + private ComputeRouteMatrixRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComputeRouteMatrixRequest() { + origins_ = java.util.Collections.emptyList(); + destinations_ = java.util.Collections.emptyList(); + travelMode_ = 0; + routingPreference_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComputeRouteMatrixRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.ComputeRouteMatrixRequest.class, + com.google.maps.routing.v2.ComputeRouteMatrixRequest.Builder.class); + } + + public static final int ORIGINS_FIELD_NUMBER = 1; + private java.util.List origins_; + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getOriginsList() { + return origins_; + } + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getOriginsOrBuilderList() { + return origins_; + } + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getOriginsCount() { + return origins_.size(); + } + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixOrigin getOrigins(int index) { + return origins_.get(index); + } + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixOriginOrBuilder getOriginsOrBuilder(int index) { + return origins_.get(index); + } + + public static final int DESTINATIONS_FIELD_NUMBER = 2; + private java.util.List destinations_; + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getDestinationsList() { + return destinations_; + } + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getDestinationsOrBuilderList() { + return destinations_; + } + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getDestinationsCount() { + return destinations_.size(); + } + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixDestination getDestinations(int index) { + return destinations_.get(index); + } + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder getDestinationsOrBuilder( + int index) { + return destinations_.get(index); + } + + public static final int TRAVEL_MODE_FIELD_NUMBER = 3; + private int travelMode_; + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for travelMode. + */ + @java.lang.Override + public int getTravelModeValue() { + return travelMode_; + } + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The travelMode. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelMode getTravelMode() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteTravelMode result = + com.google.maps.routing.v2.RouteTravelMode.valueOf(travelMode_); + return result == null ? com.google.maps.routing.v2.RouteTravelMode.UNRECOGNIZED : result; + } + + public static final int ROUTING_PREFERENCE_FIELD_NUMBER = 4; + private int routingPreference_; + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server attempts to use the selected
+   * routing preference to compute the route. If the routing preference results
+   * in an error or an extra long latency, an error is returned. In the future,
+   * we might implement a fallback mechanism to use a different option when the
+   * preferred option does not give a valid result. You can specify this option
+   * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+   * request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for routingPreference. + */ + @java.lang.Override + public int getRoutingPreferenceValue() { + return routingPreference_; + } + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server attempts to use the selected
+   * routing preference to compute the route. If the routing preference results
+   * in an error or an extra long latency, an error is returned. In the future,
+   * we might implement a fallback mechanism to use a different option when the
+   * preferred option does not give a valid result. You can specify this option
+   * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+   * request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingPreference. + */ + @java.lang.Override + public com.google.maps.routing.v2.RoutingPreference getRoutingPreference() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RoutingPreference result = + com.google.maps.routing.v2.RoutingPreference.valueOf(routingPreference_); + return result == null ? com.google.maps.routing.v2.RoutingPreference.UNRECOGNIZED : result; + } + + public static final int DEPARTURE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp departureTime_; + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, this defaults to the time
+   * that you made the request. If you set this value to a time that has already
+   * occurred, the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the departureTime field is set. + */ + @java.lang.Override + public boolean hasDepartureTime() { + return departureTime_ != null; + } + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, this defaults to the time
+   * that you made the request. If you set this value to a time that has already
+   * occurred, the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The departureTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDepartureTime() { + return departureTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : departureTime_; + } + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, this defaults to the time
+   * that you made the request. If you set this value to a time that has already
+   * occurred, the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDepartureTimeOrBuilder() { + return getDepartureTime(); + } + + 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 < origins_.size(); i++) { + output.writeMessage(1, origins_.get(i)); + } + for (int i = 0; i < destinations_.size(); i++) { + output.writeMessage(2, destinations_.get(i)); + } + if (travelMode_ + != com.google.maps.routing.v2.RouteTravelMode.TRAVEL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, travelMode_); + } + if (routingPreference_ + != com.google.maps.routing.v2.RoutingPreference.ROUTING_PREFERENCE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, routingPreference_); + } + if (departureTime_ != null) { + output.writeMessage(5, getDepartureTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < origins_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, origins_.get(i)); + } + for (int i = 0; i < destinations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, destinations_.get(i)); + } + if (travelMode_ + != com.google.maps.routing.v2.RouteTravelMode.TRAVEL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, travelMode_); + } + if (routingPreference_ + != com.google.maps.routing.v2.RoutingPreference.ROUTING_PREFERENCE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, routingPreference_); + } + if (departureTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDepartureTime()); + } + 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.routing.v2.ComputeRouteMatrixRequest)) { + return super.equals(obj); + } + com.google.maps.routing.v2.ComputeRouteMatrixRequest other = + (com.google.maps.routing.v2.ComputeRouteMatrixRequest) obj; + + if (!getOriginsList().equals(other.getOriginsList())) return false; + if (!getDestinationsList().equals(other.getDestinationsList())) return false; + if (travelMode_ != other.travelMode_) return false; + if (routingPreference_ != other.routingPreference_) return false; + if (hasDepartureTime() != other.hasDepartureTime()) return false; + if (hasDepartureTime()) { + if (!getDepartureTime().equals(other.getDepartureTime())) 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 (getOriginsCount() > 0) { + hash = (37 * hash) + ORIGINS_FIELD_NUMBER; + hash = (53 * hash) + getOriginsList().hashCode(); + } + if (getDestinationsCount() > 0) { + hash = (37 * hash) + DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDestinationsList().hashCode(); + } + hash = (37 * hash) + TRAVEL_MODE_FIELD_NUMBER; + hash = (53 * hash) + travelMode_; + hash = (37 * hash) + ROUTING_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + routingPreference_; + if (hasDepartureTime()) { + hash = (37 * hash) + DEPARTURE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDepartureTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest 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.routing.v2.ComputeRouteMatrixRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest 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.routing.v2.ComputeRouteMatrixRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest 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.routing.v2.ComputeRouteMatrixRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest 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.routing.v2.ComputeRouteMatrixRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest 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.routing.v2.ComputeRouteMatrixRequest 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; + } + /** + * + * + *
+   * ComputeRouteMatrix request message
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.ComputeRouteMatrixRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.ComputeRouteMatrixRequest) + com.google.maps.routing.v2.ComputeRouteMatrixRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.ComputeRouteMatrixRequest.class, + com.google.maps.routing.v2.ComputeRouteMatrixRequest.Builder.class); + } + + // Construct using com.google.maps.routing.v2.ComputeRouteMatrixRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (originsBuilder_ == null) { + origins_ = java.util.Collections.emptyList(); + } else { + origins_ = null; + originsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (destinationsBuilder_ == null) { + destinations_ = java.util.Collections.emptyList(); + } else { + destinations_ = null; + destinationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + travelMode_ = 0; + + routingPreference_ = 0; + + if (departureTimeBuilder_ == null) { + departureTime_ = null; + } else { + departureTime_ = null; + departureTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRouteMatrixRequest getDefaultInstanceForType() { + return com.google.maps.routing.v2.ComputeRouteMatrixRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRouteMatrixRequest build() { + com.google.maps.routing.v2.ComputeRouteMatrixRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRouteMatrixRequest buildPartial() { + com.google.maps.routing.v2.ComputeRouteMatrixRequest result = + new com.google.maps.routing.v2.ComputeRouteMatrixRequest(this); + int from_bitField0_ = bitField0_; + if (originsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + origins_ = java.util.Collections.unmodifiableList(origins_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.origins_ = origins_; + } else { + result.origins_ = originsBuilder_.build(); + } + if (destinationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + destinations_ = java.util.Collections.unmodifiableList(destinations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.destinations_ = destinations_; + } else { + result.destinations_ = destinationsBuilder_.build(); + } + result.travelMode_ = travelMode_; + result.routingPreference_ = routingPreference_; + if (departureTimeBuilder_ == null) { + result.departureTime_ = departureTime_; + } else { + result.departureTime_ = departureTimeBuilder_.build(); + } + 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.routing.v2.ComputeRouteMatrixRequest) { + return mergeFrom((com.google.maps.routing.v2.ComputeRouteMatrixRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.ComputeRouteMatrixRequest other) { + if (other == com.google.maps.routing.v2.ComputeRouteMatrixRequest.getDefaultInstance()) + return this; + if (originsBuilder_ == null) { + if (!other.origins_.isEmpty()) { + if (origins_.isEmpty()) { + origins_ = other.origins_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOriginsIsMutable(); + origins_.addAll(other.origins_); + } + onChanged(); + } + } else { + if (!other.origins_.isEmpty()) { + if (originsBuilder_.isEmpty()) { + originsBuilder_.dispose(); + originsBuilder_ = null; + origins_ = other.origins_; + bitField0_ = (bitField0_ & ~0x00000001); + originsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOriginsFieldBuilder() + : null; + } else { + originsBuilder_.addAllMessages(other.origins_); + } + } + } + if (destinationsBuilder_ == null) { + if (!other.destinations_.isEmpty()) { + if (destinations_.isEmpty()) { + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDestinationsIsMutable(); + destinations_.addAll(other.destinations_); + } + onChanged(); + } + } else { + if (!other.destinations_.isEmpty()) { + if (destinationsBuilder_.isEmpty()) { + destinationsBuilder_.dispose(); + destinationsBuilder_ = null; + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000002); + destinationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDestinationsFieldBuilder() + : null; + } else { + destinationsBuilder_.addAllMessages(other.destinations_); + } + } + } + if (other.travelMode_ != 0) { + setTravelModeValue(other.getTravelModeValue()); + } + if (other.routingPreference_ != 0) { + setRoutingPreferenceValue(other.getRoutingPreferenceValue()); + } + if (other.hasDepartureTime()) { + mergeDepartureTime(other.getDepartureTime()); + } + 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.routing.v2.RouteMatrixOrigin m = + input.readMessage( + com.google.maps.routing.v2.RouteMatrixOrigin.parser(), extensionRegistry); + if (originsBuilder_ == null) { + ensureOriginsIsMutable(); + origins_.add(m); + } else { + originsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.maps.routing.v2.RouteMatrixDestination m = + input.readMessage( + com.google.maps.routing.v2.RouteMatrixDestination.parser(), + extensionRegistry); + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(m); + } else { + destinationsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + travelMode_ = input.readEnum(); + + break; + } // case 24 + case 32: + { + routingPreference_ = input.readEnum(); + + break; + } // case 32 + case 42: + { + input.readMessage(getDepartureTimeFieldBuilder().getBuilder(), extensionRegistry); + + 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 java.util.List origins_ = + java.util.Collections.emptyList(); + + private void ensureOriginsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + origins_ = new java.util.ArrayList(origins_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteMatrixOrigin, + com.google.maps.routing.v2.RouteMatrixOrigin.Builder, + com.google.maps.routing.v2.RouteMatrixOriginOrBuilder> + originsBuilder_; + + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getOriginsList() { + if (originsBuilder_ == null) { + return java.util.Collections.unmodifiableList(origins_); + } else { + return originsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getOriginsCount() { + if (originsBuilder_ == null) { + return origins_.size(); + } else { + return originsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixOrigin getOrigins(int index) { + if (originsBuilder_ == null) { + return origins_.get(index); + } else { + return originsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOrigins(int index, com.google.maps.routing.v2.RouteMatrixOrigin value) { + if (originsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOriginsIsMutable(); + origins_.set(index, value); + onChanged(); + } else { + originsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOrigins( + int index, com.google.maps.routing.v2.RouteMatrixOrigin.Builder builderForValue) { + if (originsBuilder_ == null) { + ensureOriginsIsMutable(); + origins_.set(index, builderForValue.build()); + onChanged(); + } else { + originsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addOrigins(com.google.maps.routing.v2.RouteMatrixOrigin value) { + if (originsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOriginsIsMutable(); + origins_.add(value); + onChanged(); + } else { + originsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addOrigins(int index, com.google.maps.routing.v2.RouteMatrixOrigin value) { + if (originsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOriginsIsMutable(); + origins_.add(index, value); + onChanged(); + } else { + originsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addOrigins( + com.google.maps.routing.v2.RouteMatrixOrigin.Builder builderForValue) { + if (originsBuilder_ == null) { + ensureOriginsIsMutable(); + origins_.add(builderForValue.build()); + onChanged(); + } else { + originsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addOrigins( + int index, com.google.maps.routing.v2.RouteMatrixOrigin.Builder builderForValue) { + if (originsBuilder_ == null) { + ensureOriginsIsMutable(); + origins_.add(index, builderForValue.build()); + onChanged(); + } else { + originsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllOrigins( + java.lang.Iterable values) { + if (originsBuilder_ == null) { + ensureOriginsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, origins_); + onChanged(); + } else { + originsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOrigins() { + if (originsBuilder_ == null) { + origins_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + originsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeOrigins(int index) { + if (originsBuilder_ == null) { + ensureOriginsIsMutable(); + origins_.remove(index); + onChanged(); + } else { + originsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixOrigin.Builder getOriginsBuilder(int index) { + return getOriginsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixOriginOrBuilder getOriginsOrBuilder(int index) { + if (originsBuilder_ == null) { + return origins_.get(index); + } else { + return originsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getOriginsOrBuilderList() { + if (originsBuilder_ != null) { + return originsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(origins_); + } + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixOrigin.Builder addOriginsBuilder() { + return getOriginsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.RouteMatrixOrigin.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixOrigin.Builder addOriginsBuilder(int index) { + return getOriginsFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.RouteMatrixOrigin.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Array of origins, which determines the rows of the response matrix.
+     * Several size restrictions apply to the cardinality of origins and
+     * destinations:
+     * * The number of elements (origins × destinations) must be no greater than
+     * 625 in any case.
+     * * The number of elements (origins × destinations) must be no greater than
+     * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+     * * The number of waypoints (origins + destinations) specified as `place_id`
+     * must be no greater than 50.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getOriginsBuilderList() { + return getOriginsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteMatrixOrigin, + com.google.maps.routing.v2.RouteMatrixOrigin.Builder, + com.google.maps.routing.v2.RouteMatrixOriginOrBuilder> + getOriginsFieldBuilder() { + if (originsBuilder_ == null) { + originsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteMatrixOrigin, + com.google.maps.routing.v2.RouteMatrixOrigin.Builder, + com.google.maps.routing.v2.RouteMatrixOriginOrBuilder>( + origins_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + origins_ = null; + } + return originsBuilder_; + } + + private java.util.List destinations_ = + java.util.Collections.emptyList(); + + private void ensureDestinationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + destinations_ = + new java.util.ArrayList( + destinations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteMatrixDestination, + com.google.maps.routing.v2.RouteMatrixDestination.Builder, + com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder> + destinationsBuilder_; + + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getDestinationsList() { + if (destinationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(destinations_); + } else { + return destinationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getDestinationsCount() { + if (destinationsBuilder_ == null) { + return destinations_.size(); + } else { + return destinationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixDestination getDestinations(int index) { + if (destinationsBuilder_ == null) { + return destinations_.get(index); + } else { + return destinationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDestinations( + int index, com.google.maps.routing.v2.RouteMatrixDestination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.set(index, value); + onChanged(); + } else { + destinationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDestinations( + int index, com.google.maps.routing.v2.RouteMatrixDestination.Builder builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.set(index, builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDestinations(com.google.maps.routing.v2.RouteMatrixDestination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + } else { + destinationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDestinations( + int index, com.google.maps.routing.v2.RouteMatrixDestination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(index, value); + onChanged(); + } else { + destinationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDestinations( + com.google.maps.routing.v2.RouteMatrixDestination.Builder builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDestinations( + int index, com.google.maps.routing.v2.RouteMatrixDestination.Builder builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(index, builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllDestinations( + java.lang.Iterable values) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, destinations_); + onChanged(); + } else { + destinationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDestinations() { + if (destinationsBuilder_ == null) { + destinations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + destinationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeDestinations(int index) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.remove(index); + onChanged(); + } else { + destinationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixDestination.Builder getDestinationsBuilder( + int index) { + return getDestinationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder getDestinationsOrBuilder( + int index) { + if (destinationsBuilder_ == null) { + return destinations_.get(index); + } else { + return destinationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getDestinationsOrBuilderList() { + if (destinationsBuilder_ != null) { + return destinationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(destinations_); + } + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixDestination.Builder addDestinationsBuilder() { + return getDestinationsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.RouteMatrixDestination.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.RouteMatrixDestination.Builder addDestinationsBuilder( + int index) { + return getDestinationsFieldBuilder() + .addBuilder( + index, com.google.maps.routing.v2.RouteMatrixDestination.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Array of destinations, which determines the columns of the response matrix.
+     * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getDestinationsBuilderList() { + return getDestinationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteMatrixDestination, + com.google.maps.routing.v2.RouteMatrixDestination.Builder, + com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder> + getDestinationsFieldBuilder() { + if (destinationsBuilder_ == null) { + destinationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteMatrixDestination, + com.google.maps.routing.v2.RouteMatrixDestination.Builder, + com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder>( + destinations_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + destinations_ = null; + } + return destinationsBuilder_; + } + + private int travelMode_ = 0; + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for travelMode. + */ + @java.lang.Override + public int getTravelModeValue() { + return travelMode_; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The travelMode. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelMode getTravelMode() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteTravelMode result = + com.google.maps.routing.v2.RouteTravelMode.valueOf(travelMode_); + return result == null ? com.google.maps.routing.v2.RouteTravelMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The travelMode to set. + * @return This builder for chaining. + */ + public Builder setTravelMode(com.google.maps.routing.v2.RouteTravelMode value) { + if (value == null) { + throw new NullPointerException(); + } + + travelMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTravelMode() { + + travelMode_ = 0; + onChanged(); + return this; + } + + private int routingPreference_ = 0; + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server attempts to use the selected
+     * routing preference to compute the route. If the routing preference results
+     * in an error or an extra long latency, an error is returned. In the future,
+     * we might implement a fallback mechanism to use a different option when the
+     * preferred option does not give a valid result. You can specify this option
+     * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+     * request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for routingPreference. + */ + @java.lang.Override + public int getRoutingPreferenceValue() { + return routingPreference_; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server attempts to use the selected
+     * routing preference to compute the route. If the routing preference results
+     * in an error or an extra long latency, an error is returned. In the future,
+     * we might implement a fallback mechanism to use a different option when the
+     * preferred option does not give a valid result. You can specify this option
+     * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+     * request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for routingPreference to set. + * @return This builder for chaining. + */ + public Builder setRoutingPreferenceValue(int value) { + + routingPreference_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server attempts to use the selected
+     * routing preference to compute the route. If the routing preference results
+     * in an error or an extra long latency, an error is returned. In the future,
+     * we might implement a fallback mechanism to use a different option when the
+     * preferred option does not give a valid result. You can specify this option
+     * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+     * request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingPreference. + */ + @java.lang.Override + public com.google.maps.routing.v2.RoutingPreference getRoutingPreference() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RoutingPreference result = + com.google.maps.routing.v2.RoutingPreference.valueOf(routingPreference_); + return result == null ? com.google.maps.routing.v2.RoutingPreference.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server attempts to use the selected
+     * routing preference to compute the route. If the routing preference results
+     * in an error or an extra long latency, an error is returned. In the future,
+     * we might implement a fallback mechanism to use a different option when the
+     * preferred option does not give a valid result. You can specify this option
+     * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+     * request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The routingPreference to set. + * @return This builder for chaining. + */ + public Builder setRoutingPreference(com.google.maps.routing.v2.RoutingPreference value) { + if (value == null) { + throw new NullPointerException(); + } + + routingPreference_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server attempts to use the selected
+     * routing preference to compute the route. If the routing preference results
+     * in an error or an extra long latency, an error is returned. In the future,
+     * we might implement a fallback mechanism to use a different option when the
+     * preferred option does not give a valid result. You can specify this option
+     * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+     * request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRoutingPreference() { + + routingPreference_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp departureTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + departureTimeBuilder_; + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the departureTime field is set. + */ + public boolean hasDepartureTime() { + return departureTimeBuilder_ != null || departureTime_ != null; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The departureTime. + */ + public com.google.protobuf.Timestamp getDepartureTime() { + if (departureTimeBuilder_ == null) { + return departureTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : departureTime_; + } else { + return departureTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDepartureTime(com.google.protobuf.Timestamp value) { + if (departureTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + departureTime_ = value; + onChanged(); + } else { + departureTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDepartureTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (departureTimeBuilder_ == null) { + departureTime_ = builderForValue.build(); + onChanged(); + } else { + departureTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDepartureTime(com.google.protobuf.Timestamp value) { + if (departureTimeBuilder_ == null) { + if (departureTime_ != null) { + departureTime_ = + com.google.protobuf.Timestamp.newBuilder(departureTime_) + .mergeFrom(value) + .buildPartial(); + } else { + departureTime_ = value; + } + onChanged(); + } else { + departureTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDepartureTime() { + if (departureTimeBuilder_ == null) { + departureTime_ = null; + onChanged(); + } else { + departureTime_ = null; + departureTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getDepartureTimeBuilder() { + + onChanged(); + return getDepartureTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDepartureTimeOrBuilder() { + if (departureTimeBuilder_ != null) { + return departureTimeBuilder_.getMessageOrBuilder(); + } else { + return departureTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : departureTime_; + } + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, this defaults to the time
+     * that you made the request. If you set this value to a time that has already
+     * occurred, the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDepartureTimeFieldBuilder() { + if (departureTimeBuilder_ == null) { + departureTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDepartureTime(), getParentForChildren(), isClean()); + departureTime_ = null; + } + return departureTimeBuilder_; + } + + @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.routing.v2.ComputeRouteMatrixRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.ComputeRouteMatrixRequest) + private static final com.google.maps.routing.v2.ComputeRouteMatrixRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.ComputeRouteMatrixRequest(); + } + + public static com.google.maps.routing.v2.ComputeRouteMatrixRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComputeRouteMatrixRequest 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.routing.v2.ComputeRouteMatrixRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRouteMatrixRequestOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRouteMatrixRequestOrBuilder.java new file mode 100644 index 000000000000..6e7f1ef478d8 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRouteMatrixRequestOrBuilder.java @@ -0,0 +1,303 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public interface ComputeRouteMatrixRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.ComputeRouteMatrixRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getOriginsList(); + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.RouteMatrixOrigin getOrigins(int index); + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getOriginsCount(); + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getOriginsOrBuilderList(); + /** + * + * + *
+   * Required. Array of origins, which determines the rows of the response matrix.
+   * Several size restrictions apply to the cardinality of origins and
+   * destinations:
+   * * The number of elements (origins × destinations) must be no greater than
+   * 625 in any case.
+   * * The number of elements (origins × destinations) must be no greater than
+   * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
+   * * The number of waypoints (origins + destinations) specified as `place_id`
+   * must be no greater than 50.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixOrigin origins = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.RouteMatrixOriginOrBuilder getOriginsOrBuilder(int index); + + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getDestinationsList(); + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.RouteMatrixDestination getDestinations(int index); + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getDestinationsCount(); + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getDestinationsOrBuilderList(); + /** + * + * + *
+   * Required. Array of destinations, which determines the columns of the response matrix.
+   * 
+ * + * + * repeated .google.maps.routing.v2.RouteMatrixDestination destinations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder getDestinationsOrBuilder(int index); + + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for travelMode. + */ + int getTravelModeValue(); + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The travelMode. + */ + com.google.maps.routing.v2.RouteTravelMode getTravelMode(); + + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server attempts to use the selected
+   * routing preference to compute the route. If the routing preference results
+   * in an error or an extra long latency, an error is returned. In the future,
+   * we might implement a fallback mechanism to use a different option when the
+   * preferred option does not give a valid result. You can specify this option
+   * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+   * request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for routingPreference. + */ + int getRoutingPreferenceValue(); + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server attempts to use the selected
+   * routing preference to compute the route. If the routing preference results
+   * in an error or an extra long latency, an error is returned. In the future,
+   * we might implement a fallback mechanism to use a different option when the
+   * preferred option does not give a valid result. You can specify this option
+   * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
+   * request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingPreference. + */ + com.google.maps.routing.v2.RoutingPreference getRoutingPreference(); + + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, this defaults to the time
+   * that you made the request. If you set this value to a time that has already
+   * occurred, the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the departureTime field is set. + */ + boolean hasDepartureTime(); + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, this defaults to the time
+   * that you made the request. If you set this value to a time that has already
+   * occurred, the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The departureTime. + */ + com.google.protobuf.Timestamp getDepartureTime(); + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, this defaults to the time
+   * that you made the request. If you set this value to a time that has already
+   * occurred, the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getDepartureTimeOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesRequest.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesRequest.java new file mode 100644 index 000000000000..86bd34992e8b --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesRequest.java @@ -0,0 +1,4043 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * ComputeRoutes request message.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.ComputeRoutesRequest} + */ +public final class ComputeRoutesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.ComputeRoutesRequest) + ComputeRoutesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComputeRoutesRequest.newBuilder() to construct. + private ComputeRoutesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComputeRoutesRequest() { + intermediates_ = java.util.Collections.emptyList(); + travelMode_ = 0; + routingPreference_ = 0; + polylineQuality_ = 0; + polylineEncoding_ = 0; + languageCode_ = ""; + units_ = 0; + requestedReferenceRoutes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComputeRoutesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.ComputeRoutesRequest.class, + com.google.maps.routing.v2.ComputeRoutesRequest.Builder.class); + } + + /** + * + * + *
+   * A supported reference route on the ComputeRoutesRequest.
+   * 
+ * + * Protobuf enum {@code google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute} + */ + public enum ReferenceRoute implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not used. Requests containing this value fail.
+     * 
+ * + * REFERENCE_ROUTE_UNSPECIFIED = 0; + */ + REFERENCE_ROUTE_UNSPECIFIED(0), + /** + * + * + *
+     * Fuel efficient route. Routes labeled with this value are determined to be
+     * optimized for parameters such as fuel consumption.
+     * 
+ * + * FUEL_EFFICIENT = 1; + */ + FUEL_EFFICIENT(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not used. Requests containing this value fail.
+     * 
+ * + * REFERENCE_ROUTE_UNSPECIFIED = 0; + */ + public static final int REFERENCE_ROUTE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Fuel efficient route. Routes labeled with this value are determined to be
+     * optimized for parameters such as fuel consumption.
+     * 
+ * + * FUEL_EFFICIENT = 1; + */ + public static final int FUEL_EFFICIENT_VALUE = 1; + + 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 ReferenceRoute 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 ReferenceRoute forNumber(int value) { + switch (value) { + case 0: + return REFERENCE_ROUTE_UNSPECIFIED; + case 1: + return FUEL_EFFICIENT; + 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 ReferenceRoute findValueByNumber(int number) { + return ReferenceRoute.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.routing.v2.ComputeRoutesRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final ReferenceRoute[] VALUES = values(); + + public static ReferenceRoute 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 ReferenceRoute(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute) + } + + public static final int ORIGIN_FIELD_NUMBER = 1; + private com.google.maps.routing.v2.Waypoint origin_; + /** + * + * + *
+   * Required. Origin waypoint.
+   * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the origin field is set. + */ + @java.lang.Override + public boolean hasOrigin() { + return origin_ != null; + } + /** + * + * + *
+   * Required. Origin waypoint.
+   * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The origin. + */ + @java.lang.Override + public com.google.maps.routing.v2.Waypoint getOrigin() { + return origin_ == null ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() : origin_; + } + /** + * + * + *
+   * Required. Origin waypoint.
+   * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.WaypointOrBuilder getOriginOrBuilder() { + return getOrigin(); + } + + public static final int DESTINATION_FIELD_NUMBER = 2; + private com.google.maps.routing.v2.Waypoint destination_; + /** + * + * + *
+   * Required. Destination waypoint.
+   * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the destination field is set. + */ + @java.lang.Override + public boolean hasDestination() { + return destination_ != null; + } + /** + * + * + *
+   * Required. Destination waypoint.
+   * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The destination. + */ + @java.lang.Override + public com.google.maps.routing.v2.Waypoint getDestination() { + return destination_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : destination_; + } + /** + * + * + *
+   * Required. Destination waypoint.
+   * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.WaypointOrBuilder getDestinationOrBuilder() { + return getDestination(); + } + + public static final int INTERMEDIATES_FIELD_NUMBER = 3; + private java.util.List intermediates_; + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getIntermediatesList() { + return intermediates_; + } + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getIntermediatesOrBuilderList() { + return intermediates_; + } + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getIntermediatesCount() { + return intermediates_.size(); + } + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.Waypoint getIntermediates(int index) { + return intermediates_.get(index); + } + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.WaypointOrBuilder getIntermediatesOrBuilder(int index) { + return intermediates_.get(index); + } + + public static final int TRAVEL_MODE_FIELD_NUMBER = 4; + private int travelMode_; + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for travelMode. + */ + @java.lang.Override + public int getTravelModeValue() { + return travelMode_; + } + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The travelMode. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelMode getTravelMode() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteTravelMode result = + com.google.maps.routing.v2.RouteTravelMode.valueOf(travelMode_); + return result == null ? com.google.maps.routing.v2.RouteTravelMode.UNRECOGNIZED : result; + } + + public static final int ROUTING_PREFERENCE_FIELD_NUMBER = 5; + private int routingPreference_; + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server
+   * attempts to use the selected routing preference to compute the route. If
+   *  the routing preference results in an error or an extra long latency, then
+   * an error is returned. In the future, we might implement a fallback
+   * mechanism to use a different option when the preferred option does not give
+   * a valid result. You can specify this option only when the `travel_mode` is
+   * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for routingPreference. + */ + @java.lang.Override + public int getRoutingPreferenceValue() { + return routingPreference_; + } + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server
+   * attempts to use the selected routing preference to compute the route. If
+   *  the routing preference results in an error or an extra long latency, then
+   * an error is returned. In the future, we might implement a fallback
+   * mechanism to use a different option when the preferred option does not give
+   * a valid result. You can specify this option only when the `travel_mode` is
+   * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingPreference. + */ + @java.lang.Override + public com.google.maps.routing.v2.RoutingPreference getRoutingPreference() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RoutingPreference result = + com.google.maps.routing.v2.RoutingPreference.valueOf(routingPreference_); + return result == null ? com.google.maps.routing.v2.RoutingPreference.UNRECOGNIZED : result; + } + + public static final int POLYLINE_QUALITY_FIELD_NUMBER = 6; + private int polylineQuality_; + /** + * + * + *
+   * Optional. Specifies your preference for the quality of the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for polylineQuality. + */ + @java.lang.Override + public int getPolylineQualityValue() { + return polylineQuality_; + } + /** + * + * + *
+   * Optional. Specifies your preference for the quality of the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The polylineQuality. + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineQuality getPolylineQuality() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.PolylineQuality result = + com.google.maps.routing.v2.PolylineQuality.valueOf(polylineQuality_); + return result == null ? com.google.maps.routing.v2.PolylineQuality.UNRECOGNIZED : result; + } + + public static final int POLYLINE_ENCODING_FIELD_NUMBER = 12; + private int polylineEncoding_; + /** + * + * + *
+   * Optional. Specifies the preferred encoding for the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for polylineEncoding. + */ + @java.lang.Override + public int getPolylineEncodingValue() { + return polylineEncoding_; + } + /** + * + * + *
+   * Optional. Specifies the preferred encoding for the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The polylineEncoding. + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineEncoding getPolylineEncoding() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.PolylineEncoding result = + com.google.maps.routing.v2.PolylineEncoding.valueOf(polylineEncoding_); + return result == null ? com.google.maps.routing.v2.PolylineEncoding.UNRECOGNIZED : result; + } + + public static final int DEPARTURE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp departureTime_; + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, then this value
+   * defaults to the time that you made the request. If you set this value to a
+   * time that has already occurred, then the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the departureTime field is set. + */ + @java.lang.Override + public boolean hasDepartureTime() { + return departureTime_ != null; + } + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, then this value
+   * defaults to the time that you made the request. If you set this value to a
+   * time that has already occurred, then the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The departureTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDepartureTime() { + return departureTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : departureTime_; + } + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, then this value
+   * defaults to the time that you made the request. If you set this value to a
+   * time that has already occurred, then the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDepartureTimeOrBuilder() { + return getDepartureTime(); + } + + public static final int COMPUTE_ALTERNATIVE_ROUTES_FIELD_NUMBER = 8; + private boolean computeAlternativeRoutes_; + /** + * + * + *
+   * Optional. Specifies whether to calculate alternate routes in addition to the route.
+   * 
+ * + * bool compute_alternative_routes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The computeAlternativeRoutes. + */ + @java.lang.Override + public boolean getComputeAlternativeRoutes() { + return computeAlternativeRoutes_; + } + + public static final int ROUTE_MODIFIERS_FIELD_NUMBER = 9; + private com.google.maps.routing.v2.RouteModifiers routeModifiers_; + /** + * + * + *
+   * Optional. A set of conditions to satisfy that affect the way routes are
+   * calculated.
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routeModifiers field is set. + */ + @java.lang.Override + public boolean hasRouteModifiers() { + return routeModifiers_ != null; + } + /** + * + * + *
+   * Optional. A set of conditions to satisfy that affect the way routes are
+   * calculated.
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routeModifiers. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiers getRouteModifiers() { + return routeModifiers_ == null + ? com.google.maps.routing.v2.RouteModifiers.getDefaultInstance() + : routeModifiers_; + } + /** + * + * + *
+   * Optional. A set of conditions to satisfy that affect the way routes are
+   * calculated.
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiersOrBuilder getRouteModifiersOrBuilder() { + return getRouteModifiers(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 10; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+   * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+   * for the list of supported languages. When you don't provide this value, the
+   * display language is inferred from the location of the route request.
+   * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+   * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+   * for the list of supported languages. When you don't provide this value, the
+   * display language is inferred from the location of the route request.
+   * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNITS_FIELD_NUMBER = 11; + private int units_; + /** + * + * + *
+   * Optional. Specifies the units of measure for the display fields. This
+   * includes the `instruction` field in `NavigationInstruction`. The units of
+   * measure used for the route, leg, step distance, and duration are not
+   * affected by this value. If you don't provide this value, then the display
+   * units are inferred from the location of the request.
+   * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for units. + */ + @java.lang.Override + public int getUnitsValue() { + return units_; + } + /** + * + * + *
+   * Optional. Specifies the units of measure for the display fields. This
+   * includes the `instruction` field in `NavigationInstruction`. The units of
+   * measure used for the route, leg, step distance, and duration are not
+   * affected by this value. If you don't provide this value, then the display
+   * units are inferred from the location of the request.
+   * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The units. + */ + @java.lang.Override + public com.google.maps.routing.v2.Units getUnits() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.Units result = com.google.maps.routing.v2.Units.valueOf(units_); + return result == null ? com.google.maps.routing.v2.Units.UNRECOGNIZED : result; + } + + public static final int REQUESTED_REFERENCE_ROUTES_FIELD_NUMBER = 14; + private java.util.List requestedReferenceRoutes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute> + requestedReferenceRoutes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute>() { + public com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute result = + com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute.valueOf(from); + return result == null + ? com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the requestedReferenceRoutes. + */ + @java.lang.Override + public java.util.List + getRequestedReferenceRoutesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute>( + requestedReferenceRoutes_, requestedReferenceRoutes_converter_); + } + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of requestedReferenceRoutes. + */ + @java.lang.Override + public int getRequestedReferenceRoutesCount() { + return requestedReferenceRoutes_.size(); + } + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The requestedReferenceRoutes at the given index. + */ + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute getRequestedReferenceRoutes( + int index) { + return requestedReferenceRoutes_converter_.convert(requestedReferenceRoutes_.get(index)); + } + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for requestedReferenceRoutes. + */ + @java.lang.Override + public java.util.List getRequestedReferenceRoutesValueList() { + return requestedReferenceRoutes_; + } + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of requestedReferenceRoutes at the given index. + */ + @java.lang.Override + public int getRequestedReferenceRoutesValue(int index) { + return requestedReferenceRoutes_.get(index); + } + + private int requestedReferenceRoutesMemoizedSerializedSize; + + 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(); + if (origin_ != null) { + output.writeMessage(1, getOrigin()); + } + if (destination_ != null) { + output.writeMessage(2, getDestination()); + } + for (int i = 0; i < intermediates_.size(); i++) { + output.writeMessage(3, intermediates_.get(i)); + } + if (travelMode_ + != com.google.maps.routing.v2.RouteTravelMode.TRAVEL_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, travelMode_); + } + if (routingPreference_ + != com.google.maps.routing.v2.RoutingPreference.ROUTING_PREFERENCE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, routingPreference_); + } + if (polylineQuality_ + != com.google.maps.routing.v2.PolylineQuality.POLYLINE_QUALITY_UNSPECIFIED.getNumber()) { + output.writeEnum(6, polylineQuality_); + } + if (departureTime_ != null) { + output.writeMessage(7, getDepartureTime()); + } + if (computeAlternativeRoutes_ != false) { + output.writeBool(8, computeAlternativeRoutes_); + } + if (routeModifiers_ != null) { + output.writeMessage(9, getRouteModifiers()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, languageCode_); + } + if (units_ != com.google.maps.routing.v2.Units.UNITS_UNSPECIFIED.getNumber()) { + output.writeEnum(11, units_); + } + if (polylineEncoding_ + != com.google.maps.routing.v2.PolylineEncoding.POLYLINE_ENCODING_UNSPECIFIED.getNumber()) { + output.writeEnum(12, polylineEncoding_); + } + if (getRequestedReferenceRoutesList().size() > 0) { + output.writeUInt32NoTag(114); + output.writeUInt32NoTag(requestedReferenceRoutesMemoizedSerializedSize); + } + for (int i = 0; i < requestedReferenceRoutes_.size(); i++) { + output.writeEnumNoTag(requestedReferenceRoutes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (origin_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOrigin()); + } + if (destination_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDestination()); + } + for (int i = 0; i < intermediates_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, intermediates_.get(i)); + } + if (travelMode_ + != com.google.maps.routing.v2.RouteTravelMode.TRAVEL_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, travelMode_); + } + if (routingPreference_ + != com.google.maps.routing.v2.RoutingPreference.ROUTING_PREFERENCE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, routingPreference_); + } + if (polylineQuality_ + != com.google.maps.routing.v2.PolylineQuality.POLYLINE_QUALITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, polylineQuality_); + } + if (departureTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDepartureTime()); + } + if (computeAlternativeRoutes_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, computeAlternativeRoutes_); + } + if (routeModifiers_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getRouteModifiers()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, languageCode_); + } + if (units_ != com.google.maps.routing.v2.Units.UNITS_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, units_); + } + if (polylineEncoding_ + != com.google.maps.routing.v2.PolylineEncoding.POLYLINE_ENCODING_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, polylineEncoding_); + } + { + int dataSize = 0; + for (int i = 0; i < requestedReferenceRoutes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + requestedReferenceRoutes_.get(i)); + } + size += dataSize; + if (!getRequestedReferenceRoutesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + requestedReferenceRoutesMemoizedSerializedSize = 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.routing.v2.ComputeRoutesRequest)) { + return super.equals(obj); + } + com.google.maps.routing.v2.ComputeRoutesRequest other = + (com.google.maps.routing.v2.ComputeRoutesRequest) obj; + + if (hasOrigin() != other.hasOrigin()) return false; + if (hasOrigin()) { + if (!getOrigin().equals(other.getOrigin())) return false; + } + if (hasDestination() != other.hasDestination()) return false; + if (hasDestination()) { + if (!getDestination().equals(other.getDestination())) return false; + } + if (!getIntermediatesList().equals(other.getIntermediatesList())) return false; + if (travelMode_ != other.travelMode_) return false; + if (routingPreference_ != other.routingPreference_) return false; + if (polylineQuality_ != other.polylineQuality_) return false; + if (polylineEncoding_ != other.polylineEncoding_) return false; + if (hasDepartureTime() != other.hasDepartureTime()) return false; + if (hasDepartureTime()) { + if (!getDepartureTime().equals(other.getDepartureTime())) return false; + } + if (getComputeAlternativeRoutes() != other.getComputeAlternativeRoutes()) return false; + if (hasRouteModifiers() != other.hasRouteModifiers()) return false; + if (hasRouteModifiers()) { + if (!getRouteModifiers().equals(other.getRouteModifiers())) return false; + } + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (units_ != other.units_) return false; + if (!requestedReferenceRoutes_.equals(other.requestedReferenceRoutes_)) 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 (hasOrigin()) { + hash = (37 * hash) + ORIGIN_FIELD_NUMBER; + hash = (53 * hash) + getOrigin().hashCode(); + } + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (getIntermediatesCount() > 0) { + hash = (37 * hash) + INTERMEDIATES_FIELD_NUMBER; + hash = (53 * hash) + getIntermediatesList().hashCode(); + } + hash = (37 * hash) + TRAVEL_MODE_FIELD_NUMBER; + hash = (53 * hash) + travelMode_; + hash = (37 * hash) + ROUTING_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + routingPreference_; + hash = (37 * hash) + POLYLINE_QUALITY_FIELD_NUMBER; + hash = (53 * hash) + polylineQuality_; + hash = (37 * hash) + POLYLINE_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + polylineEncoding_; + if (hasDepartureTime()) { + hash = (37 * hash) + DEPARTURE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDepartureTime().hashCode(); + } + hash = (37 * hash) + COMPUTE_ALTERNATIVE_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getComputeAlternativeRoutes()); + if (hasRouteModifiers()) { + hash = (37 * hash) + ROUTE_MODIFIERS_FIELD_NUMBER; + hash = (53 * hash) + getRouteModifiers().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (37 * hash) + UNITS_FIELD_NUMBER; + hash = (53 * hash) + units_; + if (getRequestedReferenceRoutesCount() > 0) { + hash = (37 * hash) + REQUESTED_REFERENCE_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + requestedReferenceRoutes_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest 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.routing.v2.ComputeRoutesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest 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.routing.v2.ComputeRoutesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest 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.routing.v2.ComputeRoutesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest 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.routing.v2.ComputeRoutesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest 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.routing.v2.ComputeRoutesRequest 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; + } + /** + * + * + *
+   * ComputeRoutes request message.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.ComputeRoutesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.ComputeRoutesRequest) + com.google.maps.routing.v2.ComputeRoutesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.ComputeRoutesRequest.class, + com.google.maps.routing.v2.ComputeRoutesRequest.Builder.class); + } + + // Construct using com.google.maps.routing.v2.ComputeRoutesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (originBuilder_ == null) { + origin_ = null; + } else { + origin_ = null; + originBuilder_ = null; + } + if (destinationBuilder_ == null) { + destination_ = null; + } else { + destination_ = null; + destinationBuilder_ = null; + } + if (intermediatesBuilder_ == null) { + intermediates_ = java.util.Collections.emptyList(); + } else { + intermediates_ = null; + intermediatesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + travelMode_ = 0; + + routingPreference_ = 0; + + polylineQuality_ = 0; + + polylineEncoding_ = 0; + + if (departureTimeBuilder_ == null) { + departureTime_ = null; + } else { + departureTime_ = null; + departureTimeBuilder_ = null; + } + computeAlternativeRoutes_ = false; + + if (routeModifiersBuilder_ == null) { + routeModifiers_ = null; + } else { + routeModifiers_ = null; + routeModifiersBuilder_ = null; + } + languageCode_ = ""; + + units_ = 0; + + requestedReferenceRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesRequest getDefaultInstanceForType() { + return com.google.maps.routing.v2.ComputeRoutesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesRequest build() { + com.google.maps.routing.v2.ComputeRoutesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesRequest buildPartial() { + com.google.maps.routing.v2.ComputeRoutesRequest result = + new com.google.maps.routing.v2.ComputeRoutesRequest(this); + int from_bitField0_ = bitField0_; + if (originBuilder_ == null) { + result.origin_ = origin_; + } else { + result.origin_ = originBuilder_.build(); + } + if (destinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = destinationBuilder_.build(); + } + if (intermediatesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + intermediates_ = java.util.Collections.unmodifiableList(intermediates_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.intermediates_ = intermediates_; + } else { + result.intermediates_ = intermediatesBuilder_.build(); + } + result.travelMode_ = travelMode_; + result.routingPreference_ = routingPreference_; + result.polylineQuality_ = polylineQuality_; + result.polylineEncoding_ = polylineEncoding_; + if (departureTimeBuilder_ == null) { + result.departureTime_ = departureTime_; + } else { + result.departureTime_ = departureTimeBuilder_.build(); + } + result.computeAlternativeRoutes_ = computeAlternativeRoutes_; + if (routeModifiersBuilder_ == null) { + result.routeModifiers_ = routeModifiers_; + } else { + result.routeModifiers_ = routeModifiersBuilder_.build(); + } + result.languageCode_ = languageCode_; + result.units_ = units_; + if (((bitField0_ & 0x00000002) != 0)) { + requestedReferenceRoutes_ = + java.util.Collections.unmodifiableList(requestedReferenceRoutes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.requestedReferenceRoutes_ = requestedReferenceRoutes_; + 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.routing.v2.ComputeRoutesRequest) { + return mergeFrom((com.google.maps.routing.v2.ComputeRoutesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.ComputeRoutesRequest other) { + if (other == com.google.maps.routing.v2.ComputeRoutesRequest.getDefaultInstance()) + return this; + if (other.hasOrigin()) { + mergeOrigin(other.getOrigin()); + } + if (other.hasDestination()) { + mergeDestination(other.getDestination()); + } + if (intermediatesBuilder_ == null) { + if (!other.intermediates_.isEmpty()) { + if (intermediates_.isEmpty()) { + intermediates_ = other.intermediates_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIntermediatesIsMutable(); + intermediates_.addAll(other.intermediates_); + } + onChanged(); + } + } else { + if (!other.intermediates_.isEmpty()) { + if (intermediatesBuilder_.isEmpty()) { + intermediatesBuilder_.dispose(); + intermediatesBuilder_ = null; + intermediates_ = other.intermediates_; + bitField0_ = (bitField0_ & ~0x00000001); + intermediatesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntermediatesFieldBuilder() + : null; + } else { + intermediatesBuilder_.addAllMessages(other.intermediates_); + } + } + } + if (other.travelMode_ != 0) { + setTravelModeValue(other.getTravelModeValue()); + } + if (other.routingPreference_ != 0) { + setRoutingPreferenceValue(other.getRoutingPreferenceValue()); + } + if (other.polylineQuality_ != 0) { + setPolylineQualityValue(other.getPolylineQualityValue()); + } + if (other.polylineEncoding_ != 0) { + setPolylineEncodingValue(other.getPolylineEncodingValue()); + } + if (other.hasDepartureTime()) { + mergeDepartureTime(other.getDepartureTime()); + } + if (other.getComputeAlternativeRoutes() != false) { + setComputeAlternativeRoutes(other.getComputeAlternativeRoutes()); + } + if (other.hasRouteModifiers()) { + mergeRouteModifiers(other.getRouteModifiers()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (other.units_ != 0) { + setUnitsValue(other.getUnitsValue()); + } + if (!other.requestedReferenceRoutes_.isEmpty()) { + if (requestedReferenceRoutes_.isEmpty()) { + requestedReferenceRoutes_ = other.requestedReferenceRoutes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.addAll(other.requestedReferenceRoutes_); + } + 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(getOriginFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getDestinationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + com.google.maps.routing.v2.Waypoint m = + input.readMessage( + com.google.maps.routing.v2.Waypoint.parser(), extensionRegistry); + if (intermediatesBuilder_ == null) { + ensureIntermediatesIsMutable(); + intermediates_.add(m); + } else { + intermediatesBuilder_.addMessage(m); + } + break; + } // case 26 + case 32: + { + travelMode_ = input.readEnum(); + + break; + } // case 32 + case 40: + { + routingPreference_ = input.readEnum(); + + break; + } // case 40 + case 48: + { + polylineQuality_ = input.readEnum(); + + break; + } // case 48 + case 58: + { + input.readMessage(getDepartureTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 64: + { + computeAlternativeRoutes_ = input.readBool(); + + break; + } // case 64 + case 74: + { + input.readMessage(getRouteModifiersFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 82: + { + languageCode_ = input.readStringRequireUtf8(); + + break; + } // case 82 + case 88: + { + units_ = input.readEnum(); + + break; + } // case 88 + case 96: + { + polylineEncoding_ = input.readEnum(); + + break; + } // case 96 + case 112: + { + int tmpRaw = input.readEnum(); + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.add(tmpRaw); + break; + } // case 112 + case 114: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 com.google.maps.routing.v2.Waypoint origin_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + originBuilder_; + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the origin field is set. + */ + public boolean hasOrigin() { + return originBuilder_ != null || origin_ != null; + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The origin. + */ + public com.google.maps.routing.v2.Waypoint getOrigin() { + if (originBuilder_ == null) { + return origin_ == null ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() : origin_; + } else { + return originBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOrigin(com.google.maps.routing.v2.Waypoint value) { + if (originBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + origin_ = value; + onChanged(); + } else { + originBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOrigin(com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (originBuilder_ == null) { + origin_ = builderForValue.build(); + onChanged(); + } else { + originBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOrigin(com.google.maps.routing.v2.Waypoint value) { + if (originBuilder_ == null) { + if (origin_ != null) { + origin_ = + com.google.maps.routing.v2.Waypoint.newBuilder(origin_) + .mergeFrom(value) + .buildPartial(); + } else { + origin_ = value; + } + onChanged(); + } else { + originBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOrigin() { + if (originBuilder_ == null) { + origin_ = null; + onChanged(); + } else { + origin_ = null; + originBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder getOriginBuilder() { + + onChanged(); + return getOriginFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.WaypointOrBuilder getOriginOrBuilder() { + if (originBuilder_ != null) { + return originBuilder_.getMessageOrBuilder(); + } else { + return origin_ == null ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() : origin_; + } + } + /** + * + * + *
+     * Required. Origin waypoint.
+     * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + getOriginFieldBuilder() { + if (originBuilder_ == null) { + originBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder>( + getOrigin(), getParentForChildren(), isClean()); + origin_ = null; + } + return originBuilder_; + } + + private com.google.maps.routing.v2.Waypoint destination_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + destinationBuilder_; + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the destination field is set. + */ + public boolean hasDestination() { + return destinationBuilder_ != null || destination_ != null; + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The destination. + */ + public com.google.maps.routing.v2.Waypoint getDestination() { + if (destinationBuilder_ == null) { + return destination_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : destination_; + } else { + return destinationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDestination(com.google.maps.routing.v2.Waypoint value) { + if (destinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + destinationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDestination(com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (destinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + destinationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDestination(com.google.maps.routing.v2.Waypoint value) { + if (destinationBuilder_ == null) { + if (destination_ != null) { + destination_ = + com.google.maps.routing.v2.Waypoint.newBuilder(destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + destinationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDestination() { + if (destinationBuilder_ == null) { + destination_ = null; + onChanged(); + } else { + destination_ = null; + destinationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder getDestinationBuilder() { + + onChanged(); + return getDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.WaypointOrBuilder getDestinationOrBuilder() { + if (destinationBuilder_ != null) { + return destinationBuilder_.getMessageOrBuilder(); + } else { + return destination_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : destination_; + } + } + /** + * + * + *
+     * Required. Destination waypoint.
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + getDestinationFieldBuilder() { + if (destinationBuilder_ == null) { + destinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder>( + getDestination(), getParentForChildren(), isClean()); + destination_ = null; + } + return destinationBuilder_; + } + + private java.util.List intermediates_ = + java.util.Collections.emptyList(); + + private void ensureIntermediatesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + intermediates_ = + new java.util.ArrayList(intermediates_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + intermediatesBuilder_; + + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getIntermediatesList() { + if (intermediatesBuilder_ == null) { + return java.util.Collections.unmodifiableList(intermediates_); + } else { + return intermediatesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getIntermediatesCount() { + if (intermediatesBuilder_ == null) { + return intermediates_.size(); + } else { + return intermediatesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.Waypoint getIntermediates(int index) { + if (intermediatesBuilder_ == null) { + return intermediates_.get(index); + } else { + return intermediatesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIntermediates(int index, com.google.maps.routing.v2.Waypoint value) { + if (intermediatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntermediatesIsMutable(); + intermediates_.set(index, value); + onChanged(); + } else { + intermediatesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIntermediates( + int index, com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (intermediatesBuilder_ == null) { + ensureIntermediatesIsMutable(); + intermediates_.set(index, builderForValue.build()); + onChanged(); + } else { + intermediatesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIntermediates(com.google.maps.routing.v2.Waypoint value) { + if (intermediatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntermediatesIsMutable(); + intermediates_.add(value); + onChanged(); + } else { + intermediatesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIntermediates(int index, com.google.maps.routing.v2.Waypoint value) { + if (intermediatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntermediatesIsMutable(); + intermediates_.add(index, value); + onChanged(); + } else { + intermediatesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIntermediates(com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (intermediatesBuilder_ == null) { + ensureIntermediatesIsMutable(); + intermediates_.add(builderForValue.build()); + onChanged(); + } else { + intermediatesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIntermediates( + int index, com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (intermediatesBuilder_ == null) { + ensureIntermediatesIsMutable(); + intermediates_.add(index, builderForValue.build()); + onChanged(); + } else { + intermediatesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllIntermediates( + java.lang.Iterable values) { + if (intermediatesBuilder_ == null) { + ensureIntermediatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intermediates_); + onChanged(); + } else { + intermediatesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIntermediates() { + if (intermediatesBuilder_ == null) { + intermediates_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + intermediatesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeIntermediates(int index) { + if (intermediatesBuilder_ == null) { + ensureIntermediatesIsMutable(); + intermediates_.remove(index); + onChanged(); + } else { + intermediatesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder getIntermediatesBuilder(int index) { + return getIntermediatesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.WaypointOrBuilder getIntermediatesOrBuilder(int index) { + if (intermediatesBuilder_ == null) { + return intermediates_.get(index); + } else { + return intermediatesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getIntermediatesOrBuilderList() { + if (intermediatesBuilder_ != null) { + return intermediatesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(intermediates_); + } + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder addIntermediatesBuilder() { + return getIntermediatesFieldBuilder() + .addBuilder(com.google.maps.routing.v2.Waypoint.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder addIntermediatesBuilder(int index) { + return getIntermediatesFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.Waypoint.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A set of waypoints along the route (excluding terminal points),
+     * for either stopping at or passing by. Up to 25 intermediate waypoints are
+     * supported.
+     * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getIntermediatesBuilderList() { + return getIntermediatesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + getIntermediatesFieldBuilder() { + if (intermediatesBuilder_ == null) { + intermediatesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder>( + intermediates_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + intermediates_ = null; + } + return intermediatesBuilder_; + } + + private int travelMode_ = 0; + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for travelMode. + */ + @java.lang.Override + public int getTravelModeValue() { + return travelMode_; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The travelMode. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelMode getTravelMode() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteTravelMode result = + com.google.maps.routing.v2.RouteTravelMode.valueOf(travelMode_); + return result == null ? com.google.maps.routing.v2.RouteTravelMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The travelMode to set. + * @return This builder for chaining. + */ + public Builder setTravelMode(com.google.maps.routing.v2.RouteTravelMode value) { + if (value == null) { + throw new NullPointerException(); + } + + travelMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the mode of transportation.
+     * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTravelMode() { + + travelMode_ = 0; + onChanged(); + return this; + } + + private int routingPreference_ = 0; + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server
+     * attempts to use the selected routing preference to compute the route. If
+     *  the routing preference results in an error or an extra long latency, then
+     * an error is returned. In the future, we might implement a fallback
+     * mechanism to use a different option when the preferred option does not give
+     * a valid result. You can specify this option only when the `travel_mode` is
+     * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for routingPreference. + */ + @java.lang.Override + public int getRoutingPreferenceValue() { + return routingPreference_; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server
+     * attempts to use the selected routing preference to compute the route. If
+     *  the routing preference results in an error or an extra long latency, then
+     * an error is returned. In the future, we might implement a fallback
+     * mechanism to use a different option when the preferred option does not give
+     * a valid result. You can specify this option only when the `travel_mode` is
+     * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for routingPreference to set. + * @return This builder for chaining. + */ + public Builder setRoutingPreferenceValue(int value) { + + routingPreference_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server
+     * attempts to use the selected routing preference to compute the route. If
+     *  the routing preference results in an error or an extra long latency, then
+     * an error is returned. In the future, we might implement a fallback
+     * mechanism to use a different option when the preferred option does not give
+     * a valid result. You can specify this option only when the `travel_mode` is
+     * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingPreference. + */ + @java.lang.Override + public com.google.maps.routing.v2.RoutingPreference getRoutingPreference() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RoutingPreference result = + com.google.maps.routing.v2.RoutingPreference.valueOf(routingPreference_); + return result == null ? com.google.maps.routing.v2.RoutingPreference.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server
+     * attempts to use the selected routing preference to compute the route. If
+     *  the routing preference results in an error or an extra long latency, then
+     * an error is returned. In the future, we might implement a fallback
+     * mechanism to use a different option when the preferred option does not give
+     * a valid result. You can specify this option only when the `travel_mode` is
+     * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The routingPreference to set. + * @return This builder for chaining. + */ + public Builder setRoutingPreference(com.google.maps.routing.v2.RoutingPreference value) { + if (value == null) { + throw new NullPointerException(); + } + + routingPreference_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies how to compute the route. The server
+     * attempts to use the selected routing preference to compute the route. If
+     *  the routing preference results in an error or an extra long latency, then
+     * an error is returned. In the future, we might implement a fallback
+     * mechanism to use a different option when the preferred option does not give
+     * a valid result. You can specify this option only when the `travel_mode` is
+     * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+     * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRoutingPreference() { + + routingPreference_ = 0; + onChanged(); + return this; + } + + private int polylineQuality_ = 0; + /** + * + * + *
+     * Optional. Specifies your preference for the quality of the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for polylineQuality. + */ + @java.lang.Override + public int getPolylineQualityValue() { + return polylineQuality_; + } + /** + * + * + *
+     * Optional. Specifies your preference for the quality of the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for polylineQuality to set. + * @return This builder for chaining. + */ + public Builder setPolylineQualityValue(int value) { + + polylineQuality_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies your preference for the quality of the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The polylineQuality. + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineQuality getPolylineQuality() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.PolylineQuality result = + com.google.maps.routing.v2.PolylineQuality.valueOf(polylineQuality_); + return result == null ? com.google.maps.routing.v2.PolylineQuality.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies your preference for the quality of the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The polylineQuality to set. + * @return This builder for chaining. + */ + public Builder setPolylineQuality(com.google.maps.routing.v2.PolylineQuality value) { + if (value == null) { + throw new NullPointerException(); + } + + polylineQuality_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies your preference for the quality of the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolylineQuality() { + + polylineQuality_ = 0; + onChanged(); + return this; + } + + private int polylineEncoding_ = 0; + /** + * + * + *
+     * Optional. Specifies the preferred encoding for the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for polylineEncoding. + */ + @java.lang.Override + public int getPolylineEncodingValue() { + return polylineEncoding_; + } + /** + * + * + *
+     * Optional. Specifies the preferred encoding for the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for polylineEncoding to set. + * @return This builder for chaining. + */ + public Builder setPolylineEncodingValue(int value) { + + polylineEncoding_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the preferred encoding for the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The polylineEncoding. + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineEncoding getPolylineEncoding() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.PolylineEncoding result = + com.google.maps.routing.v2.PolylineEncoding.valueOf(polylineEncoding_); + return result == null ? com.google.maps.routing.v2.PolylineEncoding.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies the preferred encoding for the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The polylineEncoding to set. + * @return This builder for chaining. + */ + public Builder setPolylineEncoding(com.google.maps.routing.v2.PolylineEncoding value) { + if (value == null) { + throw new NullPointerException(); + } + + polylineEncoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the preferred encoding for the polyline.
+     * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolylineEncoding() { + + polylineEncoding_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp departureTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + departureTimeBuilder_; + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the departureTime field is set. + */ + public boolean hasDepartureTime() { + return departureTimeBuilder_ != null || departureTime_ != null; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The departureTime. + */ + public com.google.protobuf.Timestamp getDepartureTime() { + if (departureTimeBuilder_ == null) { + return departureTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : departureTime_; + } else { + return departureTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDepartureTime(com.google.protobuf.Timestamp value) { + if (departureTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + departureTime_ = value; + onChanged(); + } else { + departureTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDepartureTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (departureTimeBuilder_ == null) { + departureTime_ = builderForValue.build(); + onChanged(); + } else { + departureTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDepartureTime(com.google.protobuf.Timestamp value) { + if (departureTimeBuilder_ == null) { + if (departureTime_ != null) { + departureTime_ = + com.google.protobuf.Timestamp.newBuilder(departureTime_) + .mergeFrom(value) + .buildPartial(); + } else { + departureTime_ = value; + } + onChanged(); + } else { + departureTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDepartureTime() { + if (departureTimeBuilder_ == null) { + departureTime_ = null; + onChanged(); + } else { + departureTime_ = null; + departureTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getDepartureTimeBuilder() { + + onChanged(); + return getDepartureTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDepartureTimeOrBuilder() { + if (departureTimeBuilder_ != null) { + return departureTimeBuilder_.getMessageOrBuilder(); + } else { + return departureTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : departureTime_; + } + } + /** + * + * + *
+     * Optional. The departure time. If you don't set this value, then this value
+     * defaults to the time that you made the request. If you set this value to a
+     * time that has already occurred, then the request fails.
+     * 
+ * + * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDepartureTimeFieldBuilder() { + if (departureTimeBuilder_ == null) { + departureTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDepartureTime(), getParentForChildren(), isClean()); + departureTime_ = null; + } + return departureTimeBuilder_; + } + + private boolean computeAlternativeRoutes_; + /** + * + * + *
+     * Optional. Specifies whether to calculate alternate routes in addition to the route.
+     * 
+ * + * bool compute_alternative_routes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The computeAlternativeRoutes. + */ + @java.lang.Override + public boolean getComputeAlternativeRoutes() { + return computeAlternativeRoutes_; + } + /** + * + * + *
+     * Optional. Specifies whether to calculate alternate routes in addition to the route.
+     * 
+ * + * bool compute_alternative_routes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The computeAlternativeRoutes to set. + * @return This builder for chaining. + */ + public Builder setComputeAlternativeRoutes(boolean value) { + + computeAlternativeRoutes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies whether to calculate alternate routes in addition to the route.
+     * 
+ * + * bool compute_alternative_routes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearComputeAlternativeRoutes() { + + computeAlternativeRoutes_ = false; + onChanged(); + return this; + } + + private com.google.maps.routing.v2.RouteModifiers routeModifiers_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteModifiers, + com.google.maps.routing.v2.RouteModifiers.Builder, + com.google.maps.routing.v2.RouteModifiersOrBuilder> + routeModifiersBuilder_; + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routeModifiers field is set. + */ + public boolean hasRouteModifiers() { + return routeModifiersBuilder_ != null || routeModifiers_ != null; + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routeModifiers. + */ + public com.google.maps.routing.v2.RouteModifiers getRouteModifiers() { + if (routeModifiersBuilder_ == null) { + return routeModifiers_ == null + ? com.google.maps.routing.v2.RouteModifiers.getDefaultInstance() + : routeModifiers_; + } else { + return routeModifiersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRouteModifiers(com.google.maps.routing.v2.RouteModifiers value) { + if (routeModifiersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routeModifiers_ = value; + onChanged(); + } else { + routeModifiersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRouteModifiers( + com.google.maps.routing.v2.RouteModifiers.Builder builderForValue) { + if (routeModifiersBuilder_ == null) { + routeModifiers_ = builderForValue.build(); + onChanged(); + } else { + routeModifiersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRouteModifiers(com.google.maps.routing.v2.RouteModifiers value) { + if (routeModifiersBuilder_ == null) { + if (routeModifiers_ != null) { + routeModifiers_ = + com.google.maps.routing.v2.RouteModifiers.newBuilder(routeModifiers_) + .mergeFrom(value) + .buildPartial(); + } else { + routeModifiers_ = value; + } + onChanged(); + } else { + routeModifiersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRouteModifiers() { + if (routeModifiersBuilder_ == null) { + routeModifiers_ = null; + onChanged(); + } else { + routeModifiers_ = null; + routeModifiersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.RouteModifiers.Builder getRouteModifiersBuilder() { + + onChanged(); + return getRouteModifiersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.RouteModifiersOrBuilder getRouteModifiersOrBuilder() { + if (routeModifiersBuilder_ != null) { + return routeModifiersBuilder_.getMessageOrBuilder(); + } else { + return routeModifiers_ == null + ? com.google.maps.routing.v2.RouteModifiers.getDefaultInstance() + : routeModifiers_; + } + } + /** + * + * + *
+     * Optional. A set of conditions to satisfy that affect the way routes are
+     * calculated.
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteModifiers, + com.google.maps.routing.v2.RouteModifiers.Builder, + com.google.maps.routing.v2.RouteModifiersOrBuilder> + getRouteModifiersFieldBuilder() { + if (routeModifiersBuilder_ == null) { + routeModifiersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteModifiers, + com.google.maps.routing.v2.RouteModifiers.Builder, + com.google.maps.routing.v2.RouteModifiersOrBuilder>( + getRouteModifiers(), getParentForChildren(), isClean()); + routeModifiers_ = null; + } + return routeModifiersBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+     * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+     * for the list of supported languages. When you don't provide this value, the
+     * display language is inferred from the location of the route request.
+     * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+     * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+     * for the list of supported languages. When you don't provide this value, the
+     * display language is inferred from the location of the route request.
+     * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+     * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+     * for the list of supported languages. When you don't provide this value, the
+     * display language is inferred from the location of the route request.
+     * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+     * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+     * for the list of supported languages. When you don't provide this value, the
+     * display language is inferred from the location of the route request.
+     * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+     * information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+     * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+     * for the list of supported languages. When you don't provide this value, the
+     * display language is inferred from the location of the route request.
+     * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private int units_ = 0; + /** + * + * + *
+     * Optional. Specifies the units of measure for the display fields. This
+     * includes the `instruction` field in `NavigationInstruction`. The units of
+     * measure used for the route, leg, step distance, and duration are not
+     * affected by this value. If you don't provide this value, then the display
+     * units are inferred from the location of the request.
+     * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for units. + */ + @java.lang.Override + public int getUnitsValue() { + return units_; + } + /** + * + * + *
+     * Optional. Specifies the units of measure for the display fields. This
+     * includes the `instruction` field in `NavigationInstruction`. The units of
+     * measure used for the route, leg, step distance, and duration are not
+     * affected by this value. If you don't provide this value, then the display
+     * units are inferred from the location of the request.
+     * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for units to set. + * @return This builder for chaining. + */ + public Builder setUnitsValue(int value) { + + units_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the units of measure for the display fields. This
+     * includes the `instruction` field in `NavigationInstruction`. The units of
+     * measure used for the route, leg, step distance, and duration are not
+     * affected by this value. If you don't provide this value, then the display
+     * units are inferred from the location of the request.
+     * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The units. + */ + @java.lang.Override + public com.google.maps.routing.v2.Units getUnits() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.Units result = com.google.maps.routing.v2.Units.valueOf(units_); + return result == null ? com.google.maps.routing.v2.Units.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Specifies the units of measure for the display fields. This
+     * includes the `instruction` field in `NavigationInstruction`. The units of
+     * measure used for the route, leg, step distance, and duration are not
+     * affected by this value. If you don't provide this value, then the display
+     * units are inferred from the location of the request.
+     * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The units to set. + * @return This builder for chaining. + */ + public Builder setUnits(com.google.maps.routing.v2.Units value) { + if (value == null) { + throw new NullPointerException(); + } + + units_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the units of measure for the display fields. This
+     * includes the `instruction` field in `NavigationInstruction`. The units of
+     * measure used for the route, leg, step distance, and duration are not
+     * affected by this value. If you don't provide this value, then the display
+     * units are inferred from the location of the request.
+     * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearUnits() { + + units_ = 0; + onChanged(); + return this; + } + + private java.util.List requestedReferenceRoutes_ = + java.util.Collections.emptyList(); + + private void ensureRequestedReferenceRoutesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + requestedReferenceRoutes_ = + new java.util.ArrayList(requestedReferenceRoutes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the requestedReferenceRoutes. + */ + public java.util.List + getRequestedReferenceRoutesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute>( + requestedReferenceRoutes_, requestedReferenceRoutes_converter_); + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of requestedReferenceRoutes. + */ + public int getRequestedReferenceRoutesCount() { + return requestedReferenceRoutes_.size(); + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The requestedReferenceRoutes at the given index. + */ + public com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute + getRequestedReferenceRoutes(int index) { + return requestedReferenceRoutes_converter_.convert(requestedReferenceRoutes_.get(index)); + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The requestedReferenceRoutes to set. + * @return This builder for chaining. + */ + public Builder setRequestedReferenceRoutes( + int index, com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The requestedReferenceRoutes to add. + * @return This builder for chaining. + */ + public Builder addRequestedReferenceRoutes( + com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The requestedReferenceRoutes to add. + * @return This builder for chaining. + */ + public Builder addAllRequestedReferenceRoutes( + java.lang.Iterable + values) { + ensureRequestedReferenceRoutesIsMutable(); + for (com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute value : values) { + requestedReferenceRoutes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRequestedReferenceRoutes() { + requestedReferenceRoutes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for requestedReferenceRoutes. + */ + public java.util.List getRequestedReferenceRoutesValueList() { + return java.util.Collections.unmodifiableList(requestedReferenceRoutes_); + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of requestedReferenceRoutes at the given index. + */ + public int getRequestedReferenceRoutesValue(int index) { + return requestedReferenceRoutes_.get(index); + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for requestedReferenceRoutes to set. + * @return This builder for chaining. + */ + public Builder setRequestedReferenceRoutesValue(int index, int value) { + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for requestedReferenceRoutes to add. + * @return This builder for chaining. + */ + public Builder addRequestedReferenceRoutesValue(int value) { + ensureRequestedReferenceRoutesIsMutable(); + requestedReferenceRoutes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies what reference routes to calculate as part of the request in
+     * addition to the default route.
+     * A reference route is a route with a different route calculation objective
+     * than the default route. For example an FUEL_EFFICIENT reference route
+     * calculation takes into account various parameters that would generate an
+     * optimal fuel efficient route.
+     * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The enum numeric values on the wire for requestedReferenceRoutes to add. + * @return This builder for chaining. + */ + public Builder addAllRequestedReferenceRoutesValue( + java.lang.Iterable values) { + ensureRequestedReferenceRoutesIsMutable(); + for (int value : values) { + requestedReferenceRoutes_.add(value); + } + 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.routing.v2.ComputeRoutesRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.ComputeRoutesRequest) + private static final com.google.maps.routing.v2.ComputeRoutesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.ComputeRoutesRequest(); + } + + public static com.google.maps.routing.v2.ComputeRoutesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComputeRoutesRequest 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.routing.v2.ComputeRoutesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesRequestOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesRequestOrBuilder.java new file mode 100644 index 000000000000..bd62b69664af --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesRequestOrBuilder.java @@ -0,0 +1,575 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public interface ComputeRoutesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.ComputeRoutesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Origin waypoint.
+   * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the origin field is set. + */ + boolean hasOrigin(); + /** + * + * + *
+   * Required. Origin waypoint.
+   * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The origin. + */ + com.google.maps.routing.v2.Waypoint getOrigin(); + /** + * + * + *
+   * Required. Origin waypoint.
+   * 
+ * + * .google.maps.routing.v2.Waypoint origin = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.WaypointOrBuilder getOriginOrBuilder(); + + /** + * + * + *
+   * Required. Destination waypoint.
+   * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the destination field is set. + */ + boolean hasDestination(); + /** + * + * + *
+   * Required. Destination waypoint.
+   * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The destination. + */ + com.google.maps.routing.v2.Waypoint getDestination(); + /** + * + * + *
+   * Required. Destination waypoint.
+   * 
+ * + * + * .google.maps.routing.v2.Waypoint destination = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.WaypointOrBuilder getDestinationOrBuilder(); + + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getIntermediatesList(); + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.maps.routing.v2.Waypoint getIntermediates(int index); + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getIntermediatesCount(); + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getIntermediatesOrBuilderList(); + /** + * + * + *
+   * Optional. A set of waypoints along the route (excluding terminal points),
+   * for either stopping at or passing by. Up to 25 intermediate waypoints are
+   * supported.
+   * 
+ * + * + * repeated .google.maps.routing.v2.Waypoint intermediates = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.maps.routing.v2.WaypointOrBuilder getIntermediatesOrBuilder(int index); + + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for travelMode. + */ + int getTravelModeValue(); + /** + * + * + *
+   * Optional. Specifies the mode of transportation.
+   * 
+ * + * + * .google.maps.routing.v2.RouteTravelMode travel_mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The travelMode. + */ + com.google.maps.routing.v2.RouteTravelMode getTravelMode(); + + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server
+   * attempts to use the selected routing preference to compute the route. If
+   *  the routing preference results in an error or an extra long latency, then
+   * an error is returned. In the future, we might implement a fallback
+   * mechanism to use a different option when the preferred option does not give
+   * a valid result. You can specify this option only when the `travel_mode` is
+   * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for routingPreference. + */ + int getRoutingPreferenceValue(); + /** + * + * + *
+   * Optional. Specifies how to compute the route. The server
+   * attempts to use the selected routing preference to compute the route. If
+   *  the routing preference results in an error or an extra long latency, then
+   * an error is returned. In the future, we might implement a fallback
+   * mechanism to use a different option when the preferred option does not give
+   * a valid result. You can specify this option only when the `travel_mode` is
+   * `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
+   * 
+ * + * + * .google.maps.routing.v2.RoutingPreference routing_preference = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingPreference. + */ + com.google.maps.routing.v2.RoutingPreference getRoutingPreference(); + + /** + * + * + *
+   * Optional. Specifies your preference for the quality of the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for polylineQuality. + */ + int getPolylineQualityValue(); + /** + * + * + *
+   * Optional. Specifies your preference for the quality of the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineQuality polyline_quality = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The polylineQuality. + */ + com.google.maps.routing.v2.PolylineQuality getPolylineQuality(); + + /** + * + * + *
+   * Optional. Specifies the preferred encoding for the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for polylineEncoding. + */ + int getPolylineEncodingValue(); + /** + * + * + *
+   * Optional. Specifies the preferred encoding for the polyline.
+   * 
+ * + * + * .google.maps.routing.v2.PolylineEncoding polyline_encoding = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The polylineEncoding. + */ + com.google.maps.routing.v2.PolylineEncoding getPolylineEncoding(); + + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, then this value
+   * defaults to the time that you made the request. If you set this value to a
+   * time that has already occurred, then the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the departureTime field is set. + */ + boolean hasDepartureTime(); + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, then this value
+   * defaults to the time that you made the request. If you set this value to a
+   * time that has already occurred, then the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The departureTime. + */ + com.google.protobuf.Timestamp getDepartureTime(); + /** + * + * + *
+   * Optional. The departure time. If you don't set this value, then this value
+   * defaults to the time that you made the request. If you set this value to a
+   * time that has already occurred, then the request fails.
+   * 
+ * + * .google.protobuf.Timestamp departure_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getDepartureTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Specifies whether to calculate alternate routes in addition to the route.
+   * 
+ * + * bool compute_alternative_routes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The computeAlternativeRoutes. + */ + boolean getComputeAlternativeRoutes(); + + /** + * + * + *
+   * Optional. A set of conditions to satisfy that affect the way routes are
+   * calculated.
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routeModifiers field is set. + */ + boolean hasRouteModifiers(); + /** + * + * + *
+   * Optional. A set of conditions to satisfy that affect the way routes are
+   * calculated.
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routeModifiers. + */ + com.google.maps.routing.v2.RouteModifiers getRouteModifiers(); + /** + * + * + *
+   * Optional. A set of conditions to satisfy that affect the way routes are
+   * calculated.
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.maps.routing.v2.RouteModifiersOrBuilder getRouteModifiersOrBuilder(); + + /** + * + * + *
+   * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+   * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+   * for the list of supported languages. When you don't provide this value, the
+   * display language is inferred from the location of the route request.
+   * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
+   * information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
+   * [Language Support](https://developers.google.com/maps/faq#languagesupport)
+   * for the list of supported languages. When you don't provide this value, the
+   * display language is inferred from the location of the route request.
+   * 
+ * + * string language_code = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + + /** + * + * + *
+   * Optional. Specifies the units of measure for the display fields. This
+   * includes the `instruction` field in `NavigationInstruction`. The units of
+   * measure used for the route, leg, step distance, and duration are not
+   * affected by this value. If you don't provide this value, then the display
+   * units are inferred from the location of the request.
+   * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for units. + */ + int getUnitsValue(); + /** + * + * + *
+   * Optional. Specifies the units of measure for the display fields. This
+   * includes the `instruction` field in `NavigationInstruction`. The units of
+   * measure used for the route, leg, step distance, and duration are not
+   * affected by this value. If you don't provide this value, then the display
+   * units are inferred from the location of the request.
+   * 
+ * + * .google.maps.routing.v2.Units units = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The units. + */ + com.google.maps.routing.v2.Units getUnits(); + + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the requestedReferenceRoutes. + */ + java.util.List + getRequestedReferenceRoutesList(); + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of requestedReferenceRoutes. + */ + int getRequestedReferenceRoutesCount(); + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The requestedReferenceRoutes at the given index. + */ + com.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute getRequestedReferenceRoutes( + int index); + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the enum numeric values on the wire for requestedReferenceRoutes. + */ + java.util.List getRequestedReferenceRoutesValueList(); + /** + * + * + *
+   * Optional. Specifies what reference routes to calculate as part of the request in
+   * addition to the default route.
+   * A reference route is a route with a different route calculation objective
+   * than the default route. For example an FUEL_EFFICIENT reference route
+   * calculation takes into account various parameters that would generate an
+   * optimal fuel efficient route.
+   * 
+ * + * + * repeated .google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute requested_reference_routes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of requestedReferenceRoutes at the given index. + */ + int getRequestedReferenceRoutesValue(int index); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesResponse.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesResponse.java new file mode 100644 index 000000000000..79b113ddb84e --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesResponse.java @@ -0,0 +1,1318 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * ComputeRoutes the response message.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.ComputeRoutesResponse} + */ +public final class ComputeRoutesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.ComputeRoutesResponse) + ComputeRoutesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComputeRoutesResponse.newBuilder() to construct. + private ComputeRoutesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComputeRoutesResponse() { + routes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComputeRoutesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.ComputeRoutesResponse.class, + com.google.maps.routing.v2.ComputeRoutesResponse.Builder.class); + } + + public static final int ROUTES_FIELD_NUMBER = 1; + private java.util.List routes_; + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + @java.lang.Override + public java.util.List getRoutesList() { + return routes_; + } + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + @java.lang.Override + public java.util.List + getRoutesOrBuilderList() { + return routes_; + } + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + @java.lang.Override + public int getRoutesCount() { + return routes_.size(); + } + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.Route getRoutes(int index) { + return routes_.get(index); + } + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteOrBuilder getRoutesOrBuilder(int index) { + return routes_.get(index); + } + + public static final int FALLBACK_INFO_FIELD_NUMBER = 2; + private com.google.maps.routing.v2.FallbackInfo fallbackInfo_; + /** + * + * + *
+   * In some cases when the server is not able to compute the route results with
+   * all of the input preferences, it may fallback to using a different way of
+   * computation. When fallback mode is used, this field contains detailed info
+   * about the fallback response. Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + * + * @return Whether the fallbackInfo field is set. + */ + @java.lang.Override + public boolean hasFallbackInfo() { + return fallbackInfo_ != null; + } + /** + * + * + *
+   * In some cases when the server is not able to compute the route results with
+   * all of the input preferences, it may fallback to using a different way of
+   * computation. When fallback mode is used, this field contains detailed info
+   * about the fallback response. Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + * + * @return The fallbackInfo. + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfo getFallbackInfo() { + return fallbackInfo_ == null + ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance() + : fallbackInfo_; + } + /** + * + * + *
+   * In some cases when the server is not able to compute the route results with
+   * all of the input preferences, it may fallback to using a different way of
+   * computation. When fallback mode is used, this field contains detailed info
+   * about the fallback response. Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder() { + return getFallbackInfo(); + } + + 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 (fallbackInfo_ != null) { + output.writeMessage(2, getFallbackInfo()); + } + 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 (fallbackInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFallbackInfo()); + } + 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.routing.v2.ComputeRoutesResponse)) { + return super.equals(obj); + } + com.google.maps.routing.v2.ComputeRoutesResponse other = + (com.google.maps.routing.v2.ComputeRoutesResponse) obj; + + if (!getRoutesList().equals(other.getRoutesList())) return false; + if (hasFallbackInfo() != other.hasFallbackInfo()) return false; + if (hasFallbackInfo()) { + if (!getFallbackInfo().equals(other.getFallbackInfo())) 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 (hasFallbackInfo()) { + hash = (37 * hash) + FALLBACK_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFallbackInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse 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.routing.v2.ComputeRoutesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse 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.routing.v2.ComputeRoutesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse 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.routing.v2.ComputeRoutesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse 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.routing.v2.ComputeRoutesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse 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.routing.v2.ComputeRoutesResponse 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; + } + /** + * + * + *
+   * ComputeRoutes the response message.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.ComputeRoutesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.ComputeRoutesResponse) + com.google.maps.routing.v2.ComputeRoutesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.ComputeRoutesResponse.class, + com.google.maps.routing.v2.ComputeRoutesResponse.Builder.class); + } + + // Construct using com.google.maps.routing.v2.ComputeRoutesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (routesBuilder_ == null) { + routes_ = java.util.Collections.emptyList(); + } else { + routes_ = null; + routesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (fallbackInfoBuilder_ == null) { + fallbackInfo_ = null; + } else { + fallbackInfo_ = null; + fallbackInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_ComputeRoutesResponse_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesResponse getDefaultInstanceForType() { + return com.google.maps.routing.v2.ComputeRoutesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesResponse build() { + com.google.maps.routing.v2.ComputeRoutesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.ComputeRoutesResponse buildPartial() { + com.google.maps.routing.v2.ComputeRoutesResponse result = + new com.google.maps.routing.v2.ComputeRoutesResponse(this); + int from_bitField0_ = bitField0_; + 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 (fallbackInfoBuilder_ == null) { + result.fallbackInfo_ = fallbackInfo_; + } else { + result.fallbackInfo_ = fallbackInfoBuilder_.build(); + } + 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.routing.v2.ComputeRoutesResponse) { + return mergeFrom((com.google.maps.routing.v2.ComputeRoutesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.ComputeRoutesResponse other) { + if (other == com.google.maps.routing.v2.ComputeRoutesResponse.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.hasFallbackInfo()) { + mergeFallbackInfo(other.getFallbackInfo()); + } + 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.routing.v2.Route m = + input.readMessage(com.google.maps.routing.v2.Route.parser(), extensionRegistry); + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(m); + } else { + routesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getFallbackInfoFieldBuilder().getBuilder(), extensionRegistry); + + 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 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.routing.v2.Route, + com.google.maps.routing.v2.Route.Builder, + com.google.maps.routing.v2.RouteOrBuilder> + routesBuilder_; + + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public java.util.List getRoutesList() { + if (routesBuilder_ == null) { + return java.util.Collections.unmodifiableList(routes_); + } else { + return routesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public int getRoutesCount() { + if (routesBuilder_ == null) { + return routes_.size(); + } else { + return routesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public com.google.maps.routing.v2.Route getRoutes(int index) { + if (routesBuilder_ == null) { + return routes_.get(index); + } else { + return routesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder setRoutes(int index, com.google.maps.routing.v2.Route value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.set(index, value); + onChanged(); + } else { + routesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder setRoutes(int index, com.google.maps.routing.v2.Route.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.set(index, builderForValue.build()); + onChanged(); + } else { + routesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder addRoutes(com.google.maps.routing.v2.Route value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.add(value); + onChanged(); + } else { + routesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder addRoutes(int index, com.google.maps.routing.v2.Route value) { + if (routesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutesIsMutable(); + routes_.add(index, value); + onChanged(); + } else { + routesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder addRoutes(com.google.maps.routing.v2.Route.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(builderForValue.build()); + onChanged(); + } else { + routesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder addRoutes(int index, com.google.maps.routing.v2.Route.Builder builderForValue) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.add(index, builderForValue.build()); + onChanged(); + } else { + routesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route 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; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder clearRoutes() { + if (routesBuilder_ == null) { + routes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + routesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public Builder removeRoutes(int index) { + if (routesBuilder_ == null) { + ensureRoutesIsMutable(); + routes_.remove(index); + onChanged(); + } else { + routesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public com.google.maps.routing.v2.Route.Builder getRoutesBuilder(int index) { + return getRoutesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public com.google.maps.routing.v2.RouteOrBuilder getRoutesOrBuilder(int index) { + if (routesBuilder_ == null) { + return routes_.get(index); + } else { + return routesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public java.util.List + getRoutesOrBuilderList() { + if (routesBuilder_ != null) { + return routesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(routes_); + } + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public com.google.maps.routing.v2.Route.Builder addRoutesBuilder() { + return getRoutesFieldBuilder() + .addBuilder(com.google.maps.routing.v2.Route.getDefaultInstance()); + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public com.google.maps.routing.v2.Route.Builder addRoutesBuilder(int index) { + return getRoutesFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.Route.getDefaultInstance()); + } + /** + * + * + *
+     * Contains an array of computed routes (up to three) when you specify
+     * compute_alternatives_routes, and contains just one route when you don't.
+     * When this array contains multiple entries, the first one is the most
+     * recommended route. If the array is empty, then it means no route could be
+     * found.
+     * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + public java.util.List getRoutesBuilderList() { + return getRoutesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.Route, + com.google.maps.routing.v2.Route.Builder, + com.google.maps.routing.v2.RouteOrBuilder> + getRoutesFieldBuilder() { + if (routesBuilder_ == null) { + routesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.Route, + com.google.maps.routing.v2.Route.Builder, + com.google.maps.routing.v2.RouteOrBuilder>( + routes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + routes_ = null; + } + return routesBuilder_; + } + + private com.google.maps.routing.v2.FallbackInfo fallbackInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.FallbackInfo, + com.google.maps.routing.v2.FallbackInfo.Builder, + com.google.maps.routing.v2.FallbackInfoOrBuilder> + fallbackInfoBuilder_; + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + * + * @return Whether the fallbackInfo field is set. + */ + public boolean hasFallbackInfo() { + return fallbackInfoBuilder_ != null || fallbackInfo_ != null; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + * + * @return The fallbackInfo. + */ + public com.google.maps.routing.v2.FallbackInfo getFallbackInfo() { + if (fallbackInfoBuilder_ == null) { + return fallbackInfo_ == null + ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance() + : fallbackInfo_; + } else { + return fallbackInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + public Builder setFallbackInfo(com.google.maps.routing.v2.FallbackInfo value) { + if (fallbackInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fallbackInfo_ = value; + onChanged(); + } else { + fallbackInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + public Builder setFallbackInfo( + com.google.maps.routing.v2.FallbackInfo.Builder builderForValue) { + if (fallbackInfoBuilder_ == null) { + fallbackInfo_ = builderForValue.build(); + onChanged(); + } else { + fallbackInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + public Builder mergeFallbackInfo(com.google.maps.routing.v2.FallbackInfo value) { + if (fallbackInfoBuilder_ == null) { + if (fallbackInfo_ != null) { + fallbackInfo_ = + com.google.maps.routing.v2.FallbackInfo.newBuilder(fallbackInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + fallbackInfo_ = value; + } + onChanged(); + } else { + fallbackInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + public Builder clearFallbackInfo() { + if (fallbackInfoBuilder_ == null) { + fallbackInfo_ = null; + onChanged(); + } else { + fallbackInfo_ = null; + fallbackInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + public com.google.maps.routing.v2.FallbackInfo.Builder getFallbackInfoBuilder() { + + onChanged(); + return getFallbackInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + public com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder() { + if (fallbackInfoBuilder_ != null) { + return fallbackInfoBuilder_.getMessageOrBuilder(); + } else { + return fallbackInfo_ == null + ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance() + : fallbackInfo_; + } + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route results with
+     * all of the input preferences, it may fallback to using a different way of
+     * computation. When fallback mode is used, this field contains detailed info
+     * about the fallback response. Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.FallbackInfo, + com.google.maps.routing.v2.FallbackInfo.Builder, + com.google.maps.routing.v2.FallbackInfoOrBuilder> + getFallbackInfoFieldBuilder() { + if (fallbackInfoBuilder_ == null) { + fallbackInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.FallbackInfo, + com.google.maps.routing.v2.FallbackInfo.Builder, + com.google.maps.routing.v2.FallbackInfoOrBuilder>( + getFallbackInfo(), getParentForChildren(), isClean()); + fallbackInfo_ = null; + } + return fallbackInfoBuilder_; + } + + @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.routing.v2.ComputeRoutesResponse) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.ComputeRoutesResponse) + private static final com.google.maps.routing.v2.ComputeRoutesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.ComputeRoutesResponse(); + } + + public static com.google.maps.routing.v2.ComputeRoutesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComputeRoutesResponse 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.routing.v2.ComputeRoutesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesResponseOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesResponseOrBuilder.java new file mode 100644 index 000000000000..aacbe14e3748 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ComputeRoutesResponseOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public interface ComputeRoutesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.ComputeRoutesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + java.util.List getRoutesList(); + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + com.google.maps.routing.v2.Route getRoutes(int index); + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + int getRoutesCount(); + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + java.util.List getRoutesOrBuilderList(); + /** + * + * + *
+   * Contains an array of computed routes (up to three) when you specify
+   * compute_alternatives_routes, and contains just one route when you don't.
+   * When this array contains multiple entries, the first one is the most
+   * recommended route. If the array is empty, then it means no route could be
+   * found.
+   * 
+ * + * repeated .google.maps.routing.v2.Route routes = 1; + */ + com.google.maps.routing.v2.RouteOrBuilder getRoutesOrBuilder(int index); + + /** + * + * + *
+   * In some cases when the server is not able to compute the route results with
+   * all of the input preferences, it may fallback to using a different way of
+   * computation. When fallback mode is used, this field contains detailed info
+   * about the fallback response. Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + * + * @return Whether the fallbackInfo field is set. + */ + boolean hasFallbackInfo(); + /** + * + * + *
+   * In some cases when the server is not able to compute the route results with
+   * all of the input preferences, it may fallback to using a different way of
+   * computation. When fallback mode is used, this field contains detailed info
+   * about the fallback response. Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + * + * @return The fallbackInfo. + */ + com.google.maps.routing.v2.FallbackInfo getFallbackInfo(); + /** + * + * + *
+   * In some cases when the server is not able to compute the route results with
+   * all of the input preferences, it may fallback to using a different way of
+   * computation. When fallback mode is used, this field contains detailed info
+   * about the fallback response. Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 2; + */ + com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfo.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfo.java new file mode 100644 index 000000000000..81f93112455e --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfo.java @@ -0,0 +1,771 @@ +/* + * Copyright 2020 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/routing/v2/fallback_info.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Information related to how and why a fallback result was used. If this field
+ * is set, then it means the server used a different routing mode from your
+ * preferred mode as fallback.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.FallbackInfo} + */ +public final class FallbackInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.FallbackInfo) + FallbackInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FallbackInfo.newBuilder() to construct. + private FallbackInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FallbackInfo() { + routingMode_ = 0; + reason_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FallbackInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.FallbackInfoProto + .internal_static_google_maps_routing_v2_FallbackInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.FallbackInfoProto + .internal_static_google_maps_routing_v2_FallbackInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.FallbackInfo.class, + com.google.maps.routing.v2.FallbackInfo.Builder.class); + } + + public static final int ROUTING_MODE_FIELD_NUMBER = 1; + private int routingMode_; + /** + * + * + *
+   * Routing mode used for the response. If fallback was triggered, the mode
+   * may be different from routing preference set in the original client
+   * request.
+   * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return The enum numeric value on the wire for routingMode. + */ + @java.lang.Override + public int getRoutingModeValue() { + return routingMode_; + } + /** + * + * + *
+   * Routing mode used for the response. If fallback was triggered, the mode
+   * may be different from routing preference set in the original client
+   * request.
+   * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return The routingMode. + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackRoutingMode getRoutingMode() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.FallbackRoutingMode result = + com.google.maps.routing.v2.FallbackRoutingMode.valueOf(routingMode_); + return result == null ? com.google.maps.routing.v2.FallbackRoutingMode.UNRECOGNIZED : result; + } + + public static final int REASON_FIELD_NUMBER = 2; + private int reason_; + /** + * + * + *
+   * The reason why fallback response was used instead of the original response.
+   * This field is only populated when the fallback mode is triggered and the
+   * fallback response is returned.
+   * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + /** + * + * + *
+   * The reason why fallback response was used instead of the original response.
+   * This field is only populated when the fallback mode is triggered and the
+   * fallback response is returned.
+   * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return The reason. + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackReason getReason() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.FallbackReason result = + com.google.maps.routing.v2.FallbackReason.valueOf(reason_); + return result == null ? com.google.maps.routing.v2.FallbackReason.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 (routingMode_ + != com.google.maps.routing.v2.FallbackRoutingMode.FALLBACK_ROUTING_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, routingMode_); + } + if (reason_ + != com.google.maps.routing.v2.FallbackReason.FALLBACK_REASON_UNSPECIFIED.getNumber()) { + output.writeEnum(2, reason_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (routingMode_ + != com.google.maps.routing.v2.FallbackRoutingMode.FALLBACK_ROUTING_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, routingMode_); + } + if (reason_ + != com.google.maps.routing.v2.FallbackReason.FALLBACK_REASON_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, reason_); + } + 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.routing.v2.FallbackInfo)) { + return super.equals(obj); + } + com.google.maps.routing.v2.FallbackInfo other = (com.google.maps.routing.v2.FallbackInfo) obj; + + if (routingMode_ != other.routingMode_) return false; + if (reason_ != other.reason_) 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) + ROUTING_MODE_FIELD_NUMBER; + hash = (53 * hash) + routingMode_; + hash = (37 * hash) + REASON_FIELD_NUMBER; + hash = (53 * hash) + reason_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.FallbackInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.FallbackInfo 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.routing.v2.FallbackInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.FallbackInfo 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.routing.v2.FallbackInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.FallbackInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.FallbackInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.FallbackInfo 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.routing.v2.FallbackInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.FallbackInfo 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.routing.v2.FallbackInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.FallbackInfo 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.routing.v2.FallbackInfo 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 related to how and why a fallback result was used. If this field
+   * is set, then it means the server used a different routing mode from your
+   * preferred mode as fallback.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.FallbackInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.FallbackInfo) + com.google.maps.routing.v2.FallbackInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.FallbackInfoProto + .internal_static_google_maps_routing_v2_FallbackInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.FallbackInfoProto + .internal_static_google_maps_routing_v2_FallbackInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.FallbackInfo.class, + com.google.maps.routing.v2.FallbackInfo.Builder.class); + } + + // Construct using com.google.maps.routing.v2.FallbackInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + routingMode_ = 0; + + reason_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.FallbackInfoProto + .internal_static_google_maps_routing_v2_FallbackInfo_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfo getDefaultInstanceForType() { + return com.google.maps.routing.v2.FallbackInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfo build() { + com.google.maps.routing.v2.FallbackInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfo buildPartial() { + com.google.maps.routing.v2.FallbackInfo result = + new com.google.maps.routing.v2.FallbackInfo(this); + result.routingMode_ = routingMode_; + result.reason_ = reason_; + 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.routing.v2.FallbackInfo) { + return mergeFrom((com.google.maps.routing.v2.FallbackInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.FallbackInfo other) { + if (other == com.google.maps.routing.v2.FallbackInfo.getDefaultInstance()) return this; + if (other.routingMode_ != 0) { + setRoutingModeValue(other.getRoutingModeValue()); + } + if (other.reason_ != 0) { + setReasonValue(other.getReasonValue()); + } + 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: + { + routingMode_ = input.readEnum(); + + break; + } // case 8 + case 16: + { + reason_ = input.readEnum(); + + 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 routingMode_ = 0; + /** + * + * + *
+     * Routing mode used for the response. If fallback was triggered, the mode
+     * may be different from routing preference set in the original client
+     * request.
+     * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return The enum numeric value on the wire for routingMode. + */ + @java.lang.Override + public int getRoutingModeValue() { + return routingMode_; + } + /** + * + * + *
+     * Routing mode used for the response. If fallback was triggered, the mode
+     * may be different from routing preference set in the original client
+     * request.
+     * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @param value The enum numeric value on the wire for routingMode to set. + * @return This builder for chaining. + */ + public Builder setRoutingModeValue(int value) { + + routingMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Routing mode used for the response. If fallback was triggered, the mode
+     * may be different from routing preference set in the original client
+     * request.
+     * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return The routingMode. + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackRoutingMode getRoutingMode() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.FallbackRoutingMode result = + com.google.maps.routing.v2.FallbackRoutingMode.valueOf(routingMode_); + return result == null ? com.google.maps.routing.v2.FallbackRoutingMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Routing mode used for the response. If fallback was triggered, the mode
+     * may be different from routing preference set in the original client
+     * request.
+     * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @param value The routingMode to set. + * @return This builder for chaining. + */ + public Builder setRoutingMode(com.google.maps.routing.v2.FallbackRoutingMode value) { + if (value == null) { + throw new NullPointerException(); + } + + routingMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Routing mode used for the response. If fallback was triggered, the mode
+     * may be different from routing preference set in the original client
+     * request.
+     * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearRoutingMode() { + + routingMode_ = 0; + onChanged(); + return this; + } + + private int reason_ = 0; + /** + * + * + *
+     * The reason why fallback response was used instead of the original response.
+     * This field is only populated when the fallback mode is triggered and the
+     * fallback response is returned.
+     * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + /** + * + * + *
+     * The reason why fallback response was used instead of the original response.
+     * This field is only populated when the fallback mode is triggered and the
+     * fallback response is returned.
+     * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @param value The enum numeric value on the wire for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonValue(int value) { + + reason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason why fallback response was used instead of the original response.
+     * This field is only populated when the fallback mode is triggered and the
+     * fallback response is returned.
+     * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return The reason. + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackReason getReason() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.FallbackReason result = + com.google.maps.routing.v2.FallbackReason.valueOf(reason_); + return result == null ? com.google.maps.routing.v2.FallbackReason.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The reason why fallback response was used instead of the original response.
+     * This field is only populated when the fallback mode is triggered and the
+     * fallback response is returned.
+     * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(com.google.maps.routing.v2.FallbackReason value) { + if (value == null) { + throw new NullPointerException(); + } + + reason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason why fallback response was used instead of the original response.
+     * This field is only populated when the fallback mode is triggered and the
+     * fallback response is returned.
+     * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + + reason_ = 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.routing.v2.FallbackInfo) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.FallbackInfo) + private static final com.google.maps.routing.v2.FallbackInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.FallbackInfo(); + } + + public static com.google.maps.routing.v2.FallbackInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FallbackInfo 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.routing.v2.FallbackInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfoOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfoOrBuilder.java new file mode 100644 index 000000000000..109280a99d17 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfoOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 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/routing/v2/fallback_info.proto + +package com.google.maps.routing.v2; + +public interface FallbackInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.FallbackInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Routing mode used for the response. If fallback was triggered, the mode
+   * may be different from routing preference set in the original client
+   * request.
+   * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return The enum numeric value on the wire for routingMode. + */ + int getRoutingModeValue(); + /** + * + * + *
+   * Routing mode used for the response. If fallback was triggered, the mode
+   * may be different from routing preference set in the original client
+   * request.
+   * 
+ * + * .google.maps.routing.v2.FallbackRoutingMode routing_mode = 1; + * + * @return The routingMode. + */ + com.google.maps.routing.v2.FallbackRoutingMode getRoutingMode(); + + /** + * + * + *
+   * The reason why fallback response was used instead of the original response.
+   * This field is only populated when the fallback mode is triggered and the
+   * fallback response is returned.
+   * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return The enum numeric value on the wire for reason. + */ + int getReasonValue(); + /** + * + * + *
+   * The reason why fallback response was used instead of the original response.
+   * This field is only populated when the fallback mode is triggered and the
+   * fallback response is returned.
+   * 
+ * + * .google.maps.routing.v2.FallbackReason reason = 2; + * + * @return The reason. + */ + com.google.maps.routing.v2.FallbackReason getReason(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfoProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfoProto.java new file mode 100644 index 000000000000..a7ea937c97bb --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackInfoProto.java @@ -0,0 +1,74 @@ +/* + * Copyright 2020 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/routing/v2/fallback_info.proto + +package com.google.maps.routing.v2; + +public final class FallbackInfoProto { + private FallbackInfoProto() {} + + 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_routing_v2_FallbackInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_FallbackInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n*google/maps/routing/v2/fallback_info.p" + + "roto\022\026google.maps.routing.v2\"\211\001\n\014Fallbac" + + "kInfo\022A\n\014routing_mode\030\001 \001(\0162+.google.map" + + "s.routing.v2.FallbackRoutingMode\0226\n\006reas" + + "on\030\002 \001(\0162&.google.maps.routing.v2.Fallba" + + "ckReason*Y\n\016FallbackReason\022\037\n\033FALLBACK_R" + + "EASON_UNSPECIFIED\020\000\022\020\n\014SERVER_ERROR\020\001\022\024\n" + + "\020LATENCY_EXCEEDED\020\002*v\n\023FallbackRoutingMo" + + "de\022%\n!FALLBACK_ROUTING_MODE_UNSPECIFIED\020" + + "\000\022\034\n\030FALLBACK_TRAFFIC_UNAWARE\020\001\022\032\n\026FALLB" + + "ACK_TRAFFIC_AWARE\020\002B\311\001\n\032com.google.maps." + + "routing.v2B\021FallbackInfoProtoP\001Z=google." + + "golang.org/genproto/googleapis/maps/rout" + + "ing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Google.Maps." + + "Routing.V2\312\002\026Google\\Maps\\Routing\\V2\352\002\031Go" + + "ogle::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_maps_routing_v2_FallbackInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_FallbackInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_FallbackInfo_descriptor, + new java.lang.String[] { + "RoutingMode", "Reason", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackReason.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackReason.java new file mode 100644 index 000000000000..4c4557ffaed8 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackReason.java @@ -0,0 +1,184 @@ +/* + * Copyright 2020 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/routing/v2/fallback_info.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Reasons for using fallback response.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.FallbackReason} + */ +public enum FallbackReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No fallback reason specified.
+   * 
+ * + * FALLBACK_REASON_UNSPECIFIED = 0; + */ + FALLBACK_REASON_UNSPECIFIED(0), + /** + * + * + *
+   * A server error happened while calculating routes with your preferred
+   * routing mode, but we were able to return a result calculated by an
+   * alternative mode.
+   * 
+ * + * SERVER_ERROR = 1; + */ + SERVER_ERROR(1), + /** + * + * + *
+   * We were not able to finish the calculation with your preferred routing mode
+   * on time, but we were able to return a result calculated by an alternative
+   * mode.
+   * 
+ * + * LATENCY_EXCEEDED = 2; + */ + LATENCY_EXCEEDED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No fallback reason specified.
+   * 
+ * + * FALLBACK_REASON_UNSPECIFIED = 0; + */ + public static final int FALLBACK_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * A server error happened while calculating routes with your preferred
+   * routing mode, but we were able to return a result calculated by an
+   * alternative mode.
+   * 
+ * + * SERVER_ERROR = 1; + */ + public static final int SERVER_ERROR_VALUE = 1; + /** + * + * + *
+   * We were not able to finish the calculation with your preferred routing mode
+   * on time, but we were able to return a result calculated by an alternative
+   * mode.
+   * 
+ * + * LATENCY_EXCEEDED = 2; + */ + public static final int LATENCY_EXCEEDED_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 FallbackReason 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 FallbackReason forNumber(int value) { + switch (value) { + case 0: + return FALLBACK_REASON_UNSPECIFIED; + case 1: + return SERVER_ERROR; + case 2: + return LATENCY_EXCEEDED; + 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 FallbackReason findValueByNumber(int number) { + return FallbackReason.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.routing.v2.FallbackInfoProto.getDescriptor().getEnumTypes().get(0); + } + + private static final FallbackReason[] VALUES = values(); + + public static FallbackReason 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 FallbackReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.FallbackReason) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackRoutingMode.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackRoutingMode.java new file mode 100644 index 000000000000..caa8b5d34cf9 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/FallbackRoutingMode.java @@ -0,0 +1,183 @@ +/* + * Copyright 2020 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/routing/v2/fallback_info.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Actual routing mode used for returned fallback response.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.FallbackRoutingMode} + */ +public enum FallbackRoutingMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not used.
+   * 
+ * + * FALLBACK_ROUTING_MODE_UNSPECIFIED = 0; + */ + FALLBACK_ROUTING_MODE_UNSPECIFIED(0), + /** + * + * + *
+   * Indicates the "TRAFFIC_UNAWARE" routing mode was used to compute the
+   * response.
+   * 
+ * + * FALLBACK_TRAFFIC_UNAWARE = 1; + */ + FALLBACK_TRAFFIC_UNAWARE(1), + /** + * + * + *
+   * Indicates the "TRAFFIC_AWARE" routing mode was used to compute the
+   * response.
+   * 
+ * + * FALLBACK_TRAFFIC_AWARE = 2; + */ + FALLBACK_TRAFFIC_AWARE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not used.
+   * 
+ * + * FALLBACK_ROUTING_MODE_UNSPECIFIED = 0; + */ + public static final int FALLBACK_ROUTING_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Indicates the "TRAFFIC_UNAWARE" routing mode was used to compute the
+   * response.
+   * 
+ * + * FALLBACK_TRAFFIC_UNAWARE = 1; + */ + public static final int FALLBACK_TRAFFIC_UNAWARE_VALUE = 1; + /** + * + * + *
+   * Indicates the "TRAFFIC_AWARE" routing mode was used to compute the
+   * response.
+   * 
+ * + * FALLBACK_TRAFFIC_AWARE = 2; + */ + public static final int FALLBACK_TRAFFIC_AWARE_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 FallbackRoutingMode 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 FallbackRoutingMode forNumber(int value) { + switch (value) { + case 0: + return FALLBACK_ROUTING_MODE_UNSPECIFIED; + case 1: + return FALLBACK_TRAFFIC_UNAWARE; + case 2: + return FALLBACK_TRAFFIC_AWARE; + 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 FallbackRoutingMode findValueByNumber(int number) { + return FallbackRoutingMode.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.routing.v2.FallbackInfoProto.getDescriptor().getEnumTypes().get(1); + } + + private static final FallbackRoutingMode[] VALUES = values(); + + public static FallbackRoutingMode 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 FallbackRoutingMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.FallbackRoutingMode) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Location.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Location.java new file mode 100644 index 000000000000..dfde9cbbf63c --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Location.java @@ -0,0 +1,992 @@ +/* + * Copyright 2020 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/routing/v2/location.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates a location (a geographic point, and an optional heading).
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.Location} + */ +public final class Location extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.LocationProto + .internal_static_google_maps_routing_v2_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.LocationProto + .internal_static_google_maps_routing_v2_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Location.class, + com.google.maps.routing.v2.Location.Builder.class); + } + + 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 latLng_ != null; + } + /** + * + * + *
+   * 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 getLatLng(); + } + + public static final int HEADING_FIELD_NUMBER = 2; + private com.google.protobuf.Int32Value 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. You can use this
+   * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+   * 
+ * + * .google.protobuf.Int32Value heading = 2; + * + * @return Whether the heading field is set. + */ + @java.lang.Override + public boolean hasHeading() { + return heading_ != null; + } + /** + * + * + *
+   * 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. You can use this
+   * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+   * 
+ * + * .google.protobuf.Int32Value heading = 2; + * + * @return The heading. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getHeading() { + return heading_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : 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. You can use this
+   * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+   * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getHeadingOrBuilder() { + return getHeading(); + } + + 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 (latLng_ != null) { + output.writeMessage(1, getLatLng()); + } + if (heading_ != null) { + output.writeMessage(2, getHeading()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (latLng_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLatLng()); + } + if (heading_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getHeading()); + } + 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.routing.v2.Location)) { + return super.equals(obj); + } + com.google.maps.routing.v2.Location other = (com.google.maps.routing.v2.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().equals(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().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.Location parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.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.routing.v2.Location parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.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.routing.v2.Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Location parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.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.routing.v2.Location parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.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.routing.v2.Location parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.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.routing.v2.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.routing.v2.Location} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.Location) + com.google.maps.routing.v2.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.LocationProto + .internal_static_google_maps_routing_v2_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.LocationProto + .internal_static_google_maps_routing_v2_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Location.class, + com.google.maps.routing.v2.Location.Builder.class); + } + + // Construct using com.google.maps.routing.v2.Location.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (latLngBuilder_ == null) { + latLng_ = null; + } else { + latLng_ = null; + latLngBuilder_ = null; + } + if (headingBuilder_ == null) { + heading_ = null; + } else { + heading_ = null; + headingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.LocationProto + .internal_static_google_maps_routing_v2_Location_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.Location getDefaultInstanceForType() { + return com.google.maps.routing.v2.Location.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.Location build() { + com.google.maps.routing.v2.Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.Location buildPartial() { + com.google.maps.routing.v2.Location result = new com.google.maps.routing.v2.Location(this); + if (latLngBuilder_ == null) { + result.latLng_ = latLng_; + } else { + result.latLng_ = latLngBuilder_.build(); + } + if (headingBuilder_ == null) { + result.heading_ = heading_; + } else { + result.heading_ = headingBuilder_.build(); + } + 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.routing.v2.Location) { + return mergeFrom((com.google.maps.routing.v2.Location) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.Location other) { + if (other == com.google.maps.routing.v2.Location.getDefaultInstance()) return this; + if (other.hasLatLng()) { + mergeLatLng(other.getLatLng()); + } + if (other.hasHeading()) { + mergeHeading(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); + + break; + } // case 10 + case 18: + { + input.readMessage(getHeadingFieldBuilder().getBuilder(), extensionRegistry); + + 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 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 latLngBuilder_ != null || latLng_ != null; + } + /** + * + * + *
+     * 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; + onChanged(); + } else { + latLngBuilder_.setMessage(value); + } + + 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(); + onChanged(); + } else { + latLngBuilder_.setMessage(builderForValue.build()); + } + + 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 (latLng_ != null) { + latLng_ = com.google.type.LatLng.newBuilder(latLng_).mergeFrom(value).buildPartial(); + } else { + latLng_ = value; + } + onChanged(); + } else { + latLngBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public Builder clearLatLng() { + if (latLngBuilder_ == null) { + latLng_ = null; + onChanged(); + } else { + latLng_ = null; + latLngBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The waypoint's geographic coordinates.
+     * 
+ * + * .google.type.LatLng lat_lng = 1; + */ + public com.google.type.LatLng.Builder getLatLngBuilder() { + + 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 com.google.protobuf.Int32Value heading_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + headingBuilder_; + /** + * + * + *
+     * 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + * + * @return Whether the heading field is set. + */ + public boolean hasHeading() { + return headingBuilder_ != null || heading_ != null; + } + /** + * + * + *
+     * 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + * + * @return The heading. + */ + public com.google.protobuf.Int32Value getHeading() { + if (headingBuilder_ == null) { + return heading_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : heading_; + } else { + return headingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + public Builder setHeading(com.google.protobuf.Int32Value value) { + if (headingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + heading_ = value; + onChanged(); + } else { + headingBuilder_.setMessage(value); + } + + 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + public Builder setHeading(com.google.protobuf.Int32Value.Builder builderForValue) { + if (headingBuilder_ == null) { + heading_ = builderForValue.build(); + onChanged(); + } else { + headingBuilder_.setMessage(builderForValue.build()); + } + + 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + public Builder mergeHeading(com.google.protobuf.Int32Value value) { + if (headingBuilder_ == null) { + if (heading_ != null) { + heading_ = + com.google.protobuf.Int32Value.newBuilder(heading_).mergeFrom(value).buildPartial(); + } else { + heading_ = value; + } + onChanged(); + } else { + headingBuilder_.mergeFrom(value); + } + + 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + public Builder clearHeading() { + if (headingBuilder_ == null) { + heading_ = null; + onChanged(); + } else { + heading_ = null; + headingBuilder_ = null; + } + + 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + public com.google.protobuf.Int32Value.Builder getHeadingBuilder() { + + onChanged(); + return getHeadingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + public com.google.protobuf.Int32ValueOrBuilder getHeadingOrBuilder() { + if (headingBuilder_ != null) { + return headingBuilder_.getMessageOrBuilder(); + } else { + return heading_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : 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. You can use this
+     * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+     * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getHeadingFieldBuilder() { + if (headingBuilder_ == null) { + headingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getHeading(), getParentForChildren(), isClean()); + heading_ = null; + } + return headingBuilder_; + } + + @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.routing.v2.Location) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.Location) + private static final com.google.maps.routing.v2.Location DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.Location(); + } + + public static com.google.maps.routing.v2.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.routing.v2.Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/LocationOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/LocationOrBuilder.java new file mode 100644 index 000000000000..58e544a661c5 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/LocationOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 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/routing/v2/location.proto + +package com.google.maps.routing.v2; + +public interface LocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.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. You can use this
+   * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+   * 
+ * + * .google.protobuf.Int32Value 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. You can use this
+   * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+   * 
+ * + * .google.protobuf.Int32Value heading = 2; + * + * @return The heading. + */ + com.google.protobuf.Int32Value getHeading(); + /** + * + * + *
+   * 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. You can use this
+   * field only for `DRIVE` and `TWO_WHEELER` travel modes.
+   * 
+ * + * .google.protobuf.Int32Value heading = 2; + */ + com.google.protobuf.Int32ValueOrBuilder getHeadingOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/LocationProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/LocationProto.java new file mode 100644 index 000000000000..6c97294ff432 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/LocationProto.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 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/routing/v2/location.proto + +package com.google.maps.routing.v2; + +public final class LocationProto { + private LocationProto() {} + + 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_routing_v2_Location_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_Location_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/maps/routing/v2/location.proto\022" + + "\026google.maps.routing.v2\032\036google/protobuf" + + "/wrappers.proto\032\030google/type/latlng.prot" + + "o\"^\n\010Location\022$\n\007lat_lng\030\001 \001(\0132\023.google." + + "type.LatLng\022,\n\007heading\030\002 \001(\0132\033.google.pr" + + "otobuf.Int32ValueB\305\001\n\032com.google.maps.ro" + + "uting.v2B\rLocationProtoP\001Z=google.golang" + + ".org/genproto/googleapis/maps/routing/v2" + + ";routing\370\001\001\242\002\005GMRV2\252\002\026Google.Maps.Routin" + + "g.V2\312\002\026Google\\Maps\\Routing\\V2\352\002\031Google::" + + "Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.type.LatLngProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_Location_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_Location_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_Location_descriptor, + new java.lang.String[] { + "LatLng", "Heading", + }); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.type.LatLngProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Maneuver.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Maneuver.java new file mode 100644 index 000000000000..912c04595aa0 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Maneuver.java @@ -0,0 +1,529 @@ +/* + * Copyright 2020 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/routing/v2/maneuver.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A set of values that specify the navigation action to take for the current
+ * step (e.g., turn left, merge, straight, etc.).
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.Maneuver} + */ +public enum Maneuver implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not used.
+   * 
+ * + * MANEUVER_UNSPECIFIED = 0; + */ + MANEUVER_UNSPECIFIED(0), + /** + * + * + *
+   * Turn slightly to the left.
+   * 
+ * + * TURN_SLIGHT_LEFT = 1; + */ + TURN_SLIGHT_LEFT(1), + /** + * + * + *
+   * Turn sharply to the left.
+   * 
+ * + * TURN_SHARP_LEFT = 2; + */ + TURN_SHARP_LEFT(2), + /** + * + * + *
+   * Make a left u-turn.
+   * 
+ * + * UTURN_LEFT = 3; + */ + UTURN_LEFT(3), + /** + * + * + *
+   * Turn left.
+   * 
+ * + * TURN_LEFT = 4; + */ + TURN_LEFT(4), + /** + * + * + *
+   * Turn slightly to the right.
+   * 
+ * + * TURN_SLIGHT_RIGHT = 5; + */ + TURN_SLIGHT_RIGHT(5), + /** + * + * + *
+   * Turn sharply to the right.
+   * 
+ * + * TURN_SHARP_RIGHT = 6; + */ + TURN_SHARP_RIGHT(6), + /** + * + * + *
+   * Make a right u-turn.
+   * 
+ * + * UTURN_RIGHT = 7; + */ + UTURN_RIGHT(7), + /** + * + * + *
+   * Turn right.
+   * 
+ * + * TURN_RIGHT = 8; + */ + TURN_RIGHT(8), + /** + * + * + *
+   * Go straight.
+   * 
+ * + * STRAIGHT = 9; + */ + STRAIGHT(9), + /** + * + * + *
+   * Take the left ramp.
+   * 
+ * + * RAMP_LEFT = 10; + */ + RAMP_LEFT(10), + /** + * + * + *
+   * Take the right ramp.
+   * 
+ * + * RAMP_RIGHT = 11; + */ + RAMP_RIGHT(11), + /** + * + * + *
+   * Merge into traffic.
+   * 
+ * + * MERGE = 12; + */ + MERGE(12), + /** + * + * + *
+   * Take the left fork.
+   * 
+ * + * FORK_LEFT = 13; + */ + FORK_LEFT(13), + /** + * + * + *
+   * Take the right fork.
+   * 
+ * + * FORK_RIGHT = 14; + */ + FORK_RIGHT(14), + /** + * + * + *
+   * Take the ferry.
+   * 
+ * + * FERRY = 15; + */ + FERRY(15), + /** + * + * + *
+   * Take the train leading onto the ferry.
+   * 
+ * + * FERRY_TRAIN = 16; + */ + FERRY_TRAIN(16), + /** + * + * + *
+   * Turn left at the roundabout.
+   * 
+ * + * ROUNDABOUT_LEFT = 17; + */ + ROUNDABOUT_LEFT(17), + /** + * + * + *
+   * Turn right at the roundabout.
+   * 
+ * + * ROUNDABOUT_RIGHT = 18; + */ + ROUNDABOUT_RIGHT(18), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not used.
+   * 
+ * + * MANEUVER_UNSPECIFIED = 0; + */ + public static final int MANEUVER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Turn slightly to the left.
+   * 
+ * + * TURN_SLIGHT_LEFT = 1; + */ + public static final int TURN_SLIGHT_LEFT_VALUE = 1; + /** + * + * + *
+   * Turn sharply to the left.
+   * 
+ * + * TURN_SHARP_LEFT = 2; + */ + public static final int TURN_SHARP_LEFT_VALUE = 2; + /** + * + * + *
+   * Make a left u-turn.
+   * 
+ * + * UTURN_LEFT = 3; + */ + public static final int UTURN_LEFT_VALUE = 3; + /** + * + * + *
+   * Turn left.
+   * 
+ * + * TURN_LEFT = 4; + */ + public static final int TURN_LEFT_VALUE = 4; + /** + * + * + *
+   * Turn slightly to the right.
+   * 
+ * + * TURN_SLIGHT_RIGHT = 5; + */ + public static final int TURN_SLIGHT_RIGHT_VALUE = 5; + /** + * + * + *
+   * Turn sharply to the right.
+   * 
+ * + * TURN_SHARP_RIGHT = 6; + */ + public static final int TURN_SHARP_RIGHT_VALUE = 6; + /** + * + * + *
+   * Make a right u-turn.
+   * 
+ * + * UTURN_RIGHT = 7; + */ + public static final int UTURN_RIGHT_VALUE = 7; + /** + * + * + *
+   * Turn right.
+   * 
+ * + * TURN_RIGHT = 8; + */ + public static final int TURN_RIGHT_VALUE = 8; + /** + * + * + *
+   * Go straight.
+   * 
+ * + * STRAIGHT = 9; + */ + public static final int STRAIGHT_VALUE = 9; + /** + * + * + *
+   * Take the left ramp.
+   * 
+ * + * RAMP_LEFT = 10; + */ + public static final int RAMP_LEFT_VALUE = 10; + /** + * + * + *
+   * Take the right ramp.
+   * 
+ * + * RAMP_RIGHT = 11; + */ + public static final int RAMP_RIGHT_VALUE = 11; + /** + * + * + *
+   * Merge into traffic.
+   * 
+ * + * MERGE = 12; + */ + public static final int MERGE_VALUE = 12; + /** + * + * + *
+   * Take the left fork.
+   * 
+ * + * FORK_LEFT = 13; + */ + public static final int FORK_LEFT_VALUE = 13; + /** + * + * + *
+   * Take the right fork.
+   * 
+ * + * FORK_RIGHT = 14; + */ + public static final int FORK_RIGHT_VALUE = 14; + /** + * + * + *
+   * Take the ferry.
+   * 
+ * + * FERRY = 15; + */ + public static final int FERRY_VALUE = 15; + /** + * + * + *
+   * Take the train leading onto the ferry.
+   * 
+ * + * FERRY_TRAIN = 16; + */ + public static final int FERRY_TRAIN_VALUE = 16; + /** + * + * + *
+   * Turn left at the roundabout.
+   * 
+ * + * ROUNDABOUT_LEFT = 17; + */ + public static final int ROUNDABOUT_LEFT_VALUE = 17; + /** + * + * + *
+   * Turn right at the roundabout.
+   * 
+ * + * ROUNDABOUT_RIGHT = 18; + */ + public static final int ROUNDABOUT_RIGHT_VALUE = 18; + + 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 Maneuver 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 Maneuver forNumber(int value) { + switch (value) { + case 0: + return MANEUVER_UNSPECIFIED; + case 1: + return TURN_SLIGHT_LEFT; + case 2: + return TURN_SHARP_LEFT; + case 3: + return UTURN_LEFT; + case 4: + return TURN_LEFT; + case 5: + return TURN_SLIGHT_RIGHT; + case 6: + return TURN_SHARP_RIGHT; + case 7: + return UTURN_RIGHT; + case 8: + return TURN_RIGHT; + case 9: + return STRAIGHT; + case 10: + return RAMP_LEFT; + case 11: + return RAMP_RIGHT; + case 12: + return MERGE; + case 13: + return FORK_LEFT; + case 14: + return FORK_RIGHT; + case 15: + return FERRY; + case 16: + return FERRY_TRAIN; + case 17: + return ROUNDABOUT_LEFT; + case 18: + return ROUNDABOUT_RIGHT; + 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 Maneuver findValueByNumber(int number) { + return Maneuver.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.routing.v2.ManeuverProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Maneuver[] VALUES = values(); + + public static Maneuver 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 Maneuver(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.Maneuver) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ManeuverProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ManeuverProto.java new file mode 100644 index 000000000000..f6c50fb87124 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/ManeuverProto.java @@ -0,0 +1,61 @@ +/* + * Copyright 2020 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/routing/v2/maneuver.proto + +package com.google.maps.routing.v2; + +public final class ManeuverProto { + private ManeuverProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/maps/routing/v2/maneuver.proto\022" + + "\026google.maps.routing.v2*\332\002\n\010Maneuver\022\030\n\024" + + "MANEUVER_UNSPECIFIED\020\000\022\024\n\020TURN_SLIGHT_LE" + + "FT\020\001\022\023\n\017TURN_SHARP_LEFT\020\002\022\016\n\nUTURN_LEFT\020" + + "\003\022\r\n\tTURN_LEFT\020\004\022\025\n\021TURN_SLIGHT_RIGHT\020\005\022" + + "\024\n\020TURN_SHARP_RIGHT\020\006\022\017\n\013UTURN_RIGHT\020\007\022\016" + + "\n\nTURN_RIGHT\020\010\022\014\n\010STRAIGHT\020\t\022\r\n\tRAMP_LEF" + + "T\020\n\022\016\n\nRAMP_RIGHT\020\013\022\t\n\005MERGE\020\014\022\r\n\tFORK_L" + + "EFT\020\r\022\016\n\nFORK_RIGHT\020\016\022\t\n\005FERRY\020\017\022\017\n\013FERR" + + "Y_TRAIN\020\020\022\023\n\017ROUNDABOUT_LEFT\020\021\022\024\n\020ROUNDA" + + "BOUT_RIGHT\020\022B\305\001\n\032com.google.maps.routing" + + ".v2B\rManeuverProtoP\001Z=google.golang.org/" + + "genproto/googleapis/maps/routing/v2;rout" + + "ing\370\001\001\242\002\005GMRV2\252\002\026Google.Maps.Routing.V2\312" + + "\002\026Google\\Maps\\Routing\\V2\352\002\031Google::Maps:" + + ":Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstruction.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstruction.java new file mode 100644 index 000000000000..fd64ff5e1778 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstruction.java @@ -0,0 +1,773 @@ +/* + * Copyright 2020 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/routing/v2/navigation_instruction.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates navigation instructions for a
+ * [RouteLegStep][google.maps.routing.v2.RouteLegStep]
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.NavigationInstruction} + */ +public final class NavigationInstruction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.NavigationInstruction) + NavigationInstructionOrBuilder { + private static final long serialVersionUID = 0L; + // Use NavigationInstruction.newBuilder() to construct. + private NavigationInstruction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NavigationInstruction() { + maneuver_ = 0; + instructions_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NavigationInstruction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.NavigationInstructionProto + .internal_static_google_maps_routing_v2_NavigationInstruction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.NavigationInstructionProto + .internal_static_google_maps_routing_v2_NavigationInstruction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.NavigationInstruction.class, + com.google.maps.routing.v2.NavigationInstruction.Builder.class); + } + + public static final int MANEUVER_FIELD_NUMBER = 1; + private int maneuver_; + /** + * + * + *
+   * Encapsulates the navigation instructions for the current step (e.g., turn
+   * left, merge, straight, etc.). This field determines which icon to display.
+   * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return The enum numeric value on the wire for maneuver. + */ + @java.lang.Override + public int getManeuverValue() { + return maneuver_; + } + /** + * + * + *
+   * Encapsulates the navigation instructions for the current step (e.g., turn
+   * left, merge, straight, etc.). This field determines which icon to display.
+   * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return The maneuver. + */ + @java.lang.Override + public com.google.maps.routing.v2.Maneuver getManeuver() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.Maneuver result = + com.google.maps.routing.v2.Maneuver.valueOf(maneuver_); + return result == null ? com.google.maps.routing.v2.Maneuver.UNRECOGNIZED : result; + } + + public static final int INSTRUCTIONS_FIELD_NUMBER = 2; + private volatile java.lang.Object instructions_; + /** + * + * + *
+   * Instructions for navigating this step.
+   * 
+ * + * string instructions = 2; + * + * @return The instructions. + */ + @java.lang.Override + public java.lang.String getInstructions() { + java.lang.Object ref = instructions_; + 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(); + instructions_ = s; + return s; + } + } + /** + * + * + *
+   * Instructions for navigating this step.
+   * 
+ * + * string instructions = 2; + * + * @return The bytes for instructions. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstructionsBytes() { + java.lang.Object ref = instructions_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instructions_ = 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 (maneuver_ != com.google.maps.routing.v2.Maneuver.MANEUVER_UNSPECIFIED.getNumber()) { + output.writeEnum(1, maneuver_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instructions_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instructions_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (maneuver_ != com.google.maps.routing.v2.Maneuver.MANEUVER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, maneuver_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instructions_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instructions_); + } + 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.routing.v2.NavigationInstruction)) { + return super.equals(obj); + } + com.google.maps.routing.v2.NavigationInstruction other = + (com.google.maps.routing.v2.NavigationInstruction) obj; + + if (maneuver_ != other.maneuver_) return false; + if (!getInstructions().equals(other.getInstructions())) 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) + MANEUVER_FIELD_NUMBER; + hash = (53 * hash) + maneuver_; + hash = (37 * hash) + INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getInstructions().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.NavigationInstruction parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.NavigationInstruction 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.routing.v2.NavigationInstruction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.NavigationInstruction 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.routing.v2.NavigationInstruction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.NavigationInstruction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.NavigationInstruction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.NavigationInstruction 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.routing.v2.NavigationInstruction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.NavigationInstruction 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.routing.v2.NavigationInstruction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.NavigationInstruction 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.routing.v2.NavigationInstruction 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 navigation instructions for a
+   * [RouteLegStep][google.maps.routing.v2.RouteLegStep]
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.NavigationInstruction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.NavigationInstruction) + com.google.maps.routing.v2.NavigationInstructionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.NavigationInstructionProto + .internal_static_google_maps_routing_v2_NavigationInstruction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.NavigationInstructionProto + .internal_static_google_maps_routing_v2_NavigationInstruction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.NavigationInstruction.class, + com.google.maps.routing.v2.NavigationInstruction.Builder.class); + } + + // Construct using com.google.maps.routing.v2.NavigationInstruction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + maneuver_ = 0; + + instructions_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.NavigationInstructionProto + .internal_static_google_maps_routing_v2_NavigationInstruction_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.NavigationInstruction getDefaultInstanceForType() { + return com.google.maps.routing.v2.NavigationInstruction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.NavigationInstruction build() { + com.google.maps.routing.v2.NavigationInstruction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.NavigationInstruction buildPartial() { + com.google.maps.routing.v2.NavigationInstruction result = + new com.google.maps.routing.v2.NavigationInstruction(this); + result.maneuver_ = maneuver_; + result.instructions_ = instructions_; + 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.routing.v2.NavigationInstruction) { + return mergeFrom((com.google.maps.routing.v2.NavigationInstruction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.NavigationInstruction other) { + if (other == com.google.maps.routing.v2.NavigationInstruction.getDefaultInstance()) + return this; + if (other.maneuver_ != 0) { + setManeuverValue(other.getManeuverValue()); + } + if (!other.getInstructions().isEmpty()) { + instructions_ = other.instructions_; + 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: + { + maneuver_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + instructions_ = input.readStringRequireUtf8(); + + 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 maneuver_ = 0; + /** + * + * + *
+     * Encapsulates the navigation instructions for the current step (e.g., turn
+     * left, merge, straight, etc.). This field determines which icon to display.
+     * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return The enum numeric value on the wire for maneuver. + */ + @java.lang.Override + public int getManeuverValue() { + return maneuver_; + } + /** + * + * + *
+     * Encapsulates the navigation instructions for the current step (e.g., turn
+     * left, merge, straight, etc.). This field determines which icon to display.
+     * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @param value The enum numeric value on the wire for maneuver to set. + * @return This builder for chaining. + */ + public Builder setManeuverValue(int value) { + + maneuver_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates the navigation instructions for the current step (e.g., turn
+     * left, merge, straight, etc.). This field determines which icon to display.
+     * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return The maneuver. + */ + @java.lang.Override + public com.google.maps.routing.v2.Maneuver getManeuver() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.Maneuver result = + com.google.maps.routing.v2.Maneuver.valueOf(maneuver_); + return result == null ? com.google.maps.routing.v2.Maneuver.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Encapsulates the navigation instructions for the current step (e.g., turn
+     * left, merge, straight, etc.). This field determines which icon to display.
+     * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @param value The maneuver to set. + * @return This builder for chaining. + */ + public Builder setManeuver(com.google.maps.routing.v2.Maneuver value) { + if (value == null) { + throw new NullPointerException(); + } + + maneuver_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates the navigation instructions for the current step (e.g., turn
+     * left, merge, straight, etc.). This field determines which icon to display.
+     * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return This builder for chaining. + */ + public Builder clearManeuver() { + + maneuver_ = 0; + onChanged(); + return this; + } + + private java.lang.Object instructions_ = ""; + /** + * + * + *
+     * Instructions for navigating this step.
+     * 
+ * + * string instructions = 2; + * + * @return The instructions. + */ + public java.lang.String getInstructions() { + java.lang.Object ref = instructions_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instructions_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Instructions for navigating this step.
+     * 
+ * + * string instructions = 2; + * + * @return The bytes for instructions. + */ + public com.google.protobuf.ByteString getInstructionsBytes() { + java.lang.Object ref = instructions_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instructions_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Instructions for navigating this step.
+     * 
+ * + * string instructions = 2; + * + * @param value The instructions to set. + * @return This builder for chaining. + */ + public Builder setInstructions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instructions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Instructions for navigating this step.
+     * 
+ * + * string instructions = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstructions() { + + instructions_ = getDefaultInstance().getInstructions(); + onChanged(); + return this; + } + /** + * + * + *
+     * Instructions for navigating this step.
+     * 
+ * + * string instructions = 2; + * + * @param value The bytes for instructions to set. + * @return This builder for chaining. + */ + public Builder setInstructionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instructions_ = value; + 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.routing.v2.NavigationInstruction) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.NavigationInstruction) + private static final com.google.maps.routing.v2.NavigationInstruction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.NavigationInstruction(); + } + + public static com.google.maps.routing.v2.NavigationInstruction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NavigationInstruction 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.routing.v2.NavigationInstruction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstructionOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstructionOrBuilder.java new file mode 100644 index 000000000000..cd4f6086f6cb --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstructionOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 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/routing/v2/navigation_instruction.proto + +package com.google.maps.routing.v2; + +public interface NavigationInstructionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.NavigationInstruction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Encapsulates the navigation instructions for the current step (e.g., turn
+   * left, merge, straight, etc.). This field determines which icon to display.
+   * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return The enum numeric value on the wire for maneuver. + */ + int getManeuverValue(); + /** + * + * + *
+   * Encapsulates the navigation instructions for the current step (e.g., turn
+   * left, merge, straight, etc.). This field determines which icon to display.
+   * 
+ * + * .google.maps.routing.v2.Maneuver maneuver = 1; + * + * @return The maneuver. + */ + com.google.maps.routing.v2.Maneuver getManeuver(); + + /** + * + * + *
+   * Instructions for navigating this step.
+   * 
+ * + * string instructions = 2; + * + * @return The instructions. + */ + java.lang.String getInstructions(); + /** + * + * + *
+   * Instructions for navigating this step.
+   * 
+ * + * string instructions = 2; + * + * @return The bytes for instructions. + */ + com.google.protobuf.ByteString getInstructionsBytes(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstructionProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstructionProto.java new file mode 100644 index 000000000000..13190eb8f396 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/NavigationInstructionProto.java @@ -0,0 +1,73 @@ +/* + * Copyright 2020 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/routing/v2/navigation_instruction.proto + +package com.google.maps.routing.v2; + +public final class NavigationInstructionProto { + private NavigationInstructionProto() {} + + 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_routing_v2_NavigationInstruction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_NavigationInstruction_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/maps/routing/v2/navigation_inst" + + "ruction.proto\022\026google.maps.routing.v2\032%g" + + "oogle/maps/routing/v2/maneuver.proto\"a\n\025" + + "NavigationInstruction\0222\n\010maneuver\030\001 \001(\0162" + + " .google.maps.routing.v2.Maneuver\022\024\n\014ins" + + "tructions\030\002 \001(\tB\322\001\n\032com.google.maps.rout" + + "ing.v2B\032NavigationInstructionProtoP\001Z=go" + + "ogle.golang.org/genproto/googleapis/maps" + + "/routing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Google." + + "Maps.Routing.V2\312\002\026Google\\Maps\\Routing\\V2" + + "\352\002\031Google::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.maps.routing.v2.ManeuverProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_NavigationInstruction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_NavigationInstruction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_NavigationInstruction_descriptor, + new java.lang.String[] { + "Maneuver", "Instructions", + }); + com.google.maps.routing.v2.ManeuverProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Polyline.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Polyline.java new file mode 100644 index 000000000000..1a249fa90660 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Polyline.java @@ -0,0 +1,1060 @@ +/* + * Copyright 2020 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/routing/v2/polyline.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates an encoded polyline.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.Polyline} + */ +public final class Polyline extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.Polyline) + PolylineOrBuilder { + private static final long serialVersionUID = 0L; + // Use Polyline.newBuilder() to construct. + private Polyline(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Polyline() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Polyline(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.PolylineProto + .internal_static_google_maps_routing_v2_Polyline_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.PolylineProto + .internal_static_google_maps_routing_v2_Polyline_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Polyline.class, + com.google.maps.routing.v2.Polyline.Builder.class); + } + + private int polylineTypeCase_ = 0; + private java.lang.Object polylineType_; + + public enum PolylineTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ENCODED_POLYLINE(1), + GEO_JSON_LINESTRING(2), + POLYLINETYPE_NOT_SET(0); + private final int value; + + private PolylineTypeCase(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 PolylineTypeCase valueOf(int value) { + return forNumber(value); + } + + public static PolylineTypeCase forNumber(int value) { + switch (value) { + case 1: + return ENCODED_POLYLINE; + case 2: + return GEO_JSON_LINESTRING; + case 0: + return POLYLINETYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PolylineTypeCase getPolylineTypeCase() { + return PolylineTypeCase.forNumber(polylineTypeCase_); + } + + public static final int ENCODED_POLYLINE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The string encoding of the polyline using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+   * 
+ * + * string encoded_polyline = 1; + * + * @return Whether the encodedPolyline field is set. + */ + public boolean hasEncodedPolyline() { + return polylineTypeCase_ == 1; + } + /** + * + * + *
+   * The string encoding of the polyline using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+   * 
+ * + * string encoded_polyline = 1; + * + * @return The encodedPolyline. + */ + public java.lang.String getEncodedPolyline() { + java.lang.Object ref = ""; + if (polylineTypeCase_ == 1) { + ref = polylineType_; + } + 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 (polylineTypeCase_ == 1) { + polylineType_ = s; + } + return s; + } + } + /** + * + * + *
+   * The string encoding of the polyline using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+   * 
+ * + * string encoded_polyline = 1; + * + * @return The bytes for encodedPolyline. + */ + public com.google.protobuf.ByteString getEncodedPolylineBytes() { + java.lang.Object ref = ""; + if (polylineTypeCase_ == 1) { + ref = polylineType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (polylineTypeCase_ == 1) { + polylineType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GEO_JSON_LINESTRING_FIELD_NUMBER = 2; + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + * + * @return Whether the geoJsonLinestring field is set. + */ + @java.lang.Override + public boolean hasGeoJsonLinestring() { + return polylineTypeCase_ == 2; + } + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + * + * @return The geoJsonLinestring. + */ + @java.lang.Override + public com.google.protobuf.Struct getGeoJsonLinestring() { + if (polylineTypeCase_ == 2) { + return (com.google.protobuf.Struct) polylineType_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getGeoJsonLinestringOrBuilder() { + if (polylineTypeCase_ == 2) { + return (com.google.protobuf.Struct) polylineType_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + 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 (polylineTypeCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, polylineType_); + } + if (polylineTypeCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Struct) polylineType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (polylineTypeCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, polylineType_); + } + if (polylineTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Struct) polylineType_); + } + 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.routing.v2.Polyline)) { + return super.equals(obj); + } + com.google.maps.routing.v2.Polyline other = (com.google.maps.routing.v2.Polyline) obj; + + if (!getPolylineTypeCase().equals(other.getPolylineTypeCase())) return false; + switch (polylineTypeCase_) { + case 1: + if (!getEncodedPolyline().equals(other.getEncodedPolyline())) return false; + break; + case 2: + if (!getGeoJsonLinestring().equals(other.getGeoJsonLinestring())) 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(); + switch (polylineTypeCase_) { + case 1: + hash = (37 * hash) + ENCODED_POLYLINE_FIELD_NUMBER; + hash = (53 * hash) + getEncodedPolyline().hashCode(); + break; + case 2: + hash = (37 * hash) + GEO_JSON_LINESTRING_FIELD_NUMBER; + hash = (53 * hash) + getGeoJsonLinestring().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.Polyline parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Polyline 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.routing.v2.Polyline parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Polyline 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.routing.v2.Polyline parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Polyline parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.Polyline parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.Polyline 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.routing.v2.Polyline parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.Polyline 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.routing.v2.Polyline parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.Polyline 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.routing.v2.Polyline 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 an encoded polyline.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.Polyline} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.Polyline) + com.google.maps.routing.v2.PolylineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.PolylineProto + .internal_static_google_maps_routing_v2_Polyline_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.PolylineProto + .internal_static_google_maps_routing_v2_Polyline_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Polyline.class, + com.google.maps.routing.v2.Polyline.Builder.class); + } + + // Construct using com.google.maps.routing.v2.Polyline.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (geoJsonLinestringBuilder_ != null) { + geoJsonLinestringBuilder_.clear(); + } + polylineTypeCase_ = 0; + polylineType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.PolylineProto + .internal_static_google_maps_routing_v2_Polyline_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.Polyline getDefaultInstanceForType() { + return com.google.maps.routing.v2.Polyline.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.Polyline build() { + com.google.maps.routing.v2.Polyline result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.Polyline buildPartial() { + com.google.maps.routing.v2.Polyline result = new com.google.maps.routing.v2.Polyline(this); + if (polylineTypeCase_ == 1) { + result.polylineType_ = polylineType_; + } + if (polylineTypeCase_ == 2) { + if (geoJsonLinestringBuilder_ == null) { + result.polylineType_ = polylineType_; + } else { + result.polylineType_ = geoJsonLinestringBuilder_.build(); + } + } + result.polylineTypeCase_ = polylineTypeCase_; + 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.routing.v2.Polyline) { + return mergeFrom((com.google.maps.routing.v2.Polyline) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.Polyline other) { + if (other == com.google.maps.routing.v2.Polyline.getDefaultInstance()) return this; + switch (other.getPolylineTypeCase()) { + case ENCODED_POLYLINE: + { + polylineTypeCase_ = 1; + polylineType_ = other.polylineType_; + onChanged(); + break; + } + case GEO_JSON_LINESTRING: + { + mergeGeoJsonLinestring(other.getGeoJsonLinestring()); + break; + } + case POLYLINETYPE_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: + { + java.lang.String s = input.readStringRequireUtf8(); + polylineTypeCase_ = 1; + polylineType_ = s; + break; + } // case 10 + case 18: + { + input.readMessage( + getGeoJsonLinestringFieldBuilder().getBuilder(), extensionRegistry); + polylineTypeCase_ = 2; + 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 polylineTypeCase_ = 0; + private java.lang.Object polylineType_; + + public PolylineTypeCase getPolylineTypeCase() { + return PolylineTypeCase.forNumber(polylineTypeCase_); + } + + public Builder clearPolylineType() { + polylineTypeCase_ = 0; + polylineType_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * The string encoding of the polyline using the [polyline encoding
+     * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+     * 
+ * + * string encoded_polyline = 1; + * + * @return Whether the encodedPolyline field is set. + */ + @java.lang.Override + public boolean hasEncodedPolyline() { + return polylineTypeCase_ == 1; + } + /** + * + * + *
+     * The string encoding of the polyline using the [polyline encoding
+     * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+     * 
+ * + * string encoded_polyline = 1; + * + * @return The encodedPolyline. + */ + @java.lang.Override + public java.lang.String getEncodedPolyline() { + java.lang.Object ref = ""; + if (polylineTypeCase_ == 1) { + ref = polylineType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (polylineTypeCase_ == 1) { + polylineType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The string encoding of the polyline using the [polyline encoding
+     * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+     * 
+ * + * string encoded_polyline = 1; + * + * @return The bytes for encodedPolyline. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncodedPolylineBytes() { + java.lang.Object ref = ""; + if (polylineTypeCase_ == 1) { + ref = polylineType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (polylineTypeCase_ == 1) { + polylineType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The string encoding of the polyline using the [polyline encoding
+     * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+     * 
+ * + * string encoded_polyline = 1; + * + * @param value The encodedPolyline to set. + * @return This builder for chaining. + */ + public Builder setEncodedPolyline(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + polylineTypeCase_ = 1; + polylineType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The string encoding of the polyline using the [polyline encoding
+     * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+     * 
+ * + * string encoded_polyline = 1; + * + * @return This builder for chaining. + */ + public Builder clearEncodedPolyline() { + if (polylineTypeCase_ == 1) { + polylineTypeCase_ = 0; + polylineType_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The string encoding of the polyline using the [polyline encoding
+     * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+     * 
+ * + * string encoded_polyline = 1; + * + * @param value The bytes for encodedPolyline to set. + * @return This builder for chaining. + */ + public Builder setEncodedPolylineBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + polylineTypeCase_ = 1; + polylineType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + geoJsonLinestringBuilder_; + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + * + * @return Whether the geoJsonLinestring field is set. + */ + @java.lang.Override + public boolean hasGeoJsonLinestring() { + return polylineTypeCase_ == 2; + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + * + * @return The geoJsonLinestring. + */ + @java.lang.Override + public com.google.protobuf.Struct getGeoJsonLinestring() { + if (geoJsonLinestringBuilder_ == null) { + if (polylineTypeCase_ == 2) { + return (com.google.protobuf.Struct) polylineType_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (polylineTypeCase_ == 2) { + return geoJsonLinestringBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + public Builder setGeoJsonLinestring(com.google.protobuf.Struct value) { + if (geoJsonLinestringBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polylineType_ = value; + onChanged(); + } else { + geoJsonLinestringBuilder_.setMessage(value); + } + polylineTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + public Builder setGeoJsonLinestring(com.google.protobuf.Struct.Builder builderForValue) { + if (geoJsonLinestringBuilder_ == null) { + polylineType_ = builderForValue.build(); + onChanged(); + } else { + geoJsonLinestringBuilder_.setMessage(builderForValue.build()); + } + polylineTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + public Builder mergeGeoJsonLinestring(com.google.protobuf.Struct value) { + if (geoJsonLinestringBuilder_ == null) { + if (polylineTypeCase_ == 2 + && polylineType_ != com.google.protobuf.Struct.getDefaultInstance()) { + polylineType_ = + com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) polylineType_) + .mergeFrom(value) + .buildPartial(); + } else { + polylineType_ = value; + } + onChanged(); + } else { + if (polylineTypeCase_ == 2) { + geoJsonLinestringBuilder_.mergeFrom(value); + } else { + geoJsonLinestringBuilder_.setMessage(value); + } + } + polylineTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + public Builder clearGeoJsonLinestring() { + if (geoJsonLinestringBuilder_ == null) { + if (polylineTypeCase_ == 2) { + polylineTypeCase_ = 0; + polylineType_ = null; + onChanged(); + } + } else { + if (polylineTypeCase_ == 2) { + polylineTypeCase_ = 0; + polylineType_ = null; + } + geoJsonLinestringBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + public com.google.protobuf.Struct.Builder getGeoJsonLinestringBuilder() { + return getGeoJsonLinestringFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getGeoJsonLinestringOrBuilder() { + if ((polylineTypeCase_ == 2) && (geoJsonLinestringBuilder_ != null)) { + return geoJsonLinestringBuilder_.getMessageOrBuilder(); + } else { + if (polylineTypeCase_ == 2) { + return (com.google.protobuf.Struct) polylineType_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * Specifies a polyline using the [GeoJSON LineString
+     * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+     * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getGeoJsonLinestringFieldBuilder() { + if (geoJsonLinestringBuilder_ == null) { + if (!(polylineTypeCase_ == 2)) { + polylineType_ = com.google.protobuf.Struct.getDefaultInstance(); + } + geoJsonLinestringBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) polylineType_, getParentForChildren(), isClean()); + polylineType_ = null; + } + polylineTypeCase_ = 2; + onChanged(); + ; + return geoJsonLinestringBuilder_; + } + + @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.routing.v2.Polyline) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.Polyline) + private static final com.google.maps.routing.v2.Polyline DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.Polyline(); + } + + public static com.google.maps.routing.v2.Polyline getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Polyline 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.routing.v2.Polyline getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineEncoding.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineEncoding.java new file mode 100644 index 000000000000..bff0044509ae --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineEncoding.java @@ -0,0 +1,180 @@ +/* + * Copyright 2020 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/routing/v2/polyline.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Specifies the preferred type of polyline to be returned.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.PolylineEncoding} + */ +public enum PolylineEncoding implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No polyline type preference specified. Defaults to `ENCODED_POLYLINE`.
+   * 
+ * + * POLYLINE_ENCODING_UNSPECIFIED = 0; + */ + POLYLINE_ENCODING_UNSPECIFIED(0), + /** + * + * + *
+   * Specifies a polyline encoded using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm).
+   * 
+ * + * ENCODED_POLYLINE = 1; + */ + ENCODED_POLYLINE(1), + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * GEO_JSON_LINESTRING = 2; + */ + GEO_JSON_LINESTRING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No polyline type preference specified. Defaults to `ENCODED_POLYLINE`.
+   * 
+ * + * POLYLINE_ENCODING_UNSPECIFIED = 0; + */ + public static final int POLYLINE_ENCODING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Specifies a polyline encoded using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm).
+   * 
+ * + * ENCODED_POLYLINE = 1; + */ + public static final int ENCODED_POLYLINE_VALUE = 1; + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * GEO_JSON_LINESTRING = 2; + */ + public static final int GEO_JSON_LINESTRING_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 PolylineEncoding 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 PolylineEncoding forNumber(int value) { + switch (value) { + case 0: + return POLYLINE_ENCODING_UNSPECIFIED; + case 1: + return ENCODED_POLYLINE; + case 2: + return GEO_JSON_LINESTRING; + 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 PolylineEncoding findValueByNumber(int number) { + return PolylineEncoding.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.routing.v2.PolylineProto.getDescriptor().getEnumTypes().get(1); + } + + private static final PolylineEncoding[] VALUES = values(); + + public static PolylineEncoding 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 PolylineEncoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.PolylineEncoding) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineOrBuilder.java new file mode 100644 index 000000000000..815fc261c33d --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 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/routing/v2/polyline.proto + +package com.google.maps.routing.v2; + +public interface PolylineOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.Polyline) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The string encoding of the polyline using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+   * 
+ * + * string encoded_polyline = 1; + * + * @return Whether the encodedPolyline field is set. + */ + boolean hasEncodedPolyline(); + /** + * + * + *
+   * The string encoding of the polyline using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+   * 
+ * + * string encoded_polyline = 1; + * + * @return The encodedPolyline. + */ + java.lang.String getEncodedPolyline(); + /** + * + * + *
+   * The string encoding of the polyline using the [polyline encoding
+   * algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
+   * 
+ * + * string encoded_polyline = 1; + * + * @return The bytes for encodedPolyline. + */ + com.google.protobuf.ByteString getEncodedPolylineBytes(); + + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + * + * @return Whether the geoJsonLinestring field is set. + */ + boolean hasGeoJsonLinestring(); + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + * + * @return The geoJsonLinestring. + */ + com.google.protobuf.Struct getGeoJsonLinestring(); + /** + * + * + *
+   * Specifies a polyline using the [GeoJSON LineString
+   * format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
+   * 
+ * + * .google.protobuf.Struct geo_json_linestring = 2; + */ + com.google.protobuf.StructOrBuilder getGeoJsonLinestringOrBuilder(); + + public com.google.maps.routing.v2.Polyline.PolylineTypeCase getPolylineTypeCase(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineProto.java new file mode 100644 index 000000000000..a743db5a4a31 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineProto.java @@ -0,0 +1,78 @@ +/* + * Copyright 2020 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/routing/v2/polyline.proto + +package com.google.maps.routing.v2; + +public final class PolylineProto { + private PolylineProto() {} + + 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_routing_v2_Polyline_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_Polyline_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/maps/routing/v2/polyline.proto\022" + + "\026google.maps.routing.v2\032\034google/protobuf" + + "/struct.proto\"o\n\010Polyline\022\032\n\020encoded_pol" + + "yline\030\001 \001(\tH\000\0226\n\023geo_json_linestring\030\002 \001" + + "(\0132\027.google.protobuf.StructH\000B\017\n\rpolylin" + + "e_type*S\n\017PolylineQuality\022 \n\034POLYLINE_QU" + + "ALITY_UNSPECIFIED\020\000\022\020\n\014HIGH_QUALITY\020\001\022\014\n" + + "\010OVERVIEW\020\002*d\n\020PolylineEncoding\022!\n\035POLYL" + + "INE_ENCODING_UNSPECIFIED\020\000\022\024\n\020ENCODED_PO" + + "LYLINE\020\001\022\027\n\023GEO_JSON_LINESTRING\020\002B\305\001\n\032co" + + "m.google.maps.routing.v2B\rPolylineProtoP" + + "\001Z=google.golang.org/genproto/googleapis" + + "/maps/routing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Go" + + "ogle.Maps.Routing.V2\312\002\026Google\\Maps\\Routi" + + "ng\\V2\352\002\031Google::Maps::Routing::V2b\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_Polyline_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_Polyline_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_Polyline_descriptor, + new java.lang.String[] { + "EncodedPolyline", "GeoJsonLinestring", "PolylineType", + }); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineQuality.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineQuality.java new file mode 100644 index 000000000000..abdb1901ca63 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/PolylineQuality.java @@ -0,0 +1,186 @@ +/* + * Copyright 2020 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/routing/v2/polyline.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A set of values that specify the quality of the polyline.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.PolylineQuality} + */ +public enum PolylineQuality implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No polyline quality preference specified. Defaults to `OVERVIEW`.
+   * 
+ * + * POLYLINE_QUALITY_UNSPECIFIED = 0; + */ + POLYLINE_QUALITY_UNSPECIFIED(0), + /** + * + * + *
+   * Specifies a high-quality polyline - which is composed using more points
+   * than `OVERVIEW`, at the cost of increased response size. Use this value
+   * when you need more precision.
+   * 
+ * + * HIGH_QUALITY = 1; + */ + HIGH_QUALITY(1), + /** + * + * + *
+   * Specifies an overview polyline - which is composed using a small number of
+   * points. Use this value when displaying an overview of the route. Using this
+   * option has a lower request latency compared to using the
+   * `HIGH_QUALITY` option.
+   * 
+ * + * OVERVIEW = 2; + */ + OVERVIEW(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No polyline quality preference specified. Defaults to `OVERVIEW`.
+   * 
+ * + * POLYLINE_QUALITY_UNSPECIFIED = 0; + */ + public static final int POLYLINE_QUALITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Specifies a high-quality polyline - which is composed using more points
+   * than `OVERVIEW`, at the cost of increased response size. Use this value
+   * when you need more precision.
+   * 
+ * + * HIGH_QUALITY = 1; + */ + public static final int HIGH_QUALITY_VALUE = 1; + /** + * + * + *
+   * Specifies an overview polyline - which is composed using a small number of
+   * points. Use this value when displaying an overview of the route. Using this
+   * option has a lower request latency compared to using the
+   * `HIGH_QUALITY` option.
+   * 
+ * + * OVERVIEW = 2; + */ + public static final int OVERVIEW_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 PolylineQuality 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 PolylineQuality forNumber(int value) { + switch (value) { + case 0: + return POLYLINE_QUALITY_UNSPECIFIED; + case 1: + return HIGH_QUALITY; + case 2: + return OVERVIEW; + 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 PolylineQuality findValueByNumber(int number) { + return PolylineQuality.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.routing.v2.PolylineProto.getDescriptor().getEnumTypes().get(0); + } + + private static final PolylineQuality[] VALUES = values(); + + public static PolylineQuality 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 PolylineQuality(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.PolylineQuality) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Route.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Route.java new file mode 100644 index 000000000000..c7f18faddafa --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Route.java @@ -0,0 +1,3589 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates a route, which consists of a series of connected road segments
+ * that join beginning, ending, and intermediate waypoints.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.Route} + */ +public final class Route extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.Route) + RouteOrBuilder { + private static final long serialVersionUID = 0L; + // Use Route.newBuilder() to construct. + private Route(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Route() { + routeLabels_ = java.util.Collections.emptyList(); + legs_ = java.util.Collections.emptyList(); + description_ = ""; + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + routeToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Route(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_Route_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_Route_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Route.class, com.google.maps.routing.v2.Route.Builder.class); + } + + public static final int ROUTE_LABELS_FIELD_NUMBER = 13; + private java.util.List routeLabels_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.routing.v2.RouteLabel> + routeLabels_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.routing.v2.RouteLabel>() { + public com.google.maps.routing.v2.RouteLabel convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteLabel result = + com.google.maps.routing.v2.RouteLabel.valueOf(from); + return result == null ? com.google.maps.routing.v2.RouteLabel.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return A list containing the routeLabels. + */ + @java.lang.Override + public java.util.List getRouteLabelsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.routing.v2.RouteLabel>( + routeLabels_, routeLabels_converter_); + } + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return The count of routeLabels. + */ + @java.lang.Override + public int getRouteLabelsCount() { + return routeLabels_.size(); + } + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index of the element to return. + * @return The routeLabels at the given index. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLabel getRouteLabels(int index) { + return routeLabels_converter_.convert(routeLabels_.get(index)); + } + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return A list containing the enum numeric values on the wire for routeLabels. + */ + @java.lang.Override + public java.util.List getRouteLabelsValueList() { + return routeLabels_; + } + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of routeLabels at the given index. + */ + @java.lang.Override + public int getRouteLabelsValue(int index) { + return routeLabels_.get(index); + } + + private int routeLabelsMemoizedSerializedSize; + + public static final int LEGS_FIELD_NUMBER = 1; + private java.util.List legs_; + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + @java.lang.Override + public java.util.List getLegsList() { + return legs_; + } + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + @java.lang.Override + public java.util.List + getLegsOrBuilderList() { + return legs_; + } + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + @java.lang.Override + public int getLegsCount() { + return legs_.size(); + } + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLeg getLegs(int index) { + return legs_.get(index); + } + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegOrBuilder getLegsOrBuilder(int index) { + return legs_.get(index); + } + + public static final int DISTANCE_METERS_FIELD_NUMBER = 2; + private int distanceMeters_; + /** + * + * + *
+   * The travel distance of the route, in meters.
+   * 
+ * + * int32 distance_meters = 2; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + + public static final int DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 3; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 3; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return getDuration(); + } + + public static final int STATIC_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration staticDuration_; + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 4; + * + * @return Whether the staticDuration field is set. + */ + @java.lang.Override + public boolean hasStaticDuration() { + return staticDuration_ != null; + } + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 4; + * + * @return The staticDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getStaticDuration() { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + return getStaticDuration(); + } + + public static final int POLYLINE_FIELD_NUMBER = 5; + private com.google.maps.routing.v2.Polyline polyline_; + /** + * + * + *
+   * The overall route polyline. This polyline will be the combined polyline of
+   * all `legs`.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + * + * @return Whether the polyline field is set. + */ + @java.lang.Override + public boolean hasPolyline() { + return polyline_ != null; + } + /** + * + * + *
+   * The overall route polyline. This polyline will be the combined polyline of
+   * all `legs`.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + * + * @return The polyline. + */ + @java.lang.Override + public com.google.maps.routing.v2.Polyline getPolyline() { + return polyline_ == null ? com.google.maps.routing.v2.Polyline.getDefaultInstance() : polyline_; + } + /** + * + * + *
+   * The overall route polyline. This polyline will be the combined polyline of
+   * all `legs`.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder() { + return getPolyline(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + private volatile java.lang.Object description_; + /** + * + * + *
+   * A description of the route.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * A description of the route.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WARNINGS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList warnings_; + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_; + } + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + + public static final int VIEWPORT_FIELD_NUMBER = 8; + private com.google.geo.type.Viewport viewport_; + /** + * + * + *
+   * The viewport bounding box of the polyline.
+   * 
+ * + * .google.geo.type.Viewport viewport = 8; + * + * @return Whether the viewport field is set. + */ + @java.lang.Override + public boolean hasViewport() { + return viewport_ != null; + } + /** + * + * + *
+   * The viewport bounding box of the polyline.
+   * 
+ * + * .google.geo.type.Viewport viewport = 8; + * + * @return The viewport. + */ + @java.lang.Override + public com.google.geo.type.Viewport getViewport() { + return viewport_ == null ? com.google.geo.type.Viewport.getDefaultInstance() : viewport_; + } + /** + * + * + *
+   * The viewport bounding box of the polyline.
+   * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + @java.lang.Override + public com.google.geo.type.ViewportOrBuilder getViewportOrBuilder() { + return getViewport(); + } + + public static final int TRAVEL_ADVISORY_FIELD_NUMBER = 9; + private com.google.maps.routing.v2.RouteTravelAdvisory travelAdvisory_; + /** + * + * + *
+   * Additional information about the route.
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + * + * @return Whether the travelAdvisory field is set. + */ + @java.lang.Override + public boolean hasTravelAdvisory() { + return travelAdvisory_ != null; + } + /** + * + * + *
+   * Additional information about the route.
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + * + * @return The travelAdvisory. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisory getTravelAdvisory() { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + /** + * + * + *
+   * Additional information about the route.
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() { + return getTravelAdvisory(); + } + + public static final int ROUTE_TOKEN_FIELD_NUMBER = 12; + private volatile java.lang.Object routeToken_; + /** + * + * + *
+   * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+   * which allows the Navigation SDK to reconstruct the route during navigation,
+   * and in the event of rerouting honor the original intention when Routes
+   * ComputeRoutes is called. Customers should treat this token as an
+   * opaque blob.
+   * 
+ * + * string route_token = 12; + * + * @return The routeToken. + */ + @java.lang.Override + public java.lang.String getRouteToken() { + java.lang.Object ref = routeToken_; + 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(); + routeToken_ = s; + return s; + } + } + /** + * + * + *
+   * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+   * which allows the Navigation SDK to reconstruct the route during navigation,
+   * and in the event of rerouting honor the original intention when Routes
+   * ComputeRoutes is called. Customers should treat this token as an
+   * opaque blob.
+   * 
+ * + * string route_token = 12; + * + * @return The bytes for routeToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRouteTokenBytes() { + java.lang.Object ref = routeToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routeToken_ = 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 { + getSerializedSize(); + for (int i = 0; i < legs_.size(); i++) { + output.writeMessage(1, legs_.get(i)); + } + if (distanceMeters_ != 0) { + output.writeInt32(2, distanceMeters_); + } + if (duration_ != null) { + output.writeMessage(3, getDuration()); + } + if (staticDuration_ != null) { + output.writeMessage(4, getStaticDuration()); + } + if (polyline_ != null) { + output.writeMessage(5, getPolyline()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + for (int i = 0; i < warnings_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, warnings_.getRaw(i)); + } + if (viewport_ != null) { + output.writeMessage(8, getViewport()); + } + if (travelAdvisory_ != null) { + output.writeMessage(9, getTravelAdvisory()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(routeToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, routeToken_); + } + if (getRouteLabelsList().size() > 0) { + output.writeUInt32NoTag(106); + output.writeUInt32NoTag(routeLabelsMemoizedSerializedSize); + } + for (int i = 0; i < routeLabels_.size(); i++) { + output.writeEnumNoTag(routeLabels_.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 < legs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, legs_.get(i)); + } + if (distanceMeters_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, distanceMeters_); + } + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDuration()); + } + if (staticDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStaticDuration()); + } + if (polyline_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPolyline()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + { + int dataSize = 0; + for (int i = 0; i < warnings_.size(); i++) { + dataSize += computeStringSizeNoTag(warnings_.getRaw(i)); + } + size += dataSize; + size += 1 * getWarningsList().size(); + } + if (viewport_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getViewport()); + } + if (travelAdvisory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTravelAdvisory()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(routeToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, routeToken_); + } + { + int dataSize = 0; + for (int i = 0; i < routeLabels_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(routeLabels_.get(i)); + } + size += dataSize; + if (!getRouteLabelsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + routeLabelsMemoizedSerializedSize = 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.routing.v2.Route)) { + return super.equals(obj); + } + com.google.maps.routing.v2.Route other = (com.google.maps.routing.v2.Route) obj; + + if (!routeLabels_.equals(other.routeLabels_)) return false; + if (!getLegsList().equals(other.getLegsList())) return false; + if (getDistanceMeters() != other.getDistanceMeters()) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (hasStaticDuration() != other.hasStaticDuration()) return false; + if (hasStaticDuration()) { + if (!getStaticDuration().equals(other.getStaticDuration())) return false; + } + if (hasPolyline() != other.hasPolyline()) return false; + if (hasPolyline()) { + if (!getPolyline().equals(other.getPolyline())) return false; + } + if (!getDescription().equals(other.getDescription())) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (hasViewport() != other.hasViewport()) return false; + if (hasViewport()) { + if (!getViewport().equals(other.getViewport())) return false; + } + if (hasTravelAdvisory() != other.hasTravelAdvisory()) return false; + if (hasTravelAdvisory()) { + if (!getTravelAdvisory().equals(other.getTravelAdvisory())) return false; + } + if (!getRouteToken().equals(other.getRouteToken())) 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 (getRouteLabelsCount() > 0) { + hash = (37 * hash) + ROUTE_LABELS_FIELD_NUMBER; + hash = (53 * hash) + routeLabels_.hashCode(); + } + if (getLegsCount() > 0) { + hash = (37 * hash) + LEGS_FIELD_NUMBER; + hash = (53 * hash) + getLegsList().hashCode(); + } + hash = (37 * hash) + DISTANCE_METERS_FIELD_NUMBER; + hash = (53 * hash) + getDistanceMeters(); + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + if (hasStaticDuration()) { + hash = (37 * hash) + STATIC_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getStaticDuration().hashCode(); + } + if (hasPolyline()) { + hash = (37 * hash) + POLYLINE_FIELD_NUMBER; + hash = (53 * hash) + getPolyline().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + if (hasViewport()) { + hash = (37 * hash) + VIEWPORT_FIELD_NUMBER; + hash = (53 * hash) + getViewport().hashCode(); + } + if (hasTravelAdvisory()) { + hash = (37 * hash) + TRAVEL_ADVISORY_FIELD_NUMBER; + hash = (53 * hash) + getTravelAdvisory().hashCode(); + } + hash = (37 * hash) + ROUTE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getRouteToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.Route parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Route 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.routing.v2.Route parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Route 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.routing.v2.Route parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Route parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.Route parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.Route 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.routing.v2.Route parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.Route 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.routing.v2.Route parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.Route 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.routing.v2.Route 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 route, which consists of a series of connected road segments
+   * that join beginning, ending, and intermediate waypoints.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.Route} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.Route) + com.google.maps.routing.v2.RouteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_Route_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_Route_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Route.class, + com.google.maps.routing.v2.Route.Builder.class); + } + + // Construct using com.google.maps.routing.v2.Route.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + routeLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (legsBuilder_ == null) { + legs_ = java.util.Collections.emptyList(); + } else { + legs_ = null; + legsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + distanceMeters_ = 0; + + if (durationBuilder_ == null) { + duration_ = null; + } else { + duration_ = null; + durationBuilder_ = null; + } + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + if (polylineBuilder_ == null) { + polyline_ = null; + } else { + polyline_ = null; + polylineBuilder_ = null; + } + description_ = ""; + + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (viewportBuilder_ == null) { + viewport_ = null; + } else { + viewport_ = null; + viewportBuilder_ = null; + } + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + routeToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_Route_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.Route getDefaultInstanceForType() { + return com.google.maps.routing.v2.Route.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.Route build() { + com.google.maps.routing.v2.Route result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.Route buildPartial() { + com.google.maps.routing.v2.Route result = new com.google.maps.routing.v2.Route(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + routeLabels_ = java.util.Collections.unmodifiableList(routeLabels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.routeLabels_ = routeLabels_; + if (legsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + legs_ = java.util.Collections.unmodifiableList(legs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.legs_ = legs_; + } else { + result.legs_ = legsBuilder_.build(); + } + result.distanceMeters_ = distanceMeters_; + if (durationBuilder_ == null) { + result.duration_ = duration_; + } else { + result.duration_ = durationBuilder_.build(); + } + if (staticDurationBuilder_ == null) { + result.staticDuration_ = staticDuration_; + } else { + result.staticDuration_ = staticDurationBuilder_.build(); + } + if (polylineBuilder_ == null) { + result.polyline_ = polyline_; + } else { + result.polyline_ = polylineBuilder_.build(); + } + result.description_ = description_; + if (((bitField0_ & 0x00000004) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.warnings_ = warnings_; + if (viewportBuilder_ == null) { + result.viewport_ = viewport_; + } else { + result.viewport_ = viewportBuilder_.build(); + } + if (travelAdvisoryBuilder_ == null) { + result.travelAdvisory_ = travelAdvisory_; + } else { + result.travelAdvisory_ = travelAdvisoryBuilder_.build(); + } + result.routeToken_ = routeToken_; + 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.routing.v2.Route) { + return mergeFrom((com.google.maps.routing.v2.Route) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.Route other) { + if (other == com.google.maps.routing.v2.Route.getDefaultInstance()) return this; + if (!other.routeLabels_.isEmpty()) { + if (routeLabels_.isEmpty()) { + routeLabels_ = other.routeLabels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRouteLabelsIsMutable(); + routeLabels_.addAll(other.routeLabels_); + } + onChanged(); + } + if (legsBuilder_ == null) { + if (!other.legs_.isEmpty()) { + if (legs_.isEmpty()) { + legs_ = other.legs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLegsIsMutable(); + legs_.addAll(other.legs_); + } + onChanged(); + } + } else { + if (!other.legs_.isEmpty()) { + if (legsBuilder_.isEmpty()) { + legsBuilder_.dispose(); + legsBuilder_ = null; + legs_ = other.legs_; + bitField0_ = (bitField0_ & ~0x00000002); + legsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLegsFieldBuilder() + : null; + } else { + legsBuilder_.addAllMessages(other.legs_); + } + } + } + if (other.getDistanceMeters() != 0) { + setDistanceMeters(other.getDistanceMeters()); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasStaticDuration()) { + mergeStaticDuration(other.getStaticDuration()); + } + if (other.hasPolyline()) { + mergePolyline(other.getPolyline()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + if (other.hasViewport()) { + mergeViewport(other.getViewport()); + } + if (other.hasTravelAdvisory()) { + mergeTravelAdvisory(other.getTravelAdvisory()); + } + if (!other.getRouteToken().isEmpty()) { + routeToken_ = other.routeToken_; + 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.routing.v2.RouteLeg m = + input.readMessage( + com.google.maps.routing.v2.RouteLeg.parser(), extensionRegistry); + if (legsBuilder_ == null) { + ensureLegsIsMutable(); + legs_.add(m); + } else { + legsBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + distanceMeters_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getStaticDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + input.readMessage(getPolylineFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureWarningsIsMutable(); + warnings_.add(s); + break; + } // case 58 + case 66: + { + input.readMessage(getViewportFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 74: + { + input.readMessage(getTravelAdvisoryFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 98: + { + routeToken_ = input.readStringRequireUtf8(); + + break; + } // case 98 + case 104: + { + int tmpRaw = input.readEnum(); + ensureRouteLabelsIsMutable(); + routeLabels_.add(tmpRaw); + break; + } // case 104 + case 106: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureRouteLabelsIsMutable(); + routeLabels_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 106 + 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 routeLabels_ = java.util.Collections.emptyList(); + + private void ensureRouteLabelsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + routeLabels_ = new java.util.ArrayList(routeLabels_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return A list containing the routeLabels. + */ + public java.util.List getRouteLabelsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.routing.v2.RouteLabel>( + routeLabels_, routeLabels_converter_); + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return The count of routeLabels. + */ + public int getRouteLabelsCount() { + return routeLabels_.size(); + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index of the element to return. + * @return The routeLabels at the given index. + */ + public com.google.maps.routing.v2.RouteLabel getRouteLabels(int index) { + return routeLabels_converter_.convert(routeLabels_.get(index)); + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index to set the value at. + * @param value The routeLabels to set. + * @return This builder for chaining. + */ + public Builder setRouteLabels(int index, com.google.maps.routing.v2.RouteLabel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRouteLabelsIsMutable(); + routeLabels_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param value The routeLabels to add. + * @return This builder for chaining. + */ + public Builder addRouteLabels(com.google.maps.routing.v2.RouteLabel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRouteLabelsIsMutable(); + routeLabels_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param values The routeLabels to add. + * @return This builder for chaining. + */ + public Builder addAllRouteLabels( + java.lang.Iterable values) { + ensureRouteLabelsIsMutable(); + for (com.google.maps.routing.v2.RouteLabel value : values) { + routeLabels_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return This builder for chaining. + */ + public Builder clearRouteLabels() { + routeLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return A list containing the enum numeric values on the wire for routeLabels. + */ + public java.util.List getRouteLabelsValueList() { + return java.util.Collections.unmodifiableList(routeLabels_); + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of routeLabels at the given index. + */ + public int getRouteLabelsValue(int index) { + return routeLabels_.get(index); + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for routeLabels to set. + * @return This builder for chaining. + */ + public Builder setRouteLabelsValue(int index, int value) { + ensureRouteLabelsIsMutable(); + routeLabels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param value The enum numeric value on the wire for routeLabels to add. + * @return This builder for chaining. + */ + public Builder addRouteLabelsValue(int value) { + ensureRouteLabelsIsMutable(); + routeLabels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Labels for the `Route` that are useful to identify specific properties
+     * of the route to compare against others.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param values The enum numeric values on the wire for routeLabels to add. + * @return This builder for chaining. + */ + public Builder addAllRouteLabelsValue(java.lang.Iterable values) { + ensureRouteLabelsIsMutable(); + for (int value : values) { + routeLabels_.add(value); + } + onChanged(); + return this; + } + + private java.util.List legs_ = + java.util.Collections.emptyList(); + + private void ensureLegsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + legs_ = new java.util.ArrayList(legs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteLeg, + com.google.maps.routing.v2.RouteLeg.Builder, + com.google.maps.routing.v2.RouteLegOrBuilder> + legsBuilder_; + + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public java.util.List getLegsList() { + if (legsBuilder_ == null) { + return java.util.Collections.unmodifiableList(legs_); + } else { + return legsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public int getLegsCount() { + if (legsBuilder_ == null) { + return legs_.size(); + } else { + return legsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public com.google.maps.routing.v2.RouteLeg getLegs(int index) { + if (legsBuilder_ == null) { + return legs_.get(index); + } else { + return legsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder setLegs(int index, com.google.maps.routing.v2.RouteLeg value) { + if (legsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLegsIsMutable(); + legs_.set(index, value); + onChanged(); + } else { + legsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder setLegs(int index, com.google.maps.routing.v2.RouteLeg.Builder builderForValue) { + if (legsBuilder_ == null) { + ensureLegsIsMutable(); + legs_.set(index, builderForValue.build()); + onChanged(); + } else { + legsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder addLegs(com.google.maps.routing.v2.RouteLeg value) { + if (legsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLegsIsMutable(); + legs_.add(value); + onChanged(); + } else { + legsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder addLegs(int index, com.google.maps.routing.v2.RouteLeg value) { + if (legsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLegsIsMutable(); + legs_.add(index, value); + onChanged(); + } else { + legsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder addLegs(com.google.maps.routing.v2.RouteLeg.Builder builderForValue) { + if (legsBuilder_ == null) { + ensureLegsIsMutable(); + legs_.add(builderForValue.build()); + onChanged(); + } else { + legsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder addLegs(int index, com.google.maps.routing.v2.RouteLeg.Builder builderForValue) { + if (legsBuilder_ == null) { + ensureLegsIsMutable(); + legs_.add(index, builderForValue.build()); + onChanged(); + } else { + legsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder addAllLegs( + java.lang.Iterable values) { + if (legsBuilder_ == null) { + ensureLegsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, legs_); + onChanged(); + } else { + legsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder clearLegs() { + if (legsBuilder_ == null) { + legs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + legsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public Builder removeLegs(int index) { + if (legsBuilder_ == null) { + ensureLegsIsMutable(); + legs_.remove(index); + onChanged(); + } else { + legsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public com.google.maps.routing.v2.RouteLeg.Builder getLegsBuilder(int index) { + return getLegsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public com.google.maps.routing.v2.RouteLegOrBuilder getLegsOrBuilder(int index) { + if (legsBuilder_ == null) { + return legs_.get(index); + } else { + return legsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public java.util.List + getLegsOrBuilderList() { + if (legsBuilder_ != null) { + return legsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(legs_); + } + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public com.google.maps.routing.v2.RouteLeg.Builder addLegsBuilder() { + return getLegsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.RouteLeg.getDefaultInstance()); + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public com.google.maps.routing.v2.RouteLeg.Builder addLegsBuilder(int index) { + return getLegsFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.RouteLeg.getDefaultInstance()); + } + /** + * + * + *
+     * A collection of legs (path segments between waypoints) that make-up the
+     * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+     * For example, a route with no intermediate waypoints has only one leg. A
+     * route that includes one non-`via` intermediate waypoint has two legs. A
+     * route that includes one `via` intermediate waypoint has one leg. The order
+     * of the legs matches the order of Waypoints from `origin` to `intermediates`
+     * to `destination`.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + public java.util.List getLegsBuilderList() { + return getLegsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteLeg, + com.google.maps.routing.v2.RouteLeg.Builder, + com.google.maps.routing.v2.RouteLegOrBuilder> + getLegsFieldBuilder() { + if (legsBuilder_ == null) { + legsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteLeg, + com.google.maps.routing.v2.RouteLeg.Builder, + com.google.maps.routing.v2.RouteLegOrBuilder>( + legs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + legs_ = null; + } + return legsBuilder_; + } + + private int distanceMeters_; + /** + * + * + *
+     * The travel distance of the route, in meters.
+     * 
+ * + * int32 distance_meters = 2; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + /** + * + * + *
+     * The travel distance of the route, in meters.
+     * 
+ * + * int32 distance_meters = 2; + * + * @param value The distanceMeters to set. + * @return This builder for chaining. + */ + public Builder setDistanceMeters(int value) { + + distanceMeters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The travel distance of the route, in meters.
+     * 
+ * + * int32 distance_meters = 2; + * + * @return This builder for chaining. + */ + public Builder clearDistanceMeters() { + + distanceMeters_ = 0; + onChanged(); + return this; + } + + 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_; + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return durationBuilder_ != null || duration_ != null; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + * + * @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(); + } + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + onChanged(); + } else { + durationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + onChanged(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (duration_ != null) { + duration_ = + com.google.protobuf.Duration.newBuilder(duration_).mergeFrom(value).buildPartial(); + } else { + duration_ = value; + } + onChanged(); + } else { + durationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + public Builder clearDuration() { + if (durationBuilder_ == null) { + duration_ = null; + onChanged(); + } else { + duration_ = null; + durationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 3; + */ + 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 com.google.protobuf.Duration staticDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + staticDurationBuilder_; + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + * + * @return Whether the staticDuration field is set. + */ + public boolean hasStaticDuration() { + return staticDurationBuilder_ != null || staticDuration_ != null; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + * + * @return The staticDuration. + */ + public com.google.protobuf.Duration getStaticDuration() { + if (staticDurationBuilder_ == null) { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } else { + return staticDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + public Builder setStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + staticDuration_ = value; + onChanged(); + } else { + staticDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + public Builder setStaticDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (staticDurationBuilder_ == null) { + staticDuration_ = builderForValue.build(); + onChanged(); + } else { + staticDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + public Builder mergeStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (staticDuration_ != null) { + staticDuration_ = + com.google.protobuf.Duration.newBuilder(staticDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + staticDuration_ = value; + } + onChanged(); + } else { + staticDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + public Builder clearStaticDuration() { + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + onChanged(); + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + public com.google.protobuf.Duration.Builder getStaticDurationBuilder() { + + onChanged(); + return getStaticDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + if (staticDurationBuilder_ != null) { + return staticDurationBuilder_.getMessageOrBuilder(); + } else { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStaticDurationFieldBuilder() { + if (staticDurationBuilder_ == null) { + staticDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStaticDuration(), getParentForChildren(), isClean()); + staticDuration_ = null; + } + return staticDurationBuilder_; + } + + private com.google.maps.routing.v2.Polyline polyline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder> + polylineBuilder_; + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + * + * @return Whether the polyline field is set. + */ + public boolean hasPolyline() { + return polylineBuilder_ != null || polyline_ != null; + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + * + * @return The polyline. + */ + public com.google.maps.routing.v2.Polyline getPolyline() { + if (polylineBuilder_ == null) { + return polyline_ == null + ? com.google.maps.routing.v2.Polyline.getDefaultInstance() + : polyline_; + } else { + return polylineBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + public Builder setPolyline(com.google.maps.routing.v2.Polyline value) { + if (polylineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polyline_ = value; + onChanged(); + } else { + polylineBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + public Builder setPolyline(com.google.maps.routing.v2.Polyline.Builder builderForValue) { + if (polylineBuilder_ == null) { + polyline_ = builderForValue.build(); + onChanged(); + } else { + polylineBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + public Builder mergePolyline(com.google.maps.routing.v2.Polyline value) { + if (polylineBuilder_ == null) { + if (polyline_ != null) { + polyline_ = + com.google.maps.routing.v2.Polyline.newBuilder(polyline_) + .mergeFrom(value) + .buildPartial(); + } else { + polyline_ = value; + } + onChanged(); + } else { + polylineBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + public Builder clearPolyline() { + if (polylineBuilder_ == null) { + polyline_ = null; + onChanged(); + } else { + polyline_ = null; + polylineBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + public com.google.maps.routing.v2.Polyline.Builder getPolylineBuilder() { + + onChanged(); + return getPolylineFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + public com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder() { + if (polylineBuilder_ != null) { + return polylineBuilder_.getMessageOrBuilder(); + } else { + return polyline_ == null + ? com.google.maps.routing.v2.Polyline.getDefaultInstance() + : polyline_; + } + } + /** + * + * + *
+     * The overall route polyline. This polyline will be the combined polyline of
+     * all `legs`.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder> + getPolylineFieldBuilder() { + if (polylineBuilder_ == null) { + polylineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder>( + getPolyline(), getParentForChildren(), isClean()); + polyline_ = null; + } + return polylineBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * A description of the route.
+     * 
+ * + * string description = 6; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A description of the route.
+     * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A description of the route.
+     * 
+ * + * string description = 6; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A description of the route.
+     * 
+ * + * string description = 6; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * A description of the route.
+     * 
+ * + * string description = 6; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList warnings_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(warnings_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_.getUnmodifiableView(); + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @param index The index to set the value at. + * @param value The warnings to set. + * @return This builder for chaining. + */ + public Builder setWarnings(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @param value The warnings to add. + * @return This builder for chaining. + */ + public Builder addWarnings(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @param values The warnings to add. + * @return This builder for chaining. + */ + public Builder addAllWarnings(java.lang.Iterable values) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + return this; + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @return This builder for chaining. + */ + public Builder clearWarnings() { + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * An array of warnings to show when displaying the route.
+     * 
+ * + * repeated string warnings = 7; + * + * @param value The bytes of the warnings to add. + * @return This builder for chaining. + */ + public Builder addWarningsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + + private com.google.geo.type.Viewport viewport_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.geo.type.Viewport, + com.google.geo.type.Viewport.Builder, + com.google.geo.type.ViewportOrBuilder> + viewportBuilder_; + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + * + * @return Whether the viewport field is set. + */ + public boolean hasViewport() { + return viewportBuilder_ != null || viewport_ != null; + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + * + * @return The viewport. + */ + public com.google.geo.type.Viewport getViewport() { + if (viewportBuilder_ == null) { + return viewport_ == null ? com.google.geo.type.Viewport.getDefaultInstance() : viewport_; + } else { + return viewportBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + public Builder setViewport(com.google.geo.type.Viewport value) { + if (viewportBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + viewport_ = value; + onChanged(); + } else { + viewportBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + public Builder setViewport(com.google.geo.type.Viewport.Builder builderForValue) { + if (viewportBuilder_ == null) { + viewport_ = builderForValue.build(); + onChanged(); + } else { + viewportBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + public Builder mergeViewport(com.google.geo.type.Viewport value) { + if (viewportBuilder_ == null) { + if (viewport_ != null) { + viewport_ = + com.google.geo.type.Viewport.newBuilder(viewport_).mergeFrom(value).buildPartial(); + } else { + viewport_ = value; + } + onChanged(); + } else { + viewportBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + public Builder clearViewport() { + if (viewportBuilder_ == null) { + viewport_ = null; + onChanged(); + } else { + viewport_ = null; + viewportBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + public com.google.geo.type.Viewport.Builder getViewportBuilder() { + + onChanged(); + return getViewportFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + public com.google.geo.type.ViewportOrBuilder getViewportOrBuilder() { + if (viewportBuilder_ != null) { + return viewportBuilder_.getMessageOrBuilder(); + } else { + return viewport_ == null ? com.google.geo.type.Viewport.getDefaultInstance() : viewport_; + } + } + /** + * + * + *
+     * The viewport bounding box of the polyline.
+     * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.geo.type.Viewport, + com.google.geo.type.Viewport.Builder, + com.google.geo.type.ViewportOrBuilder> + getViewportFieldBuilder() { + if (viewportBuilder_ == null) { + viewportBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.geo.type.Viewport, + com.google.geo.type.Viewport.Builder, + com.google.geo.type.ViewportOrBuilder>( + getViewport(), getParentForChildren(), isClean()); + viewport_ = null; + } + return viewportBuilder_; + } + + private com.google.maps.routing.v2.RouteTravelAdvisory travelAdvisory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteTravelAdvisory, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder> + travelAdvisoryBuilder_; + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + * + * @return Whether the travelAdvisory field is set. + */ + public boolean hasTravelAdvisory() { + return travelAdvisoryBuilder_ != null || travelAdvisory_ != null; + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + * + * @return The travelAdvisory. + */ + public com.google.maps.routing.v2.RouteTravelAdvisory getTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } else { + return travelAdvisoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + public Builder setTravelAdvisory(com.google.maps.routing.v2.RouteTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelAdvisory_ = value; + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + public Builder setTravelAdvisory( + com.google.maps.routing.v2.RouteTravelAdvisory.Builder builderForValue) { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = builderForValue.build(); + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + public Builder mergeTravelAdvisory(com.google.maps.routing.v2.RouteTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (travelAdvisory_ != null) { + travelAdvisory_ = + com.google.maps.routing.v2.RouteTravelAdvisory.newBuilder(travelAdvisory_) + .mergeFrom(value) + .buildPartial(); + } else { + travelAdvisory_ = value; + } + onChanged(); + } else { + travelAdvisoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + public Builder clearTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + onChanged(); + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + public com.google.maps.routing.v2.RouteTravelAdvisory.Builder getTravelAdvisoryBuilder() { + + onChanged(); + return getTravelAdvisoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + public com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() { + if (travelAdvisoryBuilder_ != null) { + return travelAdvisoryBuilder_.getMessageOrBuilder(); + } else { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + } + /** + * + * + *
+     * Additional information about the route.
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteTravelAdvisory, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder> + getTravelAdvisoryFieldBuilder() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteTravelAdvisory, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder>( + getTravelAdvisory(), getParentForChildren(), isClean()); + travelAdvisory_ = null; + } + return travelAdvisoryBuilder_; + } + + private java.lang.Object routeToken_ = ""; + /** + * + * + *
+     * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+     * which allows the Navigation SDK to reconstruct the route during navigation,
+     * and in the event of rerouting honor the original intention when Routes
+     * ComputeRoutes is called. Customers should treat this token as an
+     * opaque blob.
+     * 
+ * + * string route_token = 12; + * + * @return The routeToken. + */ + public java.lang.String getRouteToken() { + java.lang.Object ref = routeToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + routeToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+     * which allows the Navigation SDK to reconstruct the route during navigation,
+     * and in the event of rerouting honor the original intention when Routes
+     * ComputeRoutes is called. Customers should treat this token as an
+     * opaque blob.
+     * 
+ * + * string route_token = 12; + * + * @return The bytes for routeToken. + */ + public com.google.protobuf.ByteString getRouteTokenBytes() { + java.lang.Object ref = routeToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + routeToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+     * which allows the Navigation SDK to reconstruct the route during navigation,
+     * and in the event of rerouting honor the original intention when Routes
+     * ComputeRoutes is called. Customers should treat this token as an
+     * opaque blob.
+     * 
+ * + * string route_token = 12; + * + * @param value The routeToken to set. + * @return This builder for chaining. + */ + public Builder setRouteToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + routeToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+     * which allows the Navigation SDK to reconstruct the route during navigation,
+     * and in the event of rerouting honor the original intention when Routes
+     * ComputeRoutes is called. Customers should treat this token as an
+     * opaque blob.
+     * 
+ * + * string route_token = 12; + * + * @return This builder for chaining. + */ + public Builder clearRouteToken() { + + routeToken_ = getDefaultInstance().getRouteToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+     * which allows the Navigation SDK to reconstruct the route during navigation,
+     * and in the event of rerouting honor the original intention when Routes
+     * ComputeRoutes is called. Customers should treat this token as an
+     * opaque blob.
+     * 
+ * + * string route_token = 12; + * + * @param value The bytes for routeToken to set. + * @return This builder for chaining. + */ + public Builder setRouteTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + routeToken_ = value; + 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.routing.v2.Route) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.Route) + private static final com.google.maps.routing.v2.Route DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.Route(); + } + + public static com.google.maps.routing.v2.Route getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Route 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.routing.v2.Route getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLabel.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLabel.java new file mode 100644 index 000000000000..a6df87ab0bbc --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLabel.java @@ -0,0 +1,205 @@ +/* + * Copyright 2020 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/routing/v2/route_label.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Labels for the `Route` that are useful to identify specific properties
+ * of the route to compare against others.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.RouteLabel} + */ +public enum RouteLabel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default - not used.
+   * 
+ * + * ROUTE_LABEL_UNSPECIFIED = 0; + */ + ROUTE_LABEL_UNSPECIFIED(0), + /** + * + * + *
+   * The default "best" route returned for the route computation.
+   * 
+ * + * DEFAULT_ROUTE = 1; + */ + DEFAULT_ROUTE(1), + /** + * + * + *
+   * An alternative to the default "best" route. Routes like this will be
+   * returned when `ComputeRoutesRequest.compute_alternative_routes` is
+   * specified.
+   * 
+ * + * DEFAULT_ROUTE_ALTERNATE = 2; + */ + DEFAULT_ROUTE_ALTERNATE(2), + /** + * + * + *
+   * Fuel efficient route. Routes labeled with this value are determined to be
+   * optimized for Eco parameters such as fuel consumption.
+   * 
+ * + * FUEL_EFFICIENT = 3; + */ + FUEL_EFFICIENT(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Default - not used.
+   * 
+ * + * ROUTE_LABEL_UNSPECIFIED = 0; + */ + public static final int ROUTE_LABEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The default "best" route returned for the route computation.
+   * 
+ * + * DEFAULT_ROUTE = 1; + */ + public static final int DEFAULT_ROUTE_VALUE = 1; + /** + * + * + *
+   * An alternative to the default "best" route. Routes like this will be
+   * returned when `ComputeRoutesRequest.compute_alternative_routes` is
+   * specified.
+   * 
+ * + * DEFAULT_ROUTE_ALTERNATE = 2; + */ + public static final int DEFAULT_ROUTE_ALTERNATE_VALUE = 2; + /** + * + * + *
+   * Fuel efficient route. Routes labeled with this value are determined to be
+   * optimized for Eco parameters such as fuel consumption.
+   * 
+ * + * FUEL_EFFICIENT = 3; + */ + public static final int FUEL_EFFICIENT_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 RouteLabel 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 RouteLabel forNumber(int value) { + switch (value) { + case 0: + return ROUTE_LABEL_UNSPECIFIED; + case 1: + return DEFAULT_ROUTE; + case 2: + return DEFAULT_ROUTE_ALTERNATE; + case 3: + return FUEL_EFFICIENT; + 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 RouteLabel findValueByNumber(int number) { + return RouteLabel.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.routing.v2.RouteLabelProto.getDescriptor().getEnumTypes().get(0); + } + + private static final RouteLabel[] VALUES = values(); + + public static RouteLabel 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 RouteLabel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.RouteLabel) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLabelProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLabelProto.java new file mode 100644 index 000000000000..d2d2b74e93af --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLabelProto.java @@ -0,0 +1,55 @@ +/* + * Copyright 2020 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/routing/v2/route_label.proto + +package com.google.maps.routing.v2; + +public final class RouteLabelProto { + private RouteLabelProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/maps/routing/v2/route_label.pro" + + "to\022\026google.maps.routing.v2*m\n\nRouteLabel" + + "\022\033\n\027ROUTE_LABEL_UNSPECIFIED\020\000\022\021\n\rDEFAULT" + + "_ROUTE\020\001\022\033\n\027DEFAULT_ROUTE_ALTERNATE\020\002\022\022\n" + + "\016FUEL_EFFICIENT\020\003B\307\001\n\032com.google.maps.ro" + + "uting.v2B\017RouteLabelProtoP\001Z=google.gola" + + "ng.org/genproto/googleapis/maps/routing/" + + "v2;routing\370\001\001\242\002\005GMRV2\252\002\026Google.Maps.Rout" + + "ing.V2\312\002\026Google\\Maps\\Routing\\V2\352\002\031Google" + + "::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLeg.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLeg.java new file mode 100644 index 000000000000..ca791c89a53f --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLeg.java @@ -0,0 +1,2760 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates a segment between non-`via` waypoints.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLeg} + */ +public final class RouteLeg extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteLeg) + RouteLegOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteLeg.newBuilder() to construct. + private RouteLeg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteLeg() { + steps_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteLeg(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLeg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLeg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLeg.class, + com.google.maps.routing.v2.RouteLeg.Builder.class); + } + + public static final int DISTANCE_METERS_FIELD_NUMBER = 1; + private int distanceMeters_; + /** + * + * + *
+   * The travel distance of the route leg, in meters.
+   * 
+ * + * int32 distance_meters = 1; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + + public static final int DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+   * The length of time needed to navigate the leg. If the `route_preference`
+   * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+   * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+   * conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+   * The length of time needed to navigate the leg. If the `route_preference`
+   * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+   * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+   * conditions into account.
+   * 
+ * + * .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_; + } + /** + * + * + *
+   * The length of time needed to navigate the leg. If the `route_preference`
+   * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+   * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+   * conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return getDuration(); + } + + public static final int STATIC_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration staticDuration_; + /** + * + * + *
+   * The duration of traveling through the leg, calculated without taking
+   * traffic conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 3; + * + * @return Whether the staticDuration field is set. + */ + @java.lang.Override + public boolean hasStaticDuration() { + return staticDuration_ != null; + } + /** + * + * + *
+   * The duration of traveling through the leg, calculated without taking
+   * traffic conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 3; + * + * @return The staticDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getStaticDuration() { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + /** + * + * + *
+   * The duration of traveling through the leg, calculated without taking
+   * traffic conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + return getStaticDuration(); + } + + public static final int POLYLINE_FIELD_NUMBER = 4; + private com.google.maps.routing.v2.Polyline polyline_; + /** + * + * + *
+   * The overall polyline for this leg. This includes that each `step`'s
+   * polyline.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + * + * @return Whether the polyline field is set. + */ + @java.lang.Override + public boolean hasPolyline() { + return polyline_ != null; + } + /** + * + * + *
+   * The overall polyline for this leg. This includes that each `step`'s
+   * polyline.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + * + * @return The polyline. + */ + @java.lang.Override + public com.google.maps.routing.v2.Polyline getPolyline() { + return polyline_ == null ? com.google.maps.routing.v2.Polyline.getDefaultInstance() : polyline_; + } + /** + * + * + *
+   * The overall polyline for this leg. This includes that each `step`'s
+   * polyline.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder() { + return getPolyline(); + } + + public static final int START_LOCATION_FIELD_NUMBER = 5; + private com.google.maps.routing.v2.Location startLocation_; + /** + * + * + *
+   * The start location of this leg. This might be different from the provided
+   * `origin`. For example, when the provided `origin` is not near a road, this
+   * is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + * + * @return Whether the startLocation field is set. + */ + @java.lang.Override + public boolean hasStartLocation() { + return startLocation_ != null; + } + /** + * + * + *
+   * The start location of this leg. This might be different from the provided
+   * `origin`. For example, when the provided `origin` is not near a road, this
+   * is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + * + * @return The startLocation. + */ + @java.lang.Override + public com.google.maps.routing.v2.Location getStartLocation() { + return startLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : startLocation_; + } + /** + * + * + *
+   * The start location of this leg. This might be different from the provided
+   * `origin`. For example, when the provided `origin` is not near a road, this
+   * is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + @java.lang.Override + public com.google.maps.routing.v2.LocationOrBuilder getStartLocationOrBuilder() { + return getStartLocation(); + } + + public static final int END_LOCATION_FIELD_NUMBER = 6; + private com.google.maps.routing.v2.Location endLocation_; + /** + * + * + *
+   * The end location of this leg. This might be different from the provided
+   * `destination`. For example, when the provided `destination` is not near a
+   * road, this is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + * + * @return Whether the endLocation field is set. + */ + @java.lang.Override + public boolean hasEndLocation() { + return endLocation_ != null; + } + /** + * + * + *
+   * The end location of this leg. This might be different from the provided
+   * `destination`. For example, when the provided `destination` is not near a
+   * road, this is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + * + * @return The endLocation. + */ + @java.lang.Override + public com.google.maps.routing.v2.Location getEndLocation() { + return endLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : endLocation_; + } + /** + * + * + *
+   * The end location of this leg. This might be different from the provided
+   * `destination`. For example, when the provided `destination` is not near a
+   * road, this is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + @java.lang.Override + public com.google.maps.routing.v2.LocationOrBuilder getEndLocationOrBuilder() { + return getEndLocation(); + } + + public static final int STEPS_FIELD_NUMBER = 7; + private java.util.List steps_; + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + @java.lang.Override + public java.util.List getStepsList() { + return steps_; + } + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + @java.lang.Override + public java.util.List + getStepsOrBuilderList() { + return steps_; + } + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + @java.lang.Override + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStep getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStepOrBuilder getStepsOrBuilder(int index) { + return steps_.get(index); + } + + public static final int TRAVEL_ADVISORY_FIELD_NUMBER = 8; + private com.google.maps.routing.v2.RouteLegTravelAdvisory travelAdvisory_; + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + * + * @return Whether the travelAdvisory field is set. + */ + @java.lang.Override + public boolean hasTravelAdvisory() { + return travelAdvisory_ != null; + } + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + * + * @return The travelAdvisory. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegTravelAdvisory getTravelAdvisory() { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteLegTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() { + return getTravelAdvisory(); + } + + 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 (distanceMeters_ != 0) { + output.writeInt32(1, distanceMeters_); + } + if (duration_ != null) { + output.writeMessage(2, getDuration()); + } + if (staticDuration_ != null) { + output.writeMessage(3, getStaticDuration()); + } + if (polyline_ != null) { + output.writeMessage(4, getPolyline()); + } + if (startLocation_ != null) { + output.writeMessage(5, getStartLocation()); + } + if (endLocation_ != null) { + output.writeMessage(6, getEndLocation()); + } + for (int i = 0; i < steps_.size(); i++) { + output.writeMessage(7, steps_.get(i)); + } + if (travelAdvisory_ != null) { + output.writeMessage(8, getTravelAdvisory()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (distanceMeters_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, distanceMeters_); + } + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + } + if (staticDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStaticDuration()); + } + if (polyline_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPolyline()); + } + if (startLocation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStartLocation()); + } + if (endLocation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndLocation()); + } + for (int i = 0; i < steps_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, steps_.get(i)); + } + if (travelAdvisory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getTravelAdvisory()); + } + 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.routing.v2.RouteLeg)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteLeg other = (com.google.maps.routing.v2.RouteLeg) obj; + + if (getDistanceMeters() != other.getDistanceMeters()) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (hasStaticDuration() != other.hasStaticDuration()) return false; + if (hasStaticDuration()) { + if (!getStaticDuration().equals(other.getStaticDuration())) return false; + } + if (hasPolyline() != other.hasPolyline()) return false; + if (hasPolyline()) { + if (!getPolyline().equals(other.getPolyline())) return false; + } + if (hasStartLocation() != other.hasStartLocation()) return false; + if (hasStartLocation()) { + if (!getStartLocation().equals(other.getStartLocation())) return false; + } + if (hasEndLocation() != other.hasEndLocation()) return false; + if (hasEndLocation()) { + if (!getEndLocation().equals(other.getEndLocation())) return false; + } + if (!getStepsList().equals(other.getStepsList())) return false; + if (hasTravelAdvisory() != other.hasTravelAdvisory()) return false; + if (hasTravelAdvisory()) { + if (!getTravelAdvisory().equals(other.getTravelAdvisory())) 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) + DISTANCE_METERS_FIELD_NUMBER; + hash = (53 * hash) + getDistanceMeters(); + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + if (hasStaticDuration()) { + hash = (37 * hash) + STATIC_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getStaticDuration().hashCode(); + } + if (hasPolyline()) { + hash = (37 * hash) + POLYLINE_FIELD_NUMBER; + hash = (53 * hash) + getPolyline().hashCode(); + } + if (hasStartLocation()) { + hash = (37 * hash) + START_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getStartLocation().hashCode(); + } + if (hasEndLocation()) { + hash = (37 * hash) + END_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndLocation().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (hasTravelAdvisory()) { + hash = (37 * hash) + TRAVEL_ADVISORY_FIELD_NUMBER; + hash = (53 * hash) + getTravelAdvisory().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteLeg parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLeg 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.routing.v2.RouteLeg parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLeg 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.routing.v2.RouteLeg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLeg parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteLeg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLeg 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.routing.v2.RouteLeg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLeg 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.routing.v2.RouteLeg parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLeg 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.routing.v2.RouteLeg 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 segment between non-`via` waypoints.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLeg} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteLeg) + com.google.maps.routing.v2.RouteLegOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLeg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLeg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLeg.class, + com.google.maps.routing.v2.RouteLeg.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteLeg.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + distanceMeters_ = 0; + + if (durationBuilder_ == null) { + duration_ = null; + } else { + duration_ = null; + durationBuilder_ = null; + } + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + if (polylineBuilder_ == null) { + polyline_ = null; + } else { + polyline_ = null; + polylineBuilder_ = null; + } + if (startLocationBuilder_ == null) { + startLocation_ = null; + } else { + startLocation_ = null; + startLocationBuilder_ = null; + } + if (endLocationBuilder_ == null) { + endLocation_ = null; + } else { + endLocation_ = null; + endLocationBuilder_ = null; + } + if (stepsBuilder_ == null) { + steps_ = java.util.Collections.emptyList(); + } else { + steps_ = null; + stepsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLeg_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLeg getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteLeg.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLeg build() { + com.google.maps.routing.v2.RouteLeg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLeg buildPartial() { + com.google.maps.routing.v2.RouteLeg result = new com.google.maps.routing.v2.RouteLeg(this); + int from_bitField0_ = bitField0_; + result.distanceMeters_ = distanceMeters_; + if (durationBuilder_ == null) { + result.duration_ = duration_; + } else { + result.duration_ = durationBuilder_.build(); + } + if (staticDurationBuilder_ == null) { + result.staticDuration_ = staticDuration_; + } else { + result.staticDuration_ = staticDurationBuilder_.build(); + } + if (polylineBuilder_ == null) { + result.polyline_ = polyline_; + } else { + result.polyline_ = polylineBuilder_.build(); + } + if (startLocationBuilder_ == null) { + result.startLocation_ = startLocation_; + } else { + result.startLocation_ = startLocationBuilder_.build(); + } + if (endLocationBuilder_ == null) { + result.endLocation_ = endLocation_; + } else { + result.endLocation_ = endLocationBuilder_.build(); + } + if (stepsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + steps_ = java.util.Collections.unmodifiableList(steps_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.steps_ = steps_; + } else { + result.steps_ = stepsBuilder_.build(); + } + if (travelAdvisoryBuilder_ == null) { + result.travelAdvisory_ = travelAdvisory_; + } else { + result.travelAdvisory_ = travelAdvisoryBuilder_.build(); + } + 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.routing.v2.RouteLeg) { + return mergeFrom((com.google.maps.routing.v2.RouteLeg) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteLeg other) { + if (other == com.google.maps.routing.v2.RouteLeg.getDefaultInstance()) return this; + if (other.getDistanceMeters() != 0) { + setDistanceMeters(other.getDistanceMeters()); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasStaticDuration()) { + mergeStaticDuration(other.getStaticDuration()); + } + if (other.hasPolyline()) { + mergePolyline(other.getPolyline()); + } + if (other.hasStartLocation()) { + mergeStartLocation(other.getStartLocation()); + } + if (other.hasEndLocation()) { + mergeEndLocation(other.getEndLocation()); + } + if (stepsBuilder_ == null) { + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + } else { + if (!other.steps_.isEmpty()) { + if (stepsBuilder_.isEmpty()) { + stepsBuilder_.dispose(); + stepsBuilder_ = null; + steps_ = other.steps_; + bitField0_ = (bitField0_ & ~0x00000001); + stepsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStepsFieldBuilder() + : null; + } else { + stepsBuilder_.addAllMessages(other.steps_); + } + } + } + if (other.hasTravelAdvisory()) { + mergeTravelAdvisory(other.getTravelAdvisory()); + } + 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: + { + distanceMeters_ = input.readInt32(); + + break; + } // case 8 + case 18: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getStaticDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getPolylineFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + input.readMessage(getStartLocationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getEndLocationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + com.google.maps.routing.v2.RouteLegStep m = + input.readMessage( + com.google.maps.routing.v2.RouteLegStep.parser(), extensionRegistry); + if (stepsBuilder_ == null) { + ensureStepsIsMutable(); + steps_.add(m); + } else { + stepsBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + input.readMessage(getTravelAdvisoryFieldBuilder().getBuilder(), extensionRegistry); + + 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 int distanceMeters_; + /** + * + * + *
+     * The travel distance of the route leg, in meters.
+     * 
+ * + * int32 distance_meters = 1; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + /** + * + * + *
+     * The travel distance of the route leg, in meters.
+     * 
+ * + * int32 distance_meters = 1; + * + * @param value The distanceMeters to set. + * @return This builder for chaining. + */ + public Builder setDistanceMeters(int value) { + + distanceMeters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The travel distance of the route leg, in meters.
+     * 
+ * + * int32 distance_meters = 1; + * + * @return This builder for chaining. + */ + public Builder clearDistanceMeters() { + + distanceMeters_ = 0; + onChanged(); + return this; + } + + 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_; + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return durationBuilder_ != null || duration_ != null; + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .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(); + } + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + onChanged(); + } else { + durationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + onChanged(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (duration_ != null) { + duration_ = + com.google.protobuf.Duration.newBuilder(duration_).mergeFrom(value).buildPartial(); + } else { + duration_ = value; + } + onChanged(); + } else { + durationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder clearDuration() { + if (durationBuilder_ == null) { + duration_ = null; + onChanged(); + } else { + duration_ = null; + durationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .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_; + } + } + /** + * + * + *
+     * The length of time needed to navigate the leg. If the `route_preference`
+     * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+     * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+     * conditions into account.
+     * 
+ * + * .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_; + } + + private com.google.protobuf.Duration staticDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + staticDurationBuilder_; + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + * + * @return Whether the staticDuration field is set. + */ + public boolean hasStaticDuration() { + return staticDurationBuilder_ != null || staticDuration_ != null; + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + * + * @return The staticDuration. + */ + public com.google.protobuf.Duration getStaticDuration() { + if (staticDurationBuilder_ == null) { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } else { + return staticDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + public Builder setStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + staticDuration_ = value; + onChanged(); + } else { + staticDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + public Builder setStaticDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (staticDurationBuilder_ == null) { + staticDuration_ = builderForValue.build(); + onChanged(); + } else { + staticDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + public Builder mergeStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (staticDuration_ != null) { + staticDuration_ = + com.google.protobuf.Duration.newBuilder(staticDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + staticDuration_ = value; + } + onChanged(); + } else { + staticDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + public Builder clearStaticDuration() { + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + onChanged(); + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + public com.google.protobuf.Duration.Builder getStaticDurationBuilder() { + + onChanged(); + return getStaticDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + if (staticDurationBuilder_ != null) { + return staticDurationBuilder_.getMessageOrBuilder(); + } else { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + } + /** + * + * + *
+     * The duration of traveling through the leg, calculated without taking
+     * traffic conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStaticDurationFieldBuilder() { + if (staticDurationBuilder_ == null) { + staticDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStaticDuration(), getParentForChildren(), isClean()); + staticDuration_ = null; + } + return staticDurationBuilder_; + } + + private com.google.maps.routing.v2.Polyline polyline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder> + polylineBuilder_; + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + * + * @return Whether the polyline field is set. + */ + public boolean hasPolyline() { + return polylineBuilder_ != null || polyline_ != null; + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + * + * @return The polyline. + */ + public com.google.maps.routing.v2.Polyline getPolyline() { + if (polylineBuilder_ == null) { + return polyline_ == null + ? com.google.maps.routing.v2.Polyline.getDefaultInstance() + : polyline_; + } else { + return polylineBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + public Builder setPolyline(com.google.maps.routing.v2.Polyline value) { + if (polylineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polyline_ = value; + onChanged(); + } else { + polylineBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + public Builder setPolyline(com.google.maps.routing.v2.Polyline.Builder builderForValue) { + if (polylineBuilder_ == null) { + polyline_ = builderForValue.build(); + onChanged(); + } else { + polylineBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + public Builder mergePolyline(com.google.maps.routing.v2.Polyline value) { + if (polylineBuilder_ == null) { + if (polyline_ != null) { + polyline_ = + com.google.maps.routing.v2.Polyline.newBuilder(polyline_) + .mergeFrom(value) + .buildPartial(); + } else { + polyline_ = value; + } + onChanged(); + } else { + polylineBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + public Builder clearPolyline() { + if (polylineBuilder_ == null) { + polyline_ = null; + onChanged(); + } else { + polyline_ = null; + polylineBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + public com.google.maps.routing.v2.Polyline.Builder getPolylineBuilder() { + + onChanged(); + return getPolylineFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + public com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder() { + if (polylineBuilder_ != null) { + return polylineBuilder_.getMessageOrBuilder(); + } else { + return polyline_ == null + ? com.google.maps.routing.v2.Polyline.getDefaultInstance() + : polyline_; + } + } + /** + * + * + *
+     * The overall polyline for this leg. This includes that each `step`'s
+     * polyline.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder> + getPolylineFieldBuilder() { + if (polylineBuilder_ == null) { + polylineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder>( + getPolyline(), getParentForChildren(), isClean()); + polyline_ = null; + } + return polylineBuilder_; + } + + private com.google.maps.routing.v2.Location startLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + startLocationBuilder_; + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + * + * @return Whether the startLocation field is set. + */ + public boolean hasStartLocation() { + return startLocationBuilder_ != null || startLocation_ != null; + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + * + * @return The startLocation. + */ + public com.google.maps.routing.v2.Location getStartLocation() { + if (startLocationBuilder_ == null) { + return startLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : startLocation_; + } else { + return startLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + public Builder setStartLocation(com.google.maps.routing.v2.Location value) { + if (startLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startLocation_ = value; + onChanged(); + } else { + startLocationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + public Builder setStartLocation(com.google.maps.routing.v2.Location.Builder builderForValue) { + if (startLocationBuilder_ == null) { + startLocation_ = builderForValue.build(); + onChanged(); + } else { + startLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + public Builder mergeStartLocation(com.google.maps.routing.v2.Location value) { + if (startLocationBuilder_ == null) { + if (startLocation_ != null) { + startLocation_ = + com.google.maps.routing.v2.Location.newBuilder(startLocation_) + .mergeFrom(value) + .buildPartial(); + } else { + startLocation_ = value; + } + onChanged(); + } else { + startLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + public Builder clearStartLocation() { + if (startLocationBuilder_ == null) { + startLocation_ = null; + onChanged(); + } else { + startLocation_ = null; + startLocationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + public com.google.maps.routing.v2.Location.Builder getStartLocationBuilder() { + + onChanged(); + return getStartLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + public com.google.maps.routing.v2.LocationOrBuilder getStartLocationOrBuilder() { + if (startLocationBuilder_ != null) { + return startLocationBuilder_.getMessageOrBuilder(); + } else { + return startLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : startLocation_; + } + } + /** + * + * + *
+     * The start location of this leg. This might be different from the provided
+     * `origin`. For example, when the provided `origin` is not near a road, this
+     * is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + getStartLocationFieldBuilder() { + if (startLocationBuilder_ == null) { + startLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder>( + getStartLocation(), getParentForChildren(), isClean()); + startLocation_ = null; + } + return startLocationBuilder_; + } + + private com.google.maps.routing.v2.Location endLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + endLocationBuilder_; + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + * + * @return Whether the endLocation field is set. + */ + public boolean hasEndLocation() { + return endLocationBuilder_ != null || endLocation_ != null; + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + * + * @return The endLocation. + */ + public com.google.maps.routing.v2.Location getEndLocation() { + if (endLocationBuilder_ == null) { + return endLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : endLocation_; + } else { + return endLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + public Builder setEndLocation(com.google.maps.routing.v2.Location value) { + if (endLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endLocation_ = value; + onChanged(); + } else { + endLocationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + public Builder setEndLocation(com.google.maps.routing.v2.Location.Builder builderForValue) { + if (endLocationBuilder_ == null) { + endLocation_ = builderForValue.build(); + onChanged(); + } else { + endLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + public Builder mergeEndLocation(com.google.maps.routing.v2.Location value) { + if (endLocationBuilder_ == null) { + if (endLocation_ != null) { + endLocation_ = + com.google.maps.routing.v2.Location.newBuilder(endLocation_) + .mergeFrom(value) + .buildPartial(); + } else { + endLocation_ = value; + } + onChanged(); + } else { + endLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + public Builder clearEndLocation() { + if (endLocationBuilder_ == null) { + endLocation_ = null; + onChanged(); + } else { + endLocation_ = null; + endLocationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + public com.google.maps.routing.v2.Location.Builder getEndLocationBuilder() { + + onChanged(); + return getEndLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + public com.google.maps.routing.v2.LocationOrBuilder getEndLocationOrBuilder() { + if (endLocationBuilder_ != null) { + return endLocationBuilder_.getMessageOrBuilder(); + } else { + return endLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : endLocation_; + } + } + /** + * + * + *
+     * The end location of this leg. This might be different from the provided
+     * `destination`. For example, when the provided `destination` is not near a
+     * road, this is a point on the road.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + getEndLocationFieldBuilder() { + if (endLocationBuilder_ == null) { + endLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder>( + getEndLocation(), getParentForChildren(), isClean()); + endLocation_ = null; + } + return endLocationBuilder_; + } + + private java.util.List steps_ = + java.util.Collections.emptyList(); + + private void ensureStepsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + steps_ = new java.util.ArrayList(steps_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteLegStep, + com.google.maps.routing.v2.RouteLegStep.Builder, + com.google.maps.routing.v2.RouteLegStepOrBuilder> + stepsBuilder_; + + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public java.util.List getStepsList() { + if (stepsBuilder_ == null) { + return java.util.Collections.unmodifiableList(steps_); + } else { + return stepsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public int getStepsCount() { + if (stepsBuilder_ == null) { + return steps_.size(); + } else { + return stepsBuilder_.getCount(); + } + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public com.google.maps.routing.v2.RouteLegStep getSteps(int index) { + if (stepsBuilder_ == null) { + return steps_.get(index); + } else { + return stepsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder setSteps(int index, com.google.maps.routing.v2.RouteLegStep value) { + if (stepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + onChanged(); + } else { + stepsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder setSteps( + int index, com.google.maps.routing.v2.RouteLegStep.Builder builderForValue) { + if (stepsBuilder_ == null) { + ensureStepsIsMutable(); + steps_.set(index, builderForValue.build()); + onChanged(); + } else { + stepsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder addSteps(com.google.maps.routing.v2.RouteLegStep value) { + if (stepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + onChanged(); + } else { + stepsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder addSteps(int index, com.google.maps.routing.v2.RouteLegStep value) { + if (stepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(index, value); + onChanged(); + } else { + stepsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder addSteps(com.google.maps.routing.v2.RouteLegStep.Builder builderForValue) { + if (stepsBuilder_ == null) { + ensureStepsIsMutable(); + steps_.add(builderForValue.build()); + onChanged(); + } else { + stepsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder addSteps( + int index, com.google.maps.routing.v2.RouteLegStep.Builder builderForValue) { + if (stepsBuilder_ == null) { + ensureStepsIsMutable(); + steps_.add(index, builderForValue.build()); + onChanged(); + } else { + stepsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder addAllSteps( + java.lang.Iterable values) { + if (stepsBuilder_ == null) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + onChanged(); + } else { + stepsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder clearSteps() { + if (stepsBuilder_ == null) { + steps_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stepsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public Builder removeSteps(int index) { + if (stepsBuilder_ == null) { + ensureStepsIsMutable(); + steps_.remove(index); + onChanged(); + } else { + stepsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public com.google.maps.routing.v2.RouteLegStep.Builder getStepsBuilder(int index) { + return getStepsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public com.google.maps.routing.v2.RouteLegStepOrBuilder getStepsOrBuilder(int index) { + if (stepsBuilder_ == null) { + return steps_.get(index); + } else { + return stepsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public java.util.List + getStepsOrBuilderList() { + if (stepsBuilder_ != null) { + return stepsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(steps_); + } + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public com.google.maps.routing.v2.RouteLegStep.Builder addStepsBuilder() { + return getStepsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.RouteLegStep.getDefaultInstance()); + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public com.google.maps.routing.v2.RouteLegStep.Builder addStepsBuilder(int index) { + return getStepsFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.RouteLegStep.getDefaultInstance()); + } + /** + * + * + *
+     * An array of steps denoting segments within this leg. Each step represents
+     * one navigation instruction.
+     * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + public java.util.List getStepsBuilderList() { + return getStepsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteLegStep, + com.google.maps.routing.v2.RouteLegStep.Builder, + com.google.maps.routing.v2.RouteLegStepOrBuilder> + getStepsFieldBuilder() { + if (stepsBuilder_ == null) { + stepsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.RouteLegStep, + com.google.maps.routing.v2.RouteLegStep.Builder, + com.google.maps.routing.v2.RouteLegStepOrBuilder>( + steps_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + steps_ = null; + } + return stepsBuilder_; + } + + private com.google.maps.routing.v2.RouteLegTravelAdvisory travelAdvisory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteLegTravelAdvisory, + com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder> + travelAdvisoryBuilder_; + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + * + * @return Whether the travelAdvisory field is set. + */ + public boolean hasTravelAdvisory() { + return travelAdvisoryBuilder_ != null || travelAdvisory_ != null; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + * + * @return The travelAdvisory. + */ + public com.google.maps.routing.v2.RouteLegTravelAdvisory getTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteLegTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } else { + return travelAdvisoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + public Builder setTravelAdvisory(com.google.maps.routing.v2.RouteLegTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelAdvisory_ = value; + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + public Builder setTravelAdvisory( + com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder builderForValue) { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = builderForValue.build(); + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + public Builder mergeTravelAdvisory(com.google.maps.routing.v2.RouteLegTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (travelAdvisory_ != null) { + travelAdvisory_ = + com.google.maps.routing.v2.RouteLegTravelAdvisory.newBuilder(travelAdvisory_) + .mergeFrom(value) + .buildPartial(); + } else { + travelAdvisory_ = value; + } + onChanged(); + } else { + travelAdvisoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + public Builder clearTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + onChanged(); + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + public com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder getTravelAdvisoryBuilder() { + + onChanged(); + return getTravelAdvisoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + public com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() { + if (travelAdvisoryBuilder_ != null) { + return travelAdvisoryBuilder_.getMessageOrBuilder(); + } else { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteLegTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction etc. on a route leg.
+     * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteLegTravelAdvisory, + com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder> + getTravelAdvisoryFieldBuilder() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteLegTravelAdvisory, + com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder>( + getTravelAdvisory(), getParentForChildren(), isClean()); + travelAdvisory_ = null; + } + return travelAdvisoryBuilder_; + } + + @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.routing.v2.RouteLeg) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteLeg) + private static final com.google.maps.routing.v2.RouteLeg DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteLeg(); + } + + public static com.google.maps.routing.v2.RouteLeg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteLeg 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.routing.v2.RouteLeg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegOrBuilder.java new file mode 100644 index 000000000000..c08e71a46f81 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegOrBuilder.java @@ -0,0 +1,338 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public interface RouteLegOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteLeg) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The travel distance of the route leg, in meters.
+   * 
+ * + * int32 distance_meters = 1; + * + * @return The distanceMeters. + */ + int getDistanceMeters(); + + /** + * + * + *
+   * The length of time needed to navigate the leg. If the `route_preference`
+   * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+   * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+   * conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+   * The length of time needed to navigate the leg. If the `route_preference`
+   * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+   * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+   * conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+   * The length of time needed to navigate the leg. If the `route_preference`
+   * is set to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
+   * `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
+   * conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 2; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + + /** + * + * + *
+   * The duration of traveling through the leg, calculated without taking
+   * traffic conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 3; + * + * @return Whether the staticDuration field is set. + */ + boolean hasStaticDuration(); + /** + * + * + *
+   * The duration of traveling through the leg, calculated without taking
+   * traffic conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 3; + * + * @return The staticDuration. + */ + com.google.protobuf.Duration getStaticDuration(); + /** + * + * + *
+   * The duration of traveling through the leg, calculated without taking
+   * traffic conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder(); + + /** + * + * + *
+   * The overall polyline for this leg. This includes that each `step`'s
+   * polyline.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + * + * @return Whether the polyline field is set. + */ + boolean hasPolyline(); + /** + * + * + *
+   * The overall polyline for this leg. This includes that each `step`'s
+   * polyline.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + * + * @return The polyline. + */ + com.google.maps.routing.v2.Polyline getPolyline(); + /** + * + * + *
+   * The overall polyline for this leg. This includes that each `step`'s
+   * polyline.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 4; + */ + com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder(); + + /** + * + * + *
+   * The start location of this leg. This might be different from the provided
+   * `origin`. For example, when the provided `origin` is not near a road, this
+   * is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + * + * @return Whether the startLocation field is set. + */ + boolean hasStartLocation(); + /** + * + * + *
+   * The start location of this leg. This might be different from the provided
+   * `origin`. For example, when the provided `origin` is not near a road, this
+   * is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + * + * @return The startLocation. + */ + com.google.maps.routing.v2.Location getStartLocation(); + /** + * + * + *
+   * The start location of this leg. This might be different from the provided
+   * `origin`. For example, when the provided `origin` is not near a road, this
+   * is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 5; + */ + com.google.maps.routing.v2.LocationOrBuilder getStartLocationOrBuilder(); + + /** + * + * + *
+   * The end location of this leg. This might be different from the provided
+   * `destination`. For example, when the provided `destination` is not near a
+   * road, this is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + * + * @return Whether the endLocation field is set. + */ + boolean hasEndLocation(); + /** + * + * + *
+   * The end location of this leg. This might be different from the provided
+   * `destination`. For example, when the provided `destination` is not near a
+   * road, this is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + * + * @return The endLocation. + */ + com.google.maps.routing.v2.Location getEndLocation(); + /** + * + * + *
+   * The end location of this leg. This might be different from the provided
+   * `destination`. For example, when the provided `destination` is not near a
+   * road, this is a point on the road.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 6; + */ + com.google.maps.routing.v2.LocationOrBuilder getEndLocationOrBuilder(); + + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + java.util.List getStepsList(); + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + com.google.maps.routing.v2.RouteLegStep getSteps(int index); + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + int getStepsCount(); + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + java.util.List + getStepsOrBuilderList(); + /** + * + * + *
+   * An array of steps denoting segments within this leg. Each step represents
+   * one navigation instruction.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLegStep steps = 7; + */ + com.google.maps.routing.v2.RouteLegStepOrBuilder getStepsOrBuilder(int index); + + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + * + * @return Whether the travelAdvisory field is set. + */ + boolean hasTravelAdvisory(); + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + * + * @return The travelAdvisory. + */ + com.google.maps.routing.v2.RouteLegTravelAdvisory getTravelAdvisory(); + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * .google.maps.routing.v2.RouteLegTravelAdvisory travel_advisory = 8; + */ + com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStep.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStep.java new file mode 100644 index 000000000000..67b2489432a8 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStep.java @@ -0,0 +1,2180 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates a segment of a `RouteLeg`. A step corresponds to a single
+ * navigation instruction. Route legs are made up of steps.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLegStep} + */ +public final class RouteLegStep extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteLegStep) + RouteLegStepOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteLegStep.newBuilder() to construct. + private RouteLegStep(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteLegStep() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteLegStep(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLegStep.class, + com.google.maps.routing.v2.RouteLegStep.Builder.class); + } + + public static final int DISTANCE_METERS_FIELD_NUMBER = 1; + private int distanceMeters_; + /** + * + * + *
+   * The travel distance of this step, in meters. In some circumstances, this
+   * field might not have a value.
+   * 
+ * + * int32 distance_meters = 1; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + + public static final int STATIC_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration staticDuration_; + /** + * + * + *
+   * The duration of travel through this step without taking traffic conditions
+   * into consideration. In some circumstances, this field might not have a
+   * value.
+   * 
+ * + * .google.protobuf.Duration static_duration = 2; + * + * @return Whether the staticDuration field is set. + */ + @java.lang.Override + public boolean hasStaticDuration() { + return staticDuration_ != null; + } + /** + * + * + *
+   * The duration of travel through this step without taking traffic conditions
+   * into consideration. In some circumstances, this field might not have a
+   * value.
+   * 
+ * + * .google.protobuf.Duration static_duration = 2; + * + * @return The staticDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getStaticDuration() { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + /** + * + * + *
+   * The duration of travel through this step without taking traffic conditions
+   * into consideration. In some circumstances, this field might not have a
+   * value.
+   * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + return getStaticDuration(); + } + + public static final int POLYLINE_FIELD_NUMBER = 3; + private com.google.maps.routing.v2.Polyline polyline_; + /** + * + * + *
+   * The polyline associated with this step.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + * + * @return Whether the polyline field is set. + */ + @java.lang.Override + public boolean hasPolyline() { + return polyline_ != null; + } + /** + * + * + *
+   * The polyline associated with this step.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + * + * @return The polyline. + */ + @java.lang.Override + public com.google.maps.routing.v2.Polyline getPolyline() { + return polyline_ == null ? com.google.maps.routing.v2.Polyline.getDefaultInstance() : polyline_; + } + /** + * + * + *
+   * The polyline associated with this step.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + @java.lang.Override + public com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder() { + return getPolyline(); + } + + public static final int START_LOCATION_FIELD_NUMBER = 4; + private com.google.maps.routing.v2.Location startLocation_; + /** + * + * + *
+   * The start location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + * + * @return Whether the startLocation field is set. + */ + @java.lang.Override + public boolean hasStartLocation() { + return startLocation_ != null; + } + /** + * + * + *
+   * The start location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + * + * @return The startLocation. + */ + @java.lang.Override + public com.google.maps.routing.v2.Location getStartLocation() { + return startLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : startLocation_; + } + /** + * + * + *
+   * The start location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + @java.lang.Override + public com.google.maps.routing.v2.LocationOrBuilder getStartLocationOrBuilder() { + return getStartLocation(); + } + + public static final int END_LOCATION_FIELD_NUMBER = 5; + private com.google.maps.routing.v2.Location endLocation_; + /** + * + * + *
+   * The end location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + * + * @return Whether the endLocation field is set. + */ + @java.lang.Override + public boolean hasEndLocation() { + return endLocation_ != null; + } + /** + * + * + *
+   * The end location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + * + * @return The endLocation. + */ + @java.lang.Override + public com.google.maps.routing.v2.Location getEndLocation() { + return endLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : endLocation_; + } + /** + * + * + *
+   * The end location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + @java.lang.Override + public com.google.maps.routing.v2.LocationOrBuilder getEndLocationOrBuilder() { + return getEndLocation(); + } + + public static final int NAVIGATION_INSTRUCTION_FIELD_NUMBER = 6; + private com.google.maps.routing.v2.NavigationInstruction navigationInstruction_; + /** + * + * + *
+   * Navigation instructions.
+   * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + * + * @return Whether the navigationInstruction field is set. + */ + @java.lang.Override + public boolean hasNavigationInstruction() { + return navigationInstruction_ != null; + } + /** + * + * + *
+   * Navigation instructions.
+   * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + * + * @return The navigationInstruction. + */ + @java.lang.Override + public com.google.maps.routing.v2.NavigationInstruction getNavigationInstruction() { + return navigationInstruction_ == null + ? com.google.maps.routing.v2.NavigationInstruction.getDefaultInstance() + : navigationInstruction_; + } + /** + * + * + *
+   * Navigation instructions.
+   * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + @java.lang.Override + public com.google.maps.routing.v2.NavigationInstructionOrBuilder + getNavigationInstructionOrBuilder() { + return getNavigationInstruction(); + } + + public static final int TRAVEL_ADVISORY_FIELD_NUMBER = 7; + private com.google.maps.routing.v2.RouteLegStepTravelAdvisory travelAdvisory_; + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + * + * @return Whether the travelAdvisory field is set. + */ + @java.lang.Override + public boolean hasTravelAdvisory() { + return travelAdvisory_ != null; + } + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + * + * @return The travelAdvisory. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStepTravelAdvisory getTravelAdvisory() { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteLegStepTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder + getTravelAdvisoryOrBuilder() { + return getTravelAdvisory(); + } + + 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 (distanceMeters_ != 0) { + output.writeInt32(1, distanceMeters_); + } + if (staticDuration_ != null) { + output.writeMessage(2, getStaticDuration()); + } + if (polyline_ != null) { + output.writeMessage(3, getPolyline()); + } + if (startLocation_ != null) { + output.writeMessage(4, getStartLocation()); + } + if (endLocation_ != null) { + output.writeMessage(5, getEndLocation()); + } + if (navigationInstruction_ != null) { + output.writeMessage(6, getNavigationInstruction()); + } + if (travelAdvisory_ != null) { + output.writeMessage(7, getTravelAdvisory()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (distanceMeters_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, distanceMeters_); + } + if (staticDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStaticDuration()); + } + if (polyline_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPolyline()); + } + if (startLocation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartLocation()); + } + if (endLocation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndLocation()); + } + if (navigationInstruction_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getNavigationInstruction()); + } + if (travelAdvisory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTravelAdvisory()); + } + 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.routing.v2.RouteLegStep)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteLegStep other = (com.google.maps.routing.v2.RouteLegStep) obj; + + if (getDistanceMeters() != other.getDistanceMeters()) return false; + if (hasStaticDuration() != other.hasStaticDuration()) return false; + if (hasStaticDuration()) { + if (!getStaticDuration().equals(other.getStaticDuration())) return false; + } + if (hasPolyline() != other.hasPolyline()) return false; + if (hasPolyline()) { + if (!getPolyline().equals(other.getPolyline())) return false; + } + if (hasStartLocation() != other.hasStartLocation()) return false; + if (hasStartLocation()) { + if (!getStartLocation().equals(other.getStartLocation())) return false; + } + if (hasEndLocation() != other.hasEndLocation()) return false; + if (hasEndLocation()) { + if (!getEndLocation().equals(other.getEndLocation())) return false; + } + if (hasNavigationInstruction() != other.hasNavigationInstruction()) return false; + if (hasNavigationInstruction()) { + if (!getNavigationInstruction().equals(other.getNavigationInstruction())) return false; + } + if (hasTravelAdvisory() != other.hasTravelAdvisory()) return false; + if (hasTravelAdvisory()) { + if (!getTravelAdvisory().equals(other.getTravelAdvisory())) 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) + DISTANCE_METERS_FIELD_NUMBER; + hash = (53 * hash) + getDistanceMeters(); + if (hasStaticDuration()) { + hash = (37 * hash) + STATIC_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getStaticDuration().hashCode(); + } + if (hasPolyline()) { + hash = (37 * hash) + POLYLINE_FIELD_NUMBER; + hash = (53 * hash) + getPolyline().hashCode(); + } + if (hasStartLocation()) { + hash = (37 * hash) + START_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getStartLocation().hashCode(); + } + if (hasEndLocation()) { + hash = (37 * hash) + END_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndLocation().hashCode(); + } + if (hasNavigationInstruction()) { + hash = (37 * hash) + NAVIGATION_INSTRUCTION_FIELD_NUMBER; + hash = (53 * hash) + getNavigationInstruction().hashCode(); + } + if (hasTravelAdvisory()) { + hash = (37 * hash) + TRAVEL_ADVISORY_FIELD_NUMBER; + hash = (53 * hash) + getTravelAdvisory().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteLegStep parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegStep 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.routing.v2.RouteLegStep parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegStep 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.routing.v2.RouteLegStep parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegStep parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteLegStep parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegStep 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.routing.v2.RouteLegStep parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegStep 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.routing.v2.RouteLegStep parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegStep 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.routing.v2.RouteLegStep 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 segment of a `RouteLeg`. A step corresponds to a single
+   * navigation instruction. Route legs are made up of steps.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLegStep} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteLegStep) + com.google.maps.routing.v2.RouteLegStepOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLegStep.class, + com.google.maps.routing.v2.RouteLegStep.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteLegStep.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + distanceMeters_ = 0; + + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + if (polylineBuilder_ == null) { + polyline_ = null; + } else { + polyline_ = null; + polylineBuilder_ = null; + } + if (startLocationBuilder_ == null) { + startLocation_ = null; + } else { + startLocation_ = null; + startLocationBuilder_ = null; + } + if (endLocationBuilder_ == null) { + endLocation_ = null; + } else { + endLocation_ = null; + endLocationBuilder_ = null; + } + if (navigationInstructionBuilder_ == null) { + navigationInstruction_ = null; + } else { + navigationInstruction_ = null; + navigationInstructionBuilder_ = null; + } + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStep_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStep getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteLegStep.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStep build() { + com.google.maps.routing.v2.RouteLegStep result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStep buildPartial() { + com.google.maps.routing.v2.RouteLegStep result = + new com.google.maps.routing.v2.RouteLegStep(this); + result.distanceMeters_ = distanceMeters_; + if (staticDurationBuilder_ == null) { + result.staticDuration_ = staticDuration_; + } else { + result.staticDuration_ = staticDurationBuilder_.build(); + } + if (polylineBuilder_ == null) { + result.polyline_ = polyline_; + } else { + result.polyline_ = polylineBuilder_.build(); + } + if (startLocationBuilder_ == null) { + result.startLocation_ = startLocation_; + } else { + result.startLocation_ = startLocationBuilder_.build(); + } + if (endLocationBuilder_ == null) { + result.endLocation_ = endLocation_; + } else { + result.endLocation_ = endLocationBuilder_.build(); + } + if (navigationInstructionBuilder_ == null) { + result.navigationInstruction_ = navigationInstruction_; + } else { + result.navigationInstruction_ = navigationInstructionBuilder_.build(); + } + if (travelAdvisoryBuilder_ == null) { + result.travelAdvisory_ = travelAdvisory_; + } else { + result.travelAdvisory_ = travelAdvisoryBuilder_.build(); + } + 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.routing.v2.RouteLegStep) { + return mergeFrom((com.google.maps.routing.v2.RouteLegStep) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteLegStep other) { + if (other == com.google.maps.routing.v2.RouteLegStep.getDefaultInstance()) return this; + if (other.getDistanceMeters() != 0) { + setDistanceMeters(other.getDistanceMeters()); + } + if (other.hasStaticDuration()) { + mergeStaticDuration(other.getStaticDuration()); + } + if (other.hasPolyline()) { + mergePolyline(other.getPolyline()); + } + if (other.hasStartLocation()) { + mergeStartLocation(other.getStartLocation()); + } + if (other.hasEndLocation()) { + mergeEndLocation(other.getEndLocation()); + } + if (other.hasNavigationInstruction()) { + mergeNavigationInstruction(other.getNavigationInstruction()); + } + if (other.hasTravelAdvisory()) { + mergeTravelAdvisory(other.getTravelAdvisory()); + } + 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: + { + distanceMeters_ = input.readInt32(); + + break; + } // case 8 + case 18: + { + input.readMessage(getStaticDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getPolylineFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getStartLocationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + input.readMessage(getEndLocationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage( + getNavigationInstructionFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + input.readMessage(getTravelAdvisoryFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + 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 distanceMeters_; + /** + * + * + *
+     * The travel distance of this step, in meters. In some circumstances, this
+     * field might not have a value.
+     * 
+ * + * int32 distance_meters = 1; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + /** + * + * + *
+     * The travel distance of this step, in meters. In some circumstances, this
+     * field might not have a value.
+     * 
+ * + * int32 distance_meters = 1; + * + * @param value The distanceMeters to set. + * @return This builder for chaining. + */ + public Builder setDistanceMeters(int value) { + + distanceMeters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The travel distance of this step, in meters. In some circumstances, this
+     * field might not have a value.
+     * 
+ * + * int32 distance_meters = 1; + * + * @return This builder for chaining. + */ + public Builder clearDistanceMeters() { + + distanceMeters_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration staticDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + staticDurationBuilder_; + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + * + * @return Whether the staticDuration field is set. + */ + public boolean hasStaticDuration() { + return staticDurationBuilder_ != null || staticDuration_ != null; + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + * + * @return The staticDuration. + */ + public com.google.protobuf.Duration getStaticDuration() { + if (staticDurationBuilder_ == null) { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } else { + return staticDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + public Builder setStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + staticDuration_ = value; + onChanged(); + } else { + staticDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + public Builder setStaticDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (staticDurationBuilder_ == null) { + staticDuration_ = builderForValue.build(); + onChanged(); + } else { + staticDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + public Builder mergeStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (staticDuration_ != null) { + staticDuration_ = + com.google.protobuf.Duration.newBuilder(staticDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + staticDuration_ = value; + } + onChanged(); + } else { + staticDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + public Builder clearStaticDuration() { + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + onChanged(); + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + public com.google.protobuf.Duration.Builder getStaticDurationBuilder() { + + onChanged(); + return getStaticDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + if (staticDurationBuilder_ != null) { + return staticDurationBuilder_.getMessageOrBuilder(); + } else { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + } + /** + * + * + *
+     * The duration of travel through this step without taking traffic conditions
+     * into consideration. In some circumstances, this field might not have a
+     * value.
+     * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStaticDurationFieldBuilder() { + if (staticDurationBuilder_ == null) { + staticDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStaticDuration(), getParentForChildren(), isClean()); + staticDuration_ = null; + } + return staticDurationBuilder_; + } + + private com.google.maps.routing.v2.Polyline polyline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder> + polylineBuilder_; + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + * + * @return Whether the polyline field is set. + */ + public boolean hasPolyline() { + return polylineBuilder_ != null || polyline_ != null; + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + * + * @return The polyline. + */ + public com.google.maps.routing.v2.Polyline getPolyline() { + if (polylineBuilder_ == null) { + return polyline_ == null + ? com.google.maps.routing.v2.Polyline.getDefaultInstance() + : polyline_; + } else { + return polylineBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + public Builder setPolyline(com.google.maps.routing.v2.Polyline value) { + if (polylineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polyline_ = value; + onChanged(); + } else { + polylineBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + public Builder setPolyline(com.google.maps.routing.v2.Polyline.Builder builderForValue) { + if (polylineBuilder_ == null) { + polyline_ = builderForValue.build(); + onChanged(); + } else { + polylineBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + public Builder mergePolyline(com.google.maps.routing.v2.Polyline value) { + if (polylineBuilder_ == null) { + if (polyline_ != null) { + polyline_ = + com.google.maps.routing.v2.Polyline.newBuilder(polyline_) + .mergeFrom(value) + .buildPartial(); + } else { + polyline_ = value; + } + onChanged(); + } else { + polylineBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + public Builder clearPolyline() { + if (polylineBuilder_ == null) { + polyline_ = null; + onChanged(); + } else { + polyline_ = null; + polylineBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + public com.google.maps.routing.v2.Polyline.Builder getPolylineBuilder() { + + onChanged(); + return getPolylineFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + public com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder() { + if (polylineBuilder_ != null) { + return polylineBuilder_.getMessageOrBuilder(); + } else { + return polyline_ == null + ? com.google.maps.routing.v2.Polyline.getDefaultInstance() + : polyline_; + } + } + /** + * + * + *
+     * The polyline associated with this step.
+     * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder> + getPolylineFieldBuilder() { + if (polylineBuilder_ == null) { + polylineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Polyline, + com.google.maps.routing.v2.Polyline.Builder, + com.google.maps.routing.v2.PolylineOrBuilder>( + getPolyline(), getParentForChildren(), isClean()); + polyline_ = null; + } + return polylineBuilder_; + } + + private com.google.maps.routing.v2.Location startLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + startLocationBuilder_; + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + * + * @return Whether the startLocation field is set. + */ + public boolean hasStartLocation() { + return startLocationBuilder_ != null || startLocation_ != null; + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + * + * @return The startLocation. + */ + public com.google.maps.routing.v2.Location getStartLocation() { + if (startLocationBuilder_ == null) { + return startLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : startLocation_; + } else { + return startLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + public Builder setStartLocation(com.google.maps.routing.v2.Location value) { + if (startLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startLocation_ = value; + onChanged(); + } else { + startLocationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + public Builder setStartLocation(com.google.maps.routing.v2.Location.Builder builderForValue) { + if (startLocationBuilder_ == null) { + startLocation_ = builderForValue.build(); + onChanged(); + } else { + startLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + public Builder mergeStartLocation(com.google.maps.routing.v2.Location value) { + if (startLocationBuilder_ == null) { + if (startLocation_ != null) { + startLocation_ = + com.google.maps.routing.v2.Location.newBuilder(startLocation_) + .mergeFrom(value) + .buildPartial(); + } else { + startLocation_ = value; + } + onChanged(); + } else { + startLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + public Builder clearStartLocation() { + if (startLocationBuilder_ == null) { + startLocation_ = null; + onChanged(); + } else { + startLocation_ = null; + startLocationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + public com.google.maps.routing.v2.Location.Builder getStartLocationBuilder() { + + onChanged(); + return getStartLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + public com.google.maps.routing.v2.LocationOrBuilder getStartLocationOrBuilder() { + if (startLocationBuilder_ != null) { + return startLocationBuilder_.getMessageOrBuilder(); + } else { + return startLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : startLocation_; + } + } + /** + * + * + *
+     * The start location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + getStartLocationFieldBuilder() { + if (startLocationBuilder_ == null) { + startLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder>( + getStartLocation(), getParentForChildren(), isClean()); + startLocation_ = null; + } + return startLocationBuilder_; + } + + private com.google.maps.routing.v2.Location endLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + endLocationBuilder_; + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + * + * @return Whether the endLocation field is set. + */ + public boolean hasEndLocation() { + return endLocationBuilder_ != null || endLocation_ != null; + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + * + * @return The endLocation. + */ + public com.google.maps.routing.v2.Location getEndLocation() { + if (endLocationBuilder_ == null) { + return endLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : endLocation_; + } else { + return endLocationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + public Builder setEndLocation(com.google.maps.routing.v2.Location value) { + if (endLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endLocation_ = value; + onChanged(); + } else { + endLocationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + public Builder setEndLocation(com.google.maps.routing.v2.Location.Builder builderForValue) { + if (endLocationBuilder_ == null) { + endLocation_ = builderForValue.build(); + onChanged(); + } else { + endLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + public Builder mergeEndLocation(com.google.maps.routing.v2.Location value) { + if (endLocationBuilder_ == null) { + if (endLocation_ != null) { + endLocation_ = + com.google.maps.routing.v2.Location.newBuilder(endLocation_) + .mergeFrom(value) + .buildPartial(); + } else { + endLocation_ = value; + } + onChanged(); + } else { + endLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + public Builder clearEndLocation() { + if (endLocationBuilder_ == null) { + endLocation_ = null; + onChanged(); + } else { + endLocation_ = null; + endLocationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + public com.google.maps.routing.v2.Location.Builder getEndLocationBuilder() { + + onChanged(); + return getEndLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + public com.google.maps.routing.v2.LocationOrBuilder getEndLocationOrBuilder() { + if (endLocationBuilder_ != null) { + return endLocationBuilder_.getMessageOrBuilder(); + } else { + return endLocation_ == null + ? com.google.maps.routing.v2.Location.getDefaultInstance() + : endLocation_; + } + } + /** + * + * + *
+     * The end location of this step.
+     * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + getEndLocationFieldBuilder() { + if (endLocationBuilder_ == null) { + endLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder>( + getEndLocation(), getParentForChildren(), isClean()); + endLocation_ = null; + } + return endLocationBuilder_; + } + + private com.google.maps.routing.v2.NavigationInstruction navigationInstruction_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.NavigationInstruction, + com.google.maps.routing.v2.NavigationInstruction.Builder, + com.google.maps.routing.v2.NavigationInstructionOrBuilder> + navigationInstructionBuilder_; + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + * + * @return Whether the navigationInstruction field is set. + */ + public boolean hasNavigationInstruction() { + return navigationInstructionBuilder_ != null || navigationInstruction_ != null; + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + * + * @return The navigationInstruction. + */ + public com.google.maps.routing.v2.NavigationInstruction getNavigationInstruction() { + if (navigationInstructionBuilder_ == null) { + return navigationInstruction_ == null + ? com.google.maps.routing.v2.NavigationInstruction.getDefaultInstance() + : navigationInstruction_; + } else { + return navigationInstructionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + public Builder setNavigationInstruction( + com.google.maps.routing.v2.NavigationInstruction value) { + if (navigationInstructionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + navigationInstruction_ = value; + onChanged(); + } else { + navigationInstructionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + public Builder setNavigationInstruction( + com.google.maps.routing.v2.NavigationInstruction.Builder builderForValue) { + if (navigationInstructionBuilder_ == null) { + navigationInstruction_ = builderForValue.build(); + onChanged(); + } else { + navigationInstructionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + public Builder mergeNavigationInstruction( + com.google.maps.routing.v2.NavigationInstruction value) { + if (navigationInstructionBuilder_ == null) { + if (navigationInstruction_ != null) { + navigationInstruction_ = + com.google.maps.routing.v2.NavigationInstruction.newBuilder(navigationInstruction_) + .mergeFrom(value) + .buildPartial(); + } else { + navigationInstruction_ = value; + } + onChanged(); + } else { + navigationInstructionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + public Builder clearNavigationInstruction() { + if (navigationInstructionBuilder_ == null) { + navigationInstruction_ = null; + onChanged(); + } else { + navigationInstruction_ = null; + navigationInstructionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + public com.google.maps.routing.v2.NavigationInstruction.Builder + getNavigationInstructionBuilder() { + + onChanged(); + return getNavigationInstructionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + public com.google.maps.routing.v2.NavigationInstructionOrBuilder + getNavigationInstructionOrBuilder() { + if (navigationInstructionBuilder_ != null) { + return navigationInstructionBuilder_.getMessageOrBuilder(); + } else { + return navigationInstruction_ == null + ? com.google.maps.routing.v2.NavigationInstruction.getDefaultInstance() + : navigationInstruction_; + } + } + /** + * + * + *
+     * Navigation instructions.
+     * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.NavigationInstruction, + com.google.maps.routing.v2.NavigationInstruction.Builder, + com.google.maps.routing.v2.NavigationInstructionOrBuilder> + getNavigationInstructionFieldBuilder() { + if (navigationInstructionBuilder_ == null) { + navigationInstructionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.NavigationInstruction, + com.google.maps.routing.v2.NavigationInstruction.Builder, + com.google.maps.routing.v2.NavigationInstructionOrBuilder>( + getNavigationInstruction(), getParentForChildren(), isClean()); + navigationInstruction_ = null; + } + return navigationInstructionBuilder_; + } + + private com.google.maps.routing.v2.RouteLegStepTravelAdvisory travelAdvisory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteLegStepTravelAdvisory, + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder> + travelAdvisoryBuilder_; + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + * + * @return Whether the travelAdvisory field is set. + */ + public boolean hasTravelAdvisory() { + return travelAdvisoryBuilder_ != null || travelAdvisory_ != null; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + * + * @return The travelAdvisory. + */ + public com.google.maps.routing.v2.RouteLegStepTravelAdvisory getTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteLegStepTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } else { + return travelAdvisoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + public Builder setTravelAdvisory(com.google.maps.routing.v2.RouteLegStepTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelAdvisory_ = value; + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + public Builder setTravelAdvisory( + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder builderForValue) { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = builderForValue.build(); + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + public Builder mergeTravelAdvisory( + com.google.maps.routing.v2.RouteLegStepTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (travelAdvisory_ != null) { + travelAdvisory_ = + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.newBuilder(travelAdvisory_) + .mergeFrom(value) + .buildPartial(); + } else { + travelAdvisory_ = value; + } + onChanged(); + } else { + travelAdvisoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + public Builder clearTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + onChanged(); + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + public com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder + getTravelAdvisoryBuilder() { + + onChanged(); + return getTravelAdvisoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + public com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder + getTravelAdvisoryOrBuilder() { + if (travelAdvisoryBuilder_ != null) { + return travelAdvisoryBuilder_.getMessageOrBuilder(); + } else { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteLegStepTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + } + /** + * + * + *
+     * Encapsulates the additional information that the user should be informed
+     * about, such as possible traffic zone restriction on a leg step.
+     * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteLegStepTravelAdvisory, + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder> + getTravelAdvisoryFieldBuilder() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteLegStepTravelAdvisory, + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder>( + getTravelAdvisory(), getParentForChildren(), isClean()); + travelAdvisory_ = null; + } + return travelAdvisoryBuilder_; + } + + @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.routing.v2.RouteLegStep) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteLegStep) + private static final com.google.maps.routing.v2.RouteLegStep DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteLegStep(); + } + + public static com.google.maps.routing.v2.RouteLegStep getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteLegStep 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.routing.v2.RouteLegStep getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepOrBuilder.java new file mode 100644 index 000000000000..fc9f94c0fb44 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepOrBuilder.java @@ -0,0 +1,258 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public interface RouteLegStepOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteLegStep) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The travel distance of this step, in meters. In some circumstances, this
+   * field might not have a value.
+   * 
+ * + * int32 distance_meters = 1; + * + * @return The distanceMeters. + */ + int getDistanceMeters(); + + /** + * + * + *
+   * The duration of travel through this step without taking traffic conditions
+   * into consideration. In some circumstances, this field might not have a
+   * value.
+   * 
+ * + * .google.protobuf.Duration static_duration = 2; + * + * @return Whether the staticDuration field is set. + */ + boolean hasStaticDuration(); + /** + * + * + *
+   * The duration of travel through this step without taking traffic conditions
+   * into consideration. In some circumstances, this field might not have a
+   * value.
+   * 
+ * + * .google.protobuf.Duration static_duration = 2; + * + * @return The staticDuration. + */ + com.google.protobuf.Duration getStaticDuration(); + /** + * + * + *
+   * The duration of travel through this step without taking traffic conditions
+   * into consideration. In some circumstances, this field might not have a
+   * value.
+   * 
+ * + * .google.protobuf.Duration static_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder(); + + /** + * + * + *
+   * The polyline associated with this step.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + * + * @return Whether the polyline field is set. + */ + boolean hasPolyline(); + /** + * + * + *
+   * The polyline associated with this step.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + * + * @return The polyline. + */ + com.google.maps.routing.v2.Polyline getPolyline(); + /** + * + * + *
+   * The polyline associated with this step.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 3; + */ + com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder(); + + /** + * + * + *
+   * The start location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + * + * @return Whether the startLocation field is set. + */ + boolean hasStartLocation(); + /** + * + * + *
+   * The start location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + * + * @return The startLocation. + */ + com.google.maps.routing.v2.Location getStartLocation(); + /** + * + * + *
+   * The start location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location start_location = 4; + */ + com.google.maps.routing.v2.LocationOrBuilder getStartLocationOrBuilder(); + + /** + * + * + *
+   * The end location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + * + * @return Whether the endLocation field is set. + */ + boolean hasEndLocation(); + /** + * + * + *
+   * The end location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + * + * @return The endLocation. + */ + com.google.maps.routing.v2.Location getEndLocation(); + /** + * + * + *
+   * The end location of this step.
+   * 
+ * + * .google.maps.routing.v2.Location end_location = 5; + */ + com.google.maps.routing.v2.LocationOrBuilder getEndLocationOrBuilder(); + + /** + * + * + *
+   * Navigation instructions.
+   * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + * + * @return Whether the navigationInstruction field is set. + */ + boolean hasNavigationInstruction(); + /** + * + * + *
+   * Navigation instructions.
+   * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + * + * @return The navigationInstruction. + */ + com.google.maps.routing.v2.NavigationInstruction getNavigationInstruction(); + /** + * + * + *
+   * Navigation instructions.
+   * 
+ * + * .google.maps.routing.v2.NavigationInstruction navigation_instruction = 6; + */ + com.google.maps.routing.v2.NavigationInstructionOrBuilder getNavigationInstructionOrBuilder(); + + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + * + * @return Whether the travelAdvisory field is set. + */ + boolean hasTravelAdvisory(); + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + * + * @return The travelAdvisory. + */ + com.google.maps.routing.v2.RouteLegStepTravelAdvisory getTravelAdvisory(); + /** + * + * + *
+   * Encapsulates the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * .google.maps.routing.v2.RouteLegStepTravelAdvisory travel_advisory = 7; + */ + com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepTravelAdvisory.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepTravelAdvisory.java new file mode 100644 index 000000000000..2c5c6c86bd17 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepTravelAdvisory.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates the additional information that the user should be informed
+ * about, such as possible traffic zone restriction on a leg step.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLegStepTravelAdvisory} + */ +public final class RouteLegStepTravelAdvisory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteLegStepTravelAdvisory) + RouteLegStepTravelAdvisoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteLegStepTravelAdvisory.newBuilder() to construct. + private RouteLegStepTravelAdvisory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteLegStepTravelAdvisory() { + speedReadingIntervals_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteLegStepTravelAdvisory(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.class, + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder.class); + } + + public static final int SPEED_READING_INTERVALS_FIELD_NUMBER = 1; + private java.util.List speedReadingIntervals_; + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + @java.lang.Override + public java.util.List + getSpeedReadingIntervalsList() { + return speedReadingIntervals_; + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + @java.lang.Override + public java.util.List + getSpeedReadingIntervalsOrBuilderList() { + return speedReadingIntervals_; + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + @java.lang.Override + public int getSpeedReadingIntervalsCount() { + return speedReadingIntervals_.size(); + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index) { + return speedReadingIntervals_.get(index); + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder getSpeedReadingIntervalsOrBuilder( + int index) { + return speedReadingIntervals_.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 < speedReadingIntervals_.size(); i++) { + output.writeMessage(1, speedReadingIntervals_.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 < speedReadingIntervals_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, speedReadingIntervals_.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.routing.v2.RouteLegStepTravelAdvisory)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteLegStepTravelAdvisory other = + (com.google.maps.routing.v2.RouteLegStepTravelAdvisory) obj; + + if (!getSpeedReadingIntervalsList().equals(other.getSpeedReadingIntervalsList())) 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 (getSpeedReadingIntervalsCount() > 0) { + hash = (37 * hash) + SPEED_READING_INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getSpeedReadingIntervalsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory 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.routing.v2.RouteLegStepTravelAdvisory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory 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.routing.v2.RouteLegStepTravelAdvisory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory 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.routing.v2.RouteLegStepTravelAdvisory parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory 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.routing.v2.RouteLegStepTravelAdvisory parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory 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.routing.v2.RouteLegStepTravelAdvisory 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 the additional information that the user should be informed
+   * about, such as possible traffic zone restriction on a leg step.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLegStepTravelAdvisory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteLegStepTravelAdvisory) + com.google.maps.routing.v2.RouteLegStepTravelAdvisoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.class, + com.google.maps.routing.v2.RouteLegStepTravelAdvisory.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteLegStepTravelAdvisory.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervals_ = java.util.Collections.emptyList(); + } else { + speedReadingIntervals_ = null; + speedReadingIntervalsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStepTravelAdvisory getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteLegStepTravelAdvisory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStepTravelAdvisory build() { + com.google.maps.routing.v2.RouteLegStepTravelAdvisory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegStepTravelAdvisory buildPartial() { + com.google.maps.routing.v2.RouteLegStepTravelAdvisory result = + new com.google.maps.routing.v2.RouteLegStepTravelAdvisory(this); + int from_bitField0_ = bitField0_; + if (speedReadingIntervalsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + speedReadingIntervals_ = java.util.Collections.unmodifiableList(speedReadingIntervals_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.speedReadingIntervals_ = speedReadingIntervals_; + } else { + result.speedReadingIntervals_ = speedReadingIntervalsBuilder_.build(); + } + 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.routing.v2.RouteLegStepTravelAdvisory) { + return mergeFrom((com.google.maps.routing.v2.RouteLegStepTravelAdvisory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteLegStepTravelAdvisory other) { + if (other == com.google.maps.routing.v2.RouteLegStepTravelAdvisory.getDefaultInstance()) + return this; + if (speedReadingIntervalsBuilder_ == null) { + if (!other.speedReadingIntervals_.isEmpty()) { + if (speedReadingIntervals_.isEmpty()) { + speedReadingIntervals_ = other.speedReadingIntervals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.addAll(other.speedReadingIntervals_); + } + onChanged(); + } + } else { + if (!other.speedReadingIntervals_.isEmpty()) { + if (speedReadingIntervalsBuilder_.isEmpty()) { + speedReadingIntervalsBuilder_.dispose(); + speedReadingIntervalsBuilder_ = null; + speedReadingIntervals_ = other.speedReadingIntervals_; + bitField0_ = (bitField0_ & ~0x00000001); + speedReadingIntervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpeedReadingIntervalsFieldBuilder() + : null; + } else { + speedReadingIntervalsBuilder_.addAllMessages(other.speedReadingIntervals_); + } + } + } + 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.routing.v2.SpeedReadingInterval m = + input.readMessage( + com.google.maps.routing.v2.SpeedReadingInterval.parser(), + extensionRegistry); + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(m); + } else { + speedReadingIntervalsBuilder_.addMessage(m); + } + 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.util.List speedReadingIntervals_ = + java.util.Collections.emptyList(); + + private void ensureSpeedReadingIntervalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + speedReadingIntervals_ = + new java.util.ArrayList( + speedReadingIntervals_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder> + speedReadingIntervalsBuilder_; + + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public java.util.List + getSpeedReadingIntervalsList() { + if (speedReadingIntervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(speedReadingIntervals_); + } else { + return speedReadingIntervalsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public int getSpeedReadingIntervalsCount() { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.size(); + } else { + return speedReadingIntervalsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index) { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.get(index); + } else { + return speedReadingIntervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder setSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.set(index, value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder setSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.set(index, builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder addSpeedReadingIntervals(com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder addSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(index, value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder addSpeedReadingIntervals( + com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder addSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(index, builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder addAllSpeedReadingIntervals( + java.lang.Iterable values) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, speedReadingIntervals_); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder clearSpeedReadingIntervals() { + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + speedReadingIntervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public Builder removeSpeedReadingIntervals(int index) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.remove(index); + onChanged(); + } else { + speedReadingIntervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder getSpeedReadingIntervalsBuilder( + int index) { + return getSpeedReadingIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder + getSpeedReadingIntervalsOrBuilder(int index) { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.get(index); + } else { + return speedReadingIntervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public java.util.List + getSpeedReadingIntervalsOrBuilderList() { + if (speedReadingIntervalsBuilder_ != null) { + return speedReadingIntervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(speedReadingIntervals_); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder + addSpeedReadingIntervalsBuilder() { + return getSpeedReadingIntervalsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder addSpeedReadingIntervalsBuilder( + int index) { + return getSpeedReadingIntervalsFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLegStep without
+     * overlap. The start point of a specified interval is the same as the end
+     * point of the preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + * + */ + public java.util.List + getSpeedReadingIntervalsBuilderList() { + return getSpeedReadingIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder> + getSpeedReadingIntervalsFieldBuilder() { + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder>( + speedReadingIntervals_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + speedReadingIntervals_ = null; + } + return speedReadingIntervalsBuilder_; + } + + @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.routing.v2.RouteLegStepTravelAdvisory) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteLegStepTravelAdvisory) + private static final com.google.maps.routing.v2.RouteLegStepTravelAdvisory DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteLegStepTravelAdvisory(); + } + + public static com.google.maps.routing.v2.RouteLegStepTravelAdvisory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteLegStepTravelAdvisory 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.routing.v2.RouteLegStepTravelAdvisory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepTravelAdvisoryOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepTravelAdvisoryOrBuilder.java new file mode 100644 index 000000000000..5c758c9b60d7 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegStepTravelAdvisoryOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public interface RouteLegStepTravelAdvisoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteLegStepTravelAdvisory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + java.util.List getSpeedReadingIntervalsList(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + int getSpeedReadingIntervalsCount(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + java.util.List + getSpeedReadingIntervalsOrBuilderList(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLegStep without
+   * overlap. The start point of a specified interval is the same as the end
+   * point of the preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 1; + */ + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder getSpeedReadingIntervalsOrBuilder( + int index); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegTravelAdvisory.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegTravelAdvisory.java new file mode 100644 index 000000000000..41a67bddf090 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegTravelAdvisory.java @@ -0,0 +1,1438 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates the additional information that the user should be informed
+ * about, such as possible traffic zone restriction etc. on a route leg.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLegTravelAdvisory} + */ +public final class RouteLegTravelAdvisory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteLegTravelAdvisory) + RouteLegTravelAdvisoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteLegTravelAdvisory.newBuilder() to construct. + private RouteLegTravelAdvisory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteLegTravelAdvisory() { + speedReadingIntervals_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteLegTravelAdvisory(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLegTravelAdvisory.class, + com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder.class); + } + + public static final int TOLL_INFO_FIELD_NUMBER = 1; + private com.google.maps.routing.v2.TollInfo tollInfo_; + /** + * + * + *
+   * Encapsulates information about tolls on the specific RouteLeg.
+   * This field is only populated if we expect there are tolls on the RouteLeg.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field does not exist, then there is no toll on the RouteLeg.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + * + * @return Whether the tollInfo field is set. + */ + @java.lang.Override + public boolean hasTollInfo() { + return tollInfo_ != null; + } + /** + * + * + *
+   * Encapsulates information about tolls on the specific RouteLeg.
+   * This field is only populated if we expect there are tolls on the RouteLeg.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field does not exist, then there is no toll on the RouteLeg.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + * + * @return The tollInfo. + */ + @java.lang.Override + public com.google.maps.routing.v2.TollInfo getTollInfo() { + return tollInfo_ == null ? com.google.maps.routing.v2.TollInfo.getDefaultInstance() : tollInfo_; + } + /** + * + * + *
+   * Encapsulates information about tolls on the specific RouteLeg.
+   * This field is only populated if we expect there are tolls on the RouteLeg.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field does not exist, then there is no toll on the RouteLeg.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.TollInfoOrBuilder getTollInfoOrBuilder() { + return getTollInfo(); + } + + public static final int SPEED_READING_INTERVALS_FIELD_NUMBER = 2; + private java.util.List speedReadingIntervals_; + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + @java.lang.Override + public java.util.List + getSpeedReadingIntervalsList() { + return speedReadingIntervals_; + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + @java.lang.Override + public java.util.List + getSpeedReadingIntervalsOrBuilderList() { + return speedReadingIntervals_; + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + @java.lang.Override + public int getSpeedReadingIntervalsCount() { + return speedReadingIntervals_.size(); + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index) { + return speedReadingIntervals_.get(index); + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder getSpeedReadingIntervalsOrBuilder( + int index) { + return speedReadingIntervals_.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 (tollInfo_ != null) { + output.writeMessage(1, getTollInfo()); + } + for (int i = 0; i < speedReadingIntervals_.size(); i++) { + output.writeMessage(2, speedReadingIntervals_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tollInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTollInfo()); + } + for (int i = 0; i < speedReadingIntervals_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, speedReadingIntervals_.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.routing.v2.RouteLegTravelAdvisory)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteLegTravelAdvisory other = + (com.google.maps.routing.v2.RouteLegTravelAdvisory) obj; + + if (hasTollInfo() != other.hasTollInfo()) return false; + if (hasTollInfo()) { + if (!getTollInfo().equals(other.getTollInfo())) return false; + } + if (!getSpeedReadingIntervalsList().equals(other.getSpeedReadingIntervalsList())) 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 (hasTollInfo()) { + hash = (37 * hash) + TOLL_INFO_FIELD_NUMBER; + hash = (53 * hash) + getTollInfo().hashCode(); + } + if (getSpeedReadingIntervalsCount() > 0) { + hash = (37 * hash) + SPEED_READING_INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getSpeedReadingIntervalsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory 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.routing.v2.RouteLegTravelAdvisory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory 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.routing.v2.RouteLegTravelAdvisory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory 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.routing.v2.RouteLegTravelAdvisory parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory 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.routing.v2.RouteLegTravelAdvisory parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory 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.routing.v2.RouteLegTravelAdvisory 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 the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc. on a route leg.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteLegTravelAdvisory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteLegTravelAdvisory) + com.google.maps.routing.v2.RouteLegTravelAdvisoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteLegTravelAdvisory.class, + com.google.maps.routing.v2.RouteLegTravelAdvisory.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteLegTravelAdvisory.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tollInfoBuilder_ == null) { + tollInfo_ = null; + } else { + tollInfo_ = null; + tollInfoBuilder_ = null; + } + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervals_ = java.util.Collections.emptyList(); + } else { + speedReadingIntervals_ = null; + speedReadingIntervalsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegTravelAdvisory getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteLegTravelAdvisory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegTravelAdvisory build() { + com.google.maps.routing.v2.RouteLegTravelAdvisory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteLegTravelAdvisory buildPartial() { + com.google.maps.routing.v2.RouteLegTravelAdvisory result = + new com.google.maps.routing.v2.RouteLegTravelAdvisory(this); + int from_bitField0_ = bitField0_; + if (tollInfoBuilder_ == null) { + result.tollInfo_ = tollInfo_; + } else { + result.tollInfo_ = tollInfoBuilder_.build(); + } + if (speedReadingIntervalsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + speedReadingIntervals_ = java.util.Collections.unmodifiableList(speedReadingIntervals_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.speedReadingIntervals_ = speedReadingIntervals_; + } else { + result.speedReadingIntervals_ = speedReadingIntervalsBuilder_.build(); + } + 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.routing.v2.RouteLegTravelAdvisory) { + return mergeFrom((com.google.maps.routing.v2.RouteLegTravelAdvisory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteLegTravelAdvisory other) { + if (other == com.google.maps.routing.v2.RouteLegTravelAdvisory.getDefaultInstance()) + return this; + if (other.hasTollInfo()) { + mergeTollInfo(other.getTollInfo()); + } + if (speedReadingIntervalsBuilder_ == null) { + if (!other.speedReadingIntervals_.isEmpty()) { + if (speedReadingIntervals_.isEmpty()) { + speedReadingIntervals_ = other.speedReadingIntervals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.addAll(other.speedReadingIntervals_); + } + onChanged(); + } + } else { + if (!other.speedReadingIntervals_.isEmpty()) { + if (speedReadingIntervalsBuilder_.isEmpty()) { + speedReadingIntervalsBuilder_.dispose(); + speedReadingIntervalsBuilder_ = null; + speedReadingIntervals_ = other.speedReadingIntervals_; + bitField0_ = (bitField0_ & ~0x00000001); + speedReadingIntervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpeedReadingIntervalsFieldBuilder() + : null; + } else { + speedReadingIntervalsBuilder_.addAllMessages(other.speedReadingIntervals_); + } + } + } + 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(getTollInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + com.google.maps.routing.v2.SpeedReadingInterval m = + input.readMessage( + com.google.maps.routing.v2.SpeedReadingInterval.parser(), + extensionRegistry); + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(m); + } else { + speedReadingIntervalsBuilder_.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 com.google.maps.routing.v2.TollInfo tollInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.TollInfo, + com.google.maps.routing.v2.TollInfo.Builder, + com.google.maps.routing.v2.TollInfoOrBuilder> + tollInfoBuilder_; + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + * + * @return Whether the tollInfo field is set. + */ + public boolean hasTollInfo() { + return tollInfoBuilder_ != null || tollInfo_ != null; + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + * + * @return The tollInfo. + */ + public com.google.maps.routing.v2.TollInfo getTollInfo() { + if (tollInfoBuilder_ == null) { + return tollInfo_ == null + ? com.google.maps.routing.v2.TollInfo.getDefaultInstance() + : tollInfo_; + } else { + return tollInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + public Builder setTollInfo(com.google.maps.routing.v2.TollInfo value) { + if (tollInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tollInfo_ = value; + onChanged(); + } else { + tollInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + public Builder setTollInfo(com.google.maps.routing.v2.TollInfo.Builder builderForValue) { + if (tollInfoBuilder_ == null) { + tollInfo_ = builderForValue.build(); + onChanged(); + } else { + tollInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + public Builder mergeTollInfo(com.google.maps.routing.v2.TollInfo value) { + if (tollInfoBuilder_ == null) { + if (tollInfo_ != null) { + tollInfo_ = + com.google.maps.routing.v2.TollInfo.newBuilder(tollInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + tollInfo_ = value; + } + onChanged(); + } else { + tollInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + public Builder clearTollInfo() { + if (tollInfoBuilder_ == null) { + tollInfo_ = null; + onChanged(); + } else { + tollInfo_ = null; + tollInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + public com.google.maps.routing.v2.TollInfo.Builder getTollInfoBuilder() { + + onChanged(); + return getTollInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + public com.google.maps.routing.v2.TollInfoOrBuilder getTollInfoOrBuilder() { + if (tollInfoBuilder_ != null) { + return tollInfoBuilder_.getMessageOrBuilder(); + } else { + return tollInfo_ == null + ? com.google.maps.routing.v2.TollInfo.getDefaultInstance() + : tollInfo_; + } + } + /** + * + * + *
+     * Encapsulates information about tolls on the specific RouteLeg.
+     * This field is only populated if we expect there are tolls on the RouteLeg.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field does not exist, then there is no toll on the RouteLeg.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.TollInfo, + com.google.maps.routing.v2.TollInfo.Builder, + com.google.maps.routing.v2.TollInfoOrBuilder> + getTollInfoFieldBuilder() { + if (tollInfoBuilder_ == null) { + tollInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.TollInfo, + com.google.maps.routing.v2.TollInfo.Builder, + com.google.maps.routing.v2.TollInfoOrBuilder>( + getTollInfo(), getParentForChildren(), isClean()); + tollInfo_ = null; + } + return tollInfoBuilder_; + } + + private java.util.List speedReadingIntervals_ = + java.util.Collections.emptyList(); + + private void ensureSpeedReadingIntervalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + speedReadingIntervals_ = + new java.util.ArrayList( + speedReadingIntervals_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder> + speedReadingIntervalsBuilder_; + + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public java.util.List + getSpeedReadingIntervalsList() { + if (speedReadingIntervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(speedReadingIntervals_); + } else { + return speedReadingIntervalsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public int getSpeedReadingIntervalsCount() { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.size(); + } else { + return speedReadingIntervalsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index) { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.get(index); + } else { + return speedReadingIntervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder setSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.set(index, value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder setSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.set(index, builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder addSpeedReadingIntervals(com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder addSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(index, value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder addSpeedReadingIntervals( + com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder addSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(index, builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder addAllSpeedReadingIntervals( + java.lang.Iterable values) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, speedReadingIntervals_); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder clearSpeedReadingIntervals() { + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + speedReadingIntervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public Builder removeSpeedReadingIntervals(int index) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.remove(index); + onChanged(); + } else { + speedReadingIntervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder getSpeedReadingIntervalsBuilder( + int index) { + return getSpeedReadingIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder + getSpeedReadingIntervalsOrBuilder(int index) { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.get(index); + } else { + return speedReadingIntervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public java.util.List + getSpeedReadingIntervalsOrBuilderList() { + if (speedReadingIntervalsBuilder_ != null) { + return speedReadingIntervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(speedReadingIntervals_); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder + addSpeedReadingIntervalsBuilder() { + return getSpeedReadingIntervalsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder addSpeedReadingIntervalsBuilder( + int index) { + return getSpeedReadingIntervalsFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the RouteLg without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + * + */ + public java.util.List + getSpeedReadingIntervalsBuilderList() { + return getSpeedReadingIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder> + getSpeedReadingIntervalsFieldBuilder() { + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder>( + speedReadingIntervals_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + speedReadingIntervals_ = null; + } + return speedReadingIntervalsBuilder_; + } + + @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.routing.v2.RouteLegTravelAdvisory) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteLegTravelAdvisory) + private static final com.google.maps.routing.v2.RouteLegTravelAdvisory DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteLegTravelAdvisory(); + } + + public static com.google.maps.routing.v2.RouteLegTravelAdvisory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteLegTravelAdvisory 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.routing.v2.RouteLegTravelAdvisory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegTravelAdvisoryOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegTravelAdvisoryOrBuilder.java new file mode 100644 index 000000000000..fbe256e0d85f --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteLegTravelAdvisoryOrBuilder.java @@ -0,0 +1,160 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public interface RouteLegTravelAdvisoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteLegTravelAdvisory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Encapsulates information about tolls on the specific RouteLeg.
+   * This field is only populated if we expect there are tolls on the RouteLeg.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field does not exist, then there is no toll on the RouteLeg.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + * + * @return Whether the tollInfo field is set. + */ + boolean hasTollInfo(); + /** + * + * + *
+   * Encapsulates information about tolls on the specific RouteLeg.
+   * This field is only populated if we expect there are tolls on the RouteLeg.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field does not exist, then there is no toll on the RouteLeg.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + * + * @return The tollInfo. + */ + com.google.maps.routing.v2.TollInfo getTollInfo(); + /** + * + * + *
+   * Encapsulates information about tolls on the specific RouteLeg.
+   * This field is only populated if we expect there are tolls on the RouteLeg.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field does not exist, then there is no toll on the RouteLeg.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 1; + */ + com.google.maps.routing.v2.TollInfoOrBuilder getTollInfoOrBuilder(); + + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + java.util.List getSpeedReadingIntervalsList(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + int getSpeedReadingIntervalsCount(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + java.util.List + getSpeedReadingIntervalsOrBuilderList(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the RouteLg without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 2; + */ + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder getSpeedReadingIntervalsOrBuilder( + int index); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixDestination.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixDestination.java new file mode 100644 index 000000000000..80beeaa88bb0 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixDestination.java @@ -0,0 +1,722 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A single destination for ComputeRouteMatrixRequest
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteMatrixDestination} + */ +public final class RouteMatrixDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteMatrixDestination) + RouteMatrixDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteMatrixDestination.newBuilder() to construct. + private RouteMatrixDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteMatrixDestination() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteMatrixDestination(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteMatrixDestination.class, + com.google.maps.routing.v2.RouteMatrixDestination.Builder.class); + } + + public static final int WAYPOINT_FIELD_NUMBER = 1; + private com.google.maps.routing.v2.Waypoint waypoint_; + /** + * + * + *
+   * Required. Destination waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the waypoint field is set. + */ + @java.lang.Override + public boolean hasWaypoint() { + return waypoint_ != null; + } + /** + * + * + *
+   * Required. Destination waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The waypoint. + */ + @java.lang.Override + public com.google.maps.routing.v2.Waypoint getWaypoint() { + return waypoint_ == null ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() : waypoint_; + } + /** + * + * + *
+   * Required. Destination waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.WaypointOrBuilder getWaypointOrBuilder() { + return getWaypoint(); + } + + 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 (waypoint_ != null) { + output.writeMessage(1, getWaypoint()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (waypoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWaypoint()); + } + 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.routing.v2.RouteMatrixDestination)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteMatrixDestination other = + (com.google.maps.routing.v2.RouteMatrixDestination) obj; + + if (hasWaypoint() != other.hasWaypoint()) return false; + if (hasWaypoint()) { + if (!getWaypoint().equals(other.getWaypoint())) 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 (hasWaypoint()) { + hash = (37 * hash) + WAYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getWaypoint().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteMatrixDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination 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.routing.v2.RouteMatrixDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination 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.routing.v2.RouteMatrixDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination 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.routing.v2.RouteMatrixDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination 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.routing.v2.RouteMatrixDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination 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.routing.v2.RouteMatrixDestination 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 single destination for ComputeRouteMatrixRequest
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteMatrixDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteMatrixDestination) + com.google.maps.routing.v2.RouteMatrixDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteMatrixDestination.class, + com.google.maps.routing.v2.RouteMatrixDestination.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteMatrixDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (waypointBuilder_ == null) { + waypoint_ = null; + } else { + waypoint_ = null; + waypointBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixDestination_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixDestination getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteMatrixDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixDestination build() { + com.google.maps.routing.v2.RouteMatrixDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixDestination buildPartial() { + com.google.maps.routing.v2.RouteMatrixDestination result = + new com.google.maps.routing.v2.RouteMatrixDestination(this); + if (waypointBuilder_ == null) { + result.waypoint_ = waypoint_; + } else { + result.waypoint_ = waypointBuilder_.build(); + } + 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.routing.v2.RouteMatrixDestination) { + return mergeFrom((com.google.maps.routing.v2.RouteMatrixDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteMatrixDestination other) { + if (other == com.google.maps.routing.v2.RouteMatrixDestination.getDefaultInstance()) + return this; + if (other.hasWaypoint()) { + mergeWaypoint(other.getWaypoint()); + } + 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(getWaypointFieldBuilder().getBuilder(), extensionRegistry); + + 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 com.google.maps.routing.v2.Waypoint waypoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + waypointBuilder_; + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the waypoint field is set. + */ + public boolean hasWaypoint() { + return waypointBuilder_ != null || waypoint_ != null; + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The waypoint. + */ + public com.google.maps.routing.v2.Waypoint getWaypoint() { + if (waypointBuilder_ == null) { + return waypoint_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : waypoint_; + } else { + return waypointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWaypoint(com.google.maps.routing.v2.Waypoint value) { + if (waypointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + waypoint_ = value; + onChanged(); + } else { + waypointBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWaypoint(com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (waypointBuilder_ == null) { + waypoint_ = builderForValue.build(); + onChanged(); + } else { + waypointBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWaypoint(com.google.maps.routing.v2.Waypoint value) { + if (waypointBuilder_ == null) { + if (waypoint_ != null) { + waypoint_ = + com.google.maps.routing.v2.Waypoint.newBuilder(waypoint_) + .mergeFrom(value) + .buildPartial(); + } else { + waypoint_ = value; + } + onChanged(); + } else { + waypointBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWaypoint() { + if (waypointBuilder_ == null) { + waypoint_ = null; + onChanged(); + } else { + waypoint_ = null; + waypointBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder getWaypointBuilder() { + + onChanged(); + return getWaypointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.WaypointOrBuilder getWaypointOrBuilder() { + if (waypointBuilder_ != null) { + return waypointBuilder_.getMessageOrBuilder(); + } else { + return waypoint_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : waypoint_; + } + } + /** + * + * + *
+     * Required. Destination waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + getWaypointFieldBuilder() { + if (waypointBuilder_ == null) { + waypointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder>( + getWaypoint(), getParentForChildren(), isClean()); + waypoint_ = null; + } + return waypointBuilder_; + } + + @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.routing.v2.RouteMatrixDestination) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteMatrixDestination) + private static final com.google.maps.routing.v2.RouteMatrixDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteMatrixDestination(); + } + + public static com.google.maps.routing.v2.RouteMatrixDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteMatrixDestination 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.routing.v2.RouteMatrixDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixDestinationOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixDestinationOrBuilder.java new file mode 100644 index 000000000000..7f309d19082c --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixDestinationOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public interface RouteMatrixDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteMatrixDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Destination waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the waypoint field is set. + */ + boolean hasWaypoint(); + /** + * + * + *
+   * Required. Destination waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The waypoint. + */ + com.google.maps.routing.v2.Waypoint getWaypoint(); + /** + * + * + *
+   * Required. Destination waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.WaypointOrBuilder getWaypointOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElement.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElement.java new file mode 100644 index 000000000000..f1172620cf38 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElement.java @@ -0,0 +1,2387 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates route information computed for an origin/destination pair in the
+ * ComputeRouteMatrix API. This proto can be streamed to the client.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteMatrixElement} + */ +public final class RouteMatrixElement extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteMatrixElement) + RouteMatrixElementOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteMatrixElement.newBuilder() to construct. + private RouteMatrixElement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteMatrixElement() { + condition_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteMatrixElement(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteMatrixElement.class, + com.google.maps.routing.v2.RouteMatrixElement.Builder.class); + } + + private int bitField0_; + public static final int ORIGIN_INDEX_FIELD_NUMBER = 1; + private int originIndex_; + /** + * + * + *
+   * Zero-based index of the origin in the request.
+   * 
+ * + * optional int32 origin_index = 1; + * + * @return Whether the originIndex field is set. + */ + @java.lang.Override + public boolean hasOriginIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Zero-based index of the origin in the request.
+   * 
+ * + * optional int32 origin_index = 1; + * + * @return The originIndex. + */ + @java.lang.Override + public int getOriginIndex() { + return originIndex_; + } + + public static final int DESTINATION_INDEX_FIELD_NUMBER = 2; + private int destinationIndex_; + /** + * + * + *
+   * Zero-based index of the destination in the request.
+   * 
+ * + * optional int32 destination_index = 2; + * + * @return Whether the destinationIndex field is set. + */ + @java.lang.Override + public boolean hasDestinationIndex() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Zero-based index of the destination in the request.
+   * 
+ * + * optional int32 destination_index = 2; + * + * @return The destinationIndex. + */ + @java.lang.Override + public int getDestinationIndex() { + return destinationIndex_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private com.google.rpc.Status status_; + /** + * + * + *
+   * Error status code for this element.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+   * Error status code for this element.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+   * Error status code for this element.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int CONDITION_FIELD_NUMBER = 9; + private int condition_; + /** + * + * + *
+   * Indicates whether the route was found or not. Independent of status.
+   * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+   * Indicates whether the route was found or not. Independent of status.
+   * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return The condition. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixElementCondition getCondition() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteMatrixElementCondition result = + com.google.maps.routing.v2.RouteMatrixElementCondition.valueOf(condition_); + return result == null + ? com.google.maps.routing.v2.RouteMatrixElementCondition.UNRECOGNIZED + : result; + } + + public static final int DISTANCE_METERS_FIELD_NUMBER = 4; + private int distanceMeters_; + /** + * + * + *
+   * The travel distance of the route, in meters.
+   * 
+ * + * int32 distance_meters = 4; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + + public static final int DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 5; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 5; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return getDuration(); + } + + public static final int STATIC_DURATION_FIELD_NUMBER = 6; + private com.google.protobuf.Duration staticDuration_; + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 6; + * + * @return Whether the staticDuration field is set. + */ + @java.lang.Override + public boolean hasStaticDuration() { + return staticDuration_ != null; + } + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 6; + * + * @return The staticDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getStaticDuration() { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + return getStaticDuration(); + } + + public static final int TRAVEL_ADVISORY_FIELD_NUMBER = 7; + private com.google.maps.routing.v2.RouteTravelAdvisory travelAdvisory_; + /** + * + * + *
+   * Additional information about the route. For example: restriction
+   * information and toll information
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + * + * @return Whether the travelAdvisory field is set. + */ + @java.lang.Override + public boolean hasTravelAdvisory() { + return travelAdvisory_ != null; + } + /** + * + * + *
+   * Additional information about the route. For example: restriction
+   * information and toll information
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + * + * @return The travelAdvisory. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisory getTravelAdvisory() { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + /** + * + * + *
+   * Additional information about the route. For example: restriction
+   * information and toll information
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() { + return getTravelAdvisory(); + } + + public static final int FALLBACK_INFO_FIELD_NUMBER = 8; + private com.google.maps.routing.v2.FallbackInfo fallbackInfo_; + /** + * + * + *
+   * In some cases when the server is not able to compute the route with the
+   * given preferences for this particular origin/destination pair, it may
+   * fall back to using a different mode of computation. When fallback mode is
+   * used, this field contains detailed information about the fallback response.
+   * Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + * + * @return Whether the fallbackInfo field is set. + */ + @java.lang.Override + public boolean hasFallbackInfo() { + return fallbackInfo_ != null; + } + /** + * + * + *
+   * In some cases when the server is not able to compute the route with the
+   * given preferences for this particular origin/destination pair, it may
+   * fall back to using a different mode of computation. When fallback mode is
+   * used, this field contains detailed information about the fallback response.
+   * Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + * + * @return The fallbackInfo. + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfo getFallbackInfo() { + return fallbackInfo_ == null + ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance() + : fallbackInfo_; + } + /** + * + * + *
+   * In some cases when the server is not able to compute the route with the
+   * given preferences for this particular origin/destination pair, it may
+   * fall back to using a different mode of computation. When fallback mode is
+   * used, this field contains detailed information about the fallback response.
+   * Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + @java.lang.Override + public com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder() { + return getFallbackInfo(); + } + + 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, originIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, destinationIndex_); + } + if (status_ != null) { + output.writeMessage(3, getStatus()); + } + if (distanceMeters_ != 0) { + output.writeInt32(4, distanceMeters_); + } + if (duration_ != null) { + output.writeMessage(5, getDuration()); + } + if (staticDuration_ != null) { + output.writeMessage(6, getStaticDuration()); + } + if (travelAdvisory_ != null) { + output.writeMessage(7, getTravelAdvisory()); + } + if (fallbackInfo_ != null) { + output.writeMessage(8, getFallbackInfo()); + } + if (condition_ + != com.google.maps.routing.v2.RouteMatrixElementCondition + .ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, condition_); + } + 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, originIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, destinationIndex_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); + } + if (distanceMeters_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, distanceMeters_); + } + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDuration()); + } + if (staticDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStaticDuration()); + } + if (travelAdvisory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getTravelAdvisory()); + } + if (fallbackInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getFallbackInfo()); + } + if (condition_ + != com.google.maps.routing.v2.RouteMatrixElementCondition + .ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, condition_); + } + 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.routing.v2.RouteMatrixElement)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteMatrixElement other = + (com.google.maps.routing.v2.RouteMatrixElement) obj; + + if (hasOriginIndex() != other.hasOriginIndex()) return false; + if (hasOriginIndex()) { + if (getOriginIndex() != other.getOriginIndex()) return false; + } + if (hasDestinationIndex() != other.hasDestinationIndex()) return false; + if (hasDestinationIndex()) { + if (getDestinationIndex() != other.getDestinationIndex()) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (condition_ != other.condition_) return false; + if (getDistanceMeters() != other.getDistanceMeters()) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (hasStaticDuration() != other.hasStaticDuration()) return false; + if (hasStaticDuration()) { + if (!getStaticDuration().equals(other.getStaticDuration())) return false; + } + if (hasTravelAdvisory() != other.hasTravelAdvisory()) return false; + if (hasTravelAdvisory()) { + if (!getTravelAdvisory().equals(other.getTravelAdvisory())) return false; + } + if (hasFallbackInfo() != other.hasFallbackInfo()) return false; + if (hasFallbackInfo()) { + if (!getFallbackInfo().equals(other.getFallbackInfo())) 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 (hasOriginIndex()) { + hash = (37 * hash) + ORIGIN_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getOriginIndex(); + } + if (hasDestinationIndex()) { + hash = (37 * hash) + DESTINATION_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getDestinationIndex(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + condition_; + hash = (37 * hash) + DISTANCE_METERS_FIELD_NUMBER; + hash = (53 * hash) + getDistanceMeters(); + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + if (hasStaticDuration()) { + hash = (37 * hash) + STATIC_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getStaticDuration().hashCode(); + } + if (hasTravelAdvisory()) { + hash = (37 * hash) + TRAVEL_ADVISORY_FIELD_NUMBER; + hash = (53 * hash) + getTravelAdvisory().hashCode(); + } + if (hasFallbackInfo()) { + hash = (37 * hash) + FALLBACK_INFO_FIELD_NUMBER; + hash = (53 * hash) + getFallbackInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteMatrixElement parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixElement 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.routing.v2.RouteMatrixElement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixElement 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.routing.v2.RouteMatrixElement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixElement parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteMatrixElement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixElement 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.routing.v2.RouteMatrixElement parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixElement 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.routing.v2.RouteMatrixElement parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixElement 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.routing.v2.RouteMatrixElement 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 route information computed for an origin/destination pair in the
+   * ComputeRouteMatrix API. This proto can be streamed to the client.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteMatrixElement} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteMatrixElement) + com.google.maps.routing.v2.RouteMatrixElementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteMatrixElement.class, + com.google.maps.routing.v2.RouteMatrixElement.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteMatrixElement.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + originIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + destinationIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + condition_ = 0; + + distanceMeters_ = 0; + + if (durationBuilder_ == null) { + duration_ = null; + } else { + duration_ = null; + durationBuilder_ = null; + } + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + if (fallbackInfoBuilder_ == null) { + fallbackInfo_ = null; + } else { + fallbackInfo_ = null; + fallbackInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixElement_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixElement getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteMatrixElement.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixElement build() { + com.google.maps.routing.v2.RouteMatrixElement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixElement buildPartial() { + com.google.maps.routing.v2.RouteMatrixElement result = + new com.google.maps.routing.v2.RouteMatrixElement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originIndex_ = originIndex_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.destinationIndex_ = destinationIndex_; + to_bitField0_ |= 0x00000002; + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + result.condition_ = condition_; + result.distanceMeters_ = distanceMeters_; + if (durationBuilder_ == null) { + result.duration_ = duration_; + } else { + result.duration_ = durationBuilder_.build(); + } + if (staticDurationBuilder_ == null) { + result.staticDuration_ = staticDuration_; + } else { + result.staticDuration_ = staticDurationBuilder_.build(); + } + if (travelAdvisoryBuilder_ == null) { + result.travelAdvisory_ = travelAdvisory_; + } else { + result.travelAdvisory_ = travelAdvisoryBuilder_.build(); + } + if (fallbackInfoBuilder_ == null) { + result.fallbackInfo_ = fallbackInfo_; + } else { + result.fallbackInfo_ = fallbackInfoBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + 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.routing.v2.RouteMatrixElement) { + return mergeFrom((com.google.maps.routing.v2.RouteMatrixElement) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteMatrixElement other) { + if (other == com.google.maps.routing.v2.RouteMatrixElement.getDefaultInstance()) return this; + if (other.hasOriginIndex()) { + setOriginIndex(other.getOriginIndex()); + } + if (other.hasDestinationIndex()) { + setDestinationIndex(other.getDestinationIndex()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.condition_ != 0) { + setConditionValue(other.getConditionValue()); + } + if (other.getDistanceMeters() != 0) { + setDistanceMeters(other.getDistanceMeters()); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + if (other.hasStaticDuration()) { + mergeStaticDuration(other.getStaticDuration()); + } + if (other.hasTravelAdvisory()) { + mergeTravelAdvisory(other.getTravelAdvisory()); + } + if (other.hasFallbackInfo()) { + mergeFallbackInfo(other.getFallbackInfo()); + } + 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: + { + originIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + destinationIndex_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 32: + { + distanceMeters_ = input.readInt32(); + + break; + } // case 32 + case 42: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + input.readMessage(getStaticDurationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + input.readMessage(getTravelAdvisoryFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + input.readMessage(getFallbackInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 72: + { + condition_ = input.readEnum(); + + break; + } // case 72 + 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 originIndex_; + /** + * + * + *
+     * Zero-based index of the origin in the request.
+     * 
+ * + * optional int32 origin_index = 1; + * + * @return Whether the originIndex field is set. + */ + @java.lang.Override + public boolean hasOriginIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Zero-based index of the origin in the request.
+     * 
+ * + * optional int32 origin_index = 1; + * + * @return The originIndex. + */ + @java.lang.Override + public int getOriginIndex() { + return originIndex_; + } + /** + * + * + *
+     * Zero-based index of the origin in the request.
+     * 
+ * + * optional int32 origin_index = 1; + * + * @param value The originIndex to set. + * @return This builder for chaining. + */ + public Builder setOriginIndex(int value) { + bitField0_ |= 0x00000001; + originIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Zero-based index of the origin in the request.
+     * 
+ * + * optional int32 origin_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearOriginIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + originIndex_ = 0; + onChanged(); + return this; + } + + private int destinationIndex_; + /** + * + * + *
+     * Zero-based index of the destination in the request.
+     * 
+ * + * optional int32 destination_index = 2; + * + * @return Whether the destinationIndex field is set. + */ + @java.lang.Override + public boolean hasDestinationIndex() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Zero-based index of the destination in the request.
+     * 
+ * + * optional int32 destination_index = 2; + * + * @return The destinationIndex. + */ + @java.lang.Override + public int getDestinationIndex() { + return destinationIndex_; + } + /** + * + * + *
+     * Zero-based index of the destination in the request.
+     * 
+ * + * optional int32 destination_index = 2; + * + * @param value The destinationIndex to set. + * @return This builder for chaining. + */ + public Builder setDestinationIndex(int value) { + bitField0_ |= 0x00000002; + destinationIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Zero-based index of the destination in the request.
+     * 
+ * + * optional int32 destination_index = 2; + * + * @return This builder for chaining. + */ + public Builder clearDestinationIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + destinationIndex_ = 0; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+     * Error status code for this element.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private int condition_ = 0; + /** + * + * + *
+     * Indicates whether the route was found or not. Independent of status.
+     * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+     * Indicates whether the route was found or not. Independent of status.
+     * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @param value The enum numeric value on the wire for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionValue(int value) { + + condition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether the route was found or not. Independent of status.
+     * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return The condition. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixElementCondition getCondition() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.RouteMatrixElementCondition result = + com.google.maps.routing.v2.RouteMatrixElementCondition.valueOf(condition_); + return result == null + ? com.google.maps.routing.v2.RouteMatrixElementCondition.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates whether the route was found or not. Independent of status.
+     * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(com.google.maps.routing.v2.RouteMatrixElementCondition value) { + if (value == null) { + throw new NullPointerException(); + } + + condition_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether the route was found or not. Independent of status.
+     * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + + condition_ = 0; + onChanged(); + return this; + } + + private int distanceMeters_; + /** + * + * + *
+     * The travel distance of the route, in meters.
+     * 
+ * + * int32 distance_meters = 4; + * + * @return The distanceMeters. + */ + @java.lang.Override + public int getDistanceMeters() { + return distanceMeters_; + } + /** + * + * + *
+     * The travel distance of the route, in meters.
+     * 
+ * + * int32 distance_meters = 4; + * + * @param value The distanceMeters to set. + * @return This builder for chaining. + */ + public Builder setDistanceMeters(int value) { + + distanceMeters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The travel distance of the route, in meters.
+     * 
+ * + * int32 distance_meters = 4; + * + * @return This builder for chaining. + */ + public Builder clearDistanceMeters() { + + distanceMeters_ = 0; + onChanged(); + return this; + } + + 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_; + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return durationBuilder_ != null || duration_ != null; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + * + * @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(); + } + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + onChanged(); + } else { + durationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + onChanged(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (duration_ != null) { + duration_ = + com.google.protobuf.Duration.newBuilder(duration_).mergeFrom(value).buildPartial(); + } else { + duration_ = value; + } + onChanged(); + } else { + durationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + public Builder clearDuration() { + if (durationBuilder_ == null) { + duration_ = null; + onChanged(); + } else { + duration_ = null; + durationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + /** + * + * + *
+     * The length of time needed to navigate the route. If you set the
+     * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+     * `static_duration`. If you set the `routing_preference` to either
+     * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+     * taking traffic conditions into account.
+     * 
+ * + * .google.protobuf.Duration duration = 5; + */ + 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 com.google.protobuf.Duration staticDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + staticDurationBuilder_; + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + * + * @return Whether the staticDuration field is set. + */ + public boolean hasStaticDuration() { + return staticDurationBuilder_ != null || staticDuration_ != null; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + * + * @return The staticDuration. + */ + public com.google.protobuf.Duration getStaticDuration() { + if (staticDurationBuilder_ == null) { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } else { + return staticDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + public Builder setStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + staticDuration_ = value; + onChanged(); + } else { + staticDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + public Builder setStaticDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (staticDurationBuilder_ == null) { + staticDuration_ = builderForValue.build(); + onChanged(); + } else { + staticDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + public Builder mergeStaticDuration(com.google.protobuf.Duration value) { + if (staticDurationBuilder_ == null) { + if (staticDuration_ != null) { + staticDuration_ = + com.google.protobuf.Duration.newBuilder(staticDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + staticDuration_ = value; + } + onChanged(); + } else { + staticDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + public Builder clearStaticDuration() { + if (staticDurationBuilder_ == null) { + staticDuration_ = null; + onChanged(); + } else { + staticDuration_ = null; + staticDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + public com.google.protobuf.Duration.Builder getStaticDurationBuilder() { + + onChanged(); + return getStaticDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() { + if (staticDurationBuilder_ != null) { + return staticDurationBuilder_.getMessageOrBuilder(); + } else { + return staticDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : staticDuration_; + } + } + /** + * + * + *
+     * The duration of traveling through the route without taking traffic
+     * conditions into consideration.
+     * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStaticDurationFieldBuilder() { + if (staticDurationBuilder_ == null) { + staticDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStaticDuration(), getParentForChildren(), isClean()); + staticDuration_ = null; + } + return staticDurationBuilder_; + } + + private com.google.maps.routing.v2.RouteTravelAdvisory travelAdvisory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteTravelAdvisory, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder> + travelAdvisoryBuilder_; + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + * + * @return Whether the travelAdvisory field is set. + */ + public boolean hasTravelAdvisory() { + return travelAdvisoryBuilder_ != null || travelAdvisory_ != null; + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + * + * @return The travelAdvisory. + */ + public com.google.maps.routing.v2.RouteTravelAdvisory getTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } else { + return travelAdvisoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + public Builder setTravelAdvisory(com.google.maps.routing.v2.RouteTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + travelAdvisory_ = value; + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + public Builder setTravelAdvisory( + com.google.maps.routing.v2.RouteTravelAdvisory.Builder builderForValue) { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = builderForValue.build(); + onChanged(); + } else { + travelAdvisoryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + public Builder mergeTravelAdvisory(com.google.maps.routing.v2.RouteTravelAdvisory value) { + if (travelAdvisoryBuilder_ == null) { + if (travelAdvisory_ != null) { + travelAdvisory_ = + com.google.maps.routing.v2.RouteTravelAdvisory.newBuilder(travelAdvisory_) + .mergeFrom(value) + .buildPartial(); + } else { + travelAdvisory_ = value; + } + onChanged(); + } else { + travelAdvisoryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + public Builder clearTravelAdvisory() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisory_ = null; + onChanged(); + } else { + travelAdvisory_ = null; + travelAdvisoryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + public com.google.maps.routing.v2.RouteTravelAdvisory.Builder getTravelAdvisoryBuilder() { + + onChanged(); + return getTravelAdvisoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + public com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() { + if (travelAdvisoryBuilder_ != null) { + return travelAdvisoryBuilder_.getMessageOrBuilder(); + } else { + return travelAdvisory_ == null + ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance() + : travelAdvisory_; + } + } + /** + * + * + *
+     * Additional information about the route. For example: restriction
+     * information and toll information
+     * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteTravelAdvisory, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder> + getTravelAdvisoryFieldBuilder() { + if (travelAdvisoryBuilder_ == null) { + travelAdvisoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteTravelAdvisory, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder, + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder>( + getTravelAdvisory(), getParentForChildren(), isClean()); + travelAdvisory_ = null; + } + return travelAdvisoryBuilder_; + } + + private com.google.maps.routing.v2.FallbackInfo fallbackInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.FallbackInfo, + com.google.maps.routing.v2.FallbackInfo.Builder, + com.google.maps.routing.v2.FallbackInfoOrBuilder> + fallbackInfoBuilder_; + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + * + * @return Whether the fallbackInfo field is set. + */ + public boolean hasFallbackInfo() { + return fallbackInfoBuilder_ != null || fallbackInfo_ != null; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + * + * @return The fallbackInfo. + */ + public com.google.maps.routing.v2.FallbackInfo getFallbackInfo() { + if (fallbackInfoBuilder_ == null) { + return fallbackInfo_ == null + ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance() + : fallbackInfo_; + } else { + return fallbackInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + public Builder setFallbackInfo(com.google.maps.routing.v2.FallbackInfo value) { + if (fallbackInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fallbackInfo_ = value; + onChanged(); + } else { + fallbackInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + public Builder setFallbackInfo( + com.google.maps.routing.v2.FallbackInfo.Builder builderForValue) { + if (fallbackInfoBuilder_ == null) { + fallbackInfo_ = builderForValue.build(); + onChanged(); + } else { + fallbackInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + public Builder mergeFallbackInfo(com.google.maps.routing.v2.FallbackInfo value) { + if (fallbackInfoBuilder_ == null) { + if (fallbackInfo_ != null) { + fallbackInfo_ = + com.google.maps.routing.v2.FallbackInfo.newBuilder(fallbackInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + fallbackInfo_ = value; + } + onChanged(); + } else { + fallbackInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + public Builder clearFallbackInfo() { + if (fallbackInfoBuilder_ == null) { + fallbackInfo_ = null; + onChanged(); + } else { + fallbackInfo_ = null; + fallbackInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + public com.google.maps.routing.v2.FallbackInfo.Builder getFallbackInfoBuilder() { + + onChanged(); + return getFallbackInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + public com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder() { + if (fallbackInfoBuilder_ != null) { + return fallbackInfoBuilder_.getMessageOrBuilder(); + } else { + return fallbackInfo_ == null + ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance() + : fallbackInfo_; + } + } + /** + * + * + *
+     * In some cases when the server is not able to compute the route with the
+     * given preferences for this particular origin/destination pair, it may
+     * fall back to using a different mode of computation. When fallback mode is
+     * used, this field contains detailed information about the fallback response.
+     * Otherwise this field is unset.
+     * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.FallbackInfo, + com.google.maps.routing.v2.FallbackInfo.Builder, + com.google.maps.routing.v2.FallbackInfoOrBuilder> + getFallbackInfoFieldBuilder() { + if (fallbackInfoBuilder_ == null) { + fallbackInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.FallbackInfo, + com.google.maps.routing.v2.FallbackInfo.Builder, + com.google.maps.routing.v2.FallbackInfoOrBuilder>( + getFallbackInfo(), getParentForChildren(), isClean()); + fallbackInfo_ = null; + } + return fallbackInfoBuilder_; + } + + @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.routing.v2.RouteMatrixElement) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteMatrixElement) + private static final com.google.maps.routing.v2.RouteMatrixElement DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteMatrixElement(); + } + + public static com.google.maps.routing.v2.RouteMatrixElement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteMatrixElement 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.routing.v2.RouteMatrixElement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElementCondition.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElementCondition.java new file mode 100644 index 000000000000..462531141ef5 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElementCondition.java @@ -0,0 +1,183 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * The condition of the route being returned.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.RouteMatrixElementCondition} + */ +public enum RouteMatrixElementCondition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Only used when the `status` of the element is not OK.
+   * 
+ * + * ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; + */ + ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED(0), + /** + * + * + *
+   * A route was found, and the corresponding information was filled out for the
+   * element.
+   * 
+ * + * ROUTE_EXISTS = 1; + */ + ROUTE_EXISTS(1), + /** + * + * + *
+   * No route could be found. Fields containing route information, such as
+   * `distance_meters` or `duration`, will not be filled out in the element.
+   * 
+ * + * ROUTE_NOT_FOUND = 2; + */ + ROUTE_NOT_FOUND(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Only used when the `status` of the element is not OK.
+   * 
+ * + * ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; + */ + public static final int ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * A route was found, and the corresponding information was filled out for the
+   * element.
+   * 
+ * + * ROUTE_EXISTS = 1; + */ + public static final int ROUTE_EXISTS_VALUE = 1; + /** + * + * + *
+   * No route could be found. Fields containing route information, such as
+   * `distance_meters` or `duration`, will not be filled out in the element.
+   * 
+ * + * ROUTE_NOT_FOUND = 2; + */ + public static final int ROUTE_NOT_FOUND_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 RouteMatrixElementCondition 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 RouteMatrixElementCondition forNumber(int value) { + switch (value) { + case 0: + return ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED; + case 1: + return ROUTE_EXISTS; + case 2: + return ROUTE_NOT_FOUND; + 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 RouteMatrixElementCondition findValueByNumber(int number) { + return RouteMatrixElementCondition.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.routing.v2.RoutesServiceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final RouteMatrixElementCondition[] VALUES = values(); + + public static RouteMatrixElementCondition 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 RouteMatrixElementCondition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.RouteMatrixElementCondition) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElementOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElementOrBuilder.java new file mode 100644 index 000000000000..8158e7da0b77 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixElementOrBuilder.java @@ -0,0 +1,318 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public interface RouteMatrixElementOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteMatrixElement) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Zero-based index of the origin in the request.
+   * 
+ * + * optional int32 origin_index = 1; + * + * @return Whether the originIndex field is set. + */ + boolean hasOriginIndex(); + /** + * + * + *
+   * Zero-based index of the origin in the request.
+   * 
+ * + * optional int32 origin_index = 1; + * + * @return The originIndex. + */ + int getOriginIndex(); + + /** + * + * + *
+   * Zero-based index of the destination in the request.
+   * 
+ * + * optional int32 destination_index = 2; + * + * @return Whether the destinationIndex field is set. + */ + boolean hasDestinationIndex(); + /** + * + * + *
+   * Zero-based index of the destination in the request.
+   * 
+ * + * optional int32 destination_index = 2; + * + * @return The destinationIndex. + */ + int getDestinationIndex(); + + /** + * + * + *
+   * Error status code for this element.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+   * Error status code for this element.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+   * Error status code for this element.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * Indicates whether the route was found or not. Independent of status.
+   * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return The enum numeric value on the wire for condition. + */ + int getConditionValue(); + /** + * + * + *
+   * Indicates whether the route was found or not. Independent of status.
+   * 
+ * + * .google.maps.routing.v2.RouteMatrixElementCondition condition = 9; + * + * @return The condition. + */ + com.google.maps.routing.v2.RouteMatrixElementCondition getCondition(); + + /** + * + * + *
+   * The travel distance of the route, in meters.
+   * 
+ * + * int32 distance_meters = 4; + * + * @return The distanceMeters. + */ + int getDistanceMeters(); + + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 5; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 5; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 5; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 6; + * + * @return Whether the staticDuration field is set. + */ + boolean hasStaticDuration(); + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 6; + * + * @return The staticDuration. + */ + com.google.protobuf.Duration getStaticDuration(); + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 6; + */ + com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder(); + + /** + * + * + *
+   * Additional information about the route. For example: restriction
+   * information and toll information
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + * + * @return Whether the travelAdvisory field is set. + */ + boolean hasTravelAdvisory(); + /** + * + * + *
+   * Additional information about the route. For example: restriction
+   * information and toll information
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + * + * @return The travelAdvisory. + */ + com.google.maps.routing.v2.RouteTravelAdvisory getTravelAdvisory(); + /** + * + * + *
+   * Additional information about the route. For example: restriction
+   * information and toll information
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7; + */ + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder(); + + /** + * + * + *
+   * In some cases when the server is not able to compute the route with the
+   * given preferences for this particular origin/destination pair, it may
+   * fall back to using a different mode of computation. When fallback mode is
+   * used, this field contains detailed information about the fallback response.
+   * Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + * + * @return Whether the fallbackInfo field is set. + */ + boolean hasFallbackInfo(); + /** + * + * + *
+   * In some cases when the server is not able to compute the route with the
+   * given preferences for this particular origin/destination pair, it may
+   * fall back to using a different mode of computation. When fallback mode is
+   * used, this field contains detailed information about the fallback response.
+   * Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + * + * @return The fallbackInfo. + */ + com.google.maps.routing.v2.FallbackInfo getFallbackInfo(); + /** + * + * + *
+   * In some cases when the server is not able to compute the route with the
+   * given preferences for this particular origin/destination pair, it may
+   * fall back to using a different mode of computation. When fallback mode is
+   * used, this field contains detailed information about the fallback response.
+   * Otherwise this field is unset.
+   * 
+ * + * .google.maps.routing.v2.FallbackInfo fallback_info = 8; + */ + com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixOrigin.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixOrigin.java new file mode 100644 index 000000000000..f4b5e7947f0f --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixOrigin.java @@ -0,0 +1,1013 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A single origin for ComputeRouteMatrixRequest
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteMatrixOrigin} + */ +public final class RouteMatrixOrigin extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteMatrixOrigin) + RouteMatrixOriginOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteMatrixOrigin.newBuilder() to construct. + private RouteMatrixOrigin(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteMatrixOrigin() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteMatrixOrigin(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixOrigin_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixOrigin_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteMatrixOrigin.class, + com.google.maps.routing.v2.RouteMatrixOrigin.Builder.class); + } + + public static final int WAYPOINT_FIELD_NUMBER = 1; + private com.google.maps.routing.v2.Waypoint waypoint_; + /** + * + * + *
+   * Required. Origin waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the waypoint field is set. + */ + @java.lang.Override + public boolean hasWaypoint() { + return waypoint_ != null; + } + /** + * + * + *
+   * Required. Origin waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The waypoint. + */ + @java.lang.Override + public com.google.maps.routing.v2.Waypoint getWaypoint() { + return waypoint_ == null ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() : waypoint_; + } + /** + * + * + *
+   * Required. Origin waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.WaypointOrBuilder getWaypointOrBuilder() { + return getWaypoint(); + } + + public static final int ROUTE_MODIFIERS_FIELD_NUMBER = 2; + private com.google.maps.routing.v2.RouteModifiers routeModifiers_; + /** + * + * + *
+   * Optional. Modifiers for every route that takes this as the origin
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routeModifiers field is set. + */ + @java.lang.Override + public boolean hasRouteModifiers() { + return routeModifiers_ != null; + } + /** + * + * + *
+   * Optional. Modifiers for every route that takes this as the origin
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routeModifiers. + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiers getRouteModifiers() { + return routeModifiers_ == null + ? com.google.maps.routing.v2.RouteModifiers.getDefaultInstance() + : routeModifiers_; + } + /** + * + * + *
+   * Optional. Modifiers for every route that takes this as the origin
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiersOrBuilder getRouteModifiersOrBuilder() { + return getRouteModifiers(); + } + + 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 (waypoint_ != null) { + output.writeMessage(1, getWaypoint()); + } + if (routeModifiers_ != null) { + output.writeMessage(2, getRouteModifiers()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (waypoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWaypoint()); + } + if (routeModifiers_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRouteModifiers()); + } + 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.routing.v2.RouteMatrixOrigin)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteMatrixOrigin other = + (com.google.maps.routing.v2.RouteMatrixOrigin) obj; + + if (hasWaypoint() != other.hasWaypoint()) return false; + if (hasWaypoint()) { + if (!getWaypoint().equals(other.getWaypoint())) return false; + } + if (hasRouteModifiers() != other.hasRouteModifiers()) return false; + if (hasRouteModifiers()) { + if (!getRouteModifiers().equals(other.getRouteModifiers())) 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 (hasWaypoint()) { + hash = (37 * hash) + WAYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getWaypoint().hashCode(); + } + if (hasRouteModifiers()) { + hash = (37 * hash) + ROUTE_MODIFIERS_FIELD_NUMBER; + hash = (53 * hash) + getRouteModifiers().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin 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.routing.v2.RouteMatrixOrigin parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin 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.routing.v2.RouteMatrixOrigin parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin 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.routing.v2.RouteMatrixOrigin parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin 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.routing.v2.RouteMatrixOrigin parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin 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.routing.v2.RouteMatrixOrigin 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 single origin for ComputeRouteMatrixRequest
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteMatrixOrigin} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteMatrixOrigin) + com.google.maps.routing.v2.RouteMatrixOriginOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixOrigin_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixOrigin_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteMatrixOrigin.class, + com.google.maps.routing.v2.RouteMatrixOrigin.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteMatrixOrigin.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (waypointBuilder_ == null) { + waypoint_ = null; + } else { + waypoint_ = null; + waypointBuilder_ = null; + } + if (routeModifiersBuilder_ == null) { + routeModifiers_ = null; + } else { + routeModifiers_ = null; + routeModifiersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RoutesServiceProto + .internal_static_google_maps_routing_v2_RouteMatrixOrigin_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixOrigin getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteMatrixOrigin.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixOrigin build() { + com.google.maps.routing.v2.RouteMatrixOrigin result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteMatrixOrigin buildPartial() { + com.google.maps.routing.v2.RouteMatrixOrigin result = + new com.google.maps.routing.v2.RouteMatrixOrigin(this); + if (waypointBuilder_ == null) { + result.waypoint_ = waypoint_; + } else { + result.waypoint_ = waypointBuilder_.build(); + } + if (routeModifiersBuilder_ == null) { + result.routeModifiers_ = routeModifiers_; + } else { + result.routeModifiers_ = routeModifiersBuilder_.build(); + } + 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.routing.v2.RouteMatrixOrigin) { + return mergeFrom((com.google.maps.routing.v2.RouteMatrixOrigin) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteMatrixOrigin other) { + if (other == com.google.maps.routing.v2.RouteMatrixOrigin.getDefaultInstance()) return this; + if (other.hasWaypoint()) { + mergeWaypoint(other.getWaypoint()); + } + if (other.hasRouteModifiers()) { + mergeRouteModifiers(other.getRouteModifiers()); + } + 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(getWaypointFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getRouteModifiersFieldBuilder().getBuilder(), extensionRegistry); + + 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 com.google.maps.routing.v2.Waypoint waypoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + waypointBuilder_; + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the waypoint field is set. + */ + public boolean hasWaypoint() { + return waypointBuilder_ != null || waypoint_ != null; + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The waypoint. + */ + public com.google.maps.routing.v2.Waypoint getWaypoint() { + if (waypointBuilder_ == null) { + return waypoint_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : waypoint_; + } else { + return waypointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWaypoint(com.google.maps.routing.v2.Waypoint value) { + if (waypointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + waypoint_ = value; + onChanged(); + } else { + waypointBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWaypoint(com.google.maps.routing.v2.Waypoint.Builder builderForValue) { + if (waypointBuilder_ == null) { + waypoint_ = builderForValue.build(); + onChanged(); + } else { + waypointBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWaypoint(com.google.maps.routing.v2.Waypoint value) { + if (waypointBuilder_ == null) { + if (waypoint_ != null) { + waypoint_ = + com.google.maps.routing.v2.Waypoint.newBuilder(waypoint_) + .mergeFrom(value) + .buildPartial(); + } else { + waypoint_ = value; + } + onChanged(); + } else { + waypointBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWaypoint() { + if (waypointBuilder_ == null) { + waypoint_ = null; + onChanged(); + } else { + waypoint_ = null; + waypointBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.Waypoint.Builder getWaypointBuilder() { + + onChanged(); + return getWaypointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.routing.v2.WaypointOrBuilder getWaypointOrBuilder() { + if (waypointBuilder_ != null) { + return waypointBuilder_.getMessageOrBuilder(); + } else { + return waypoint_ == null + ? com.google.maps.routing.v2.Waypoint.getDefaultInstance() + : waypoint_; + } + } + /** + * + * + *
+     * Required. Origin waypoint
+     * 
+ * + * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder> + getWaypointFieldBuilder() { + if (waypointBuilder_ == null) { + waypointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Waypoint, + com.google.maps.routing.v2.Waypoint.Builder, + com.google.maps.routing.v2.WaypointOrBuilder>( + getWaypoint(), getParentForChildren(), isClean()); + waypoint_ = null; + } + return waypointBuilder_; + } + + private com.google.maps.routing.v2.RouteModifiers routeModifiers_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteModifiers, + com.google.maps.routing.v2.RouteModifiers.Builder, + com.google.maps.routing.v2.RouteModifiersOrBuilder> + routeModifiersBuilder_; + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routeModifiers field is set. + */ + public boolean hasRouteModifiers() { + return routeModifiersBuilder_ != null || routeModifiers_ != null; + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routeModifiers. + */ + public com.google.maps.routing.v2.RouteModifiers getRouteModifiers() { + if (routeModifiersBuilder_ == null) { + return routeModifiers_ == null + ? com.google.maps.routing.v2.RouteModifiers.getDefaultInstance() + : routeModifiers_; + } else { + return routeModifiersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRouteModifiers(com.google.maps.routing.v2.RouteModifiers value) { + if (routeModifiersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routeModifiers_ = value; + onChanged(); + } else { + routeModifiersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRouteModifiers( + com.google.maps.routing.v2.RouteModifiers.Builder builderForValue) { + if (routeModifiersBuilder_ == null) { + routeModifiers_ = builderForValue.build(); + onChanged(); + } else { + routeModifiersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRouteModifiers(com.google.maps.routing.v2.RouteModifiers value) { + if (routeModifiersBuilder_ == null) { + if (routeModifiers_ != null) { + routeModifiers_ = + com.google.maps.routing.v2.RouteModifiers.newBuilder(routeModifiers_) + .mergeFrom(value) + .buildPartial(); + } else { + routeModifiers_ = value; + } + onChanged(); + } else { + routeModifiersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRouteModifiers() { + if (routeModifiersBuilder_ == null) { + routeModifiers_ = null; + onChanged(); + } else { + routeModifiers_ = null; + routeModifiersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.RouteModifiers.Builder getRouteModifiersBuilder() { + + onChanged(); + return getRouteModifiersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.maps.routing.v2.RouteModifiersOrBuilder getRouteModifiersOrBuilder() { + if (routeModifiersBuilder_ != null) { + return routeModifiersBuilder_.getMessageOrBuilder(); + } else { + return routeModifiers_ == null + ? com.google.maps.routing.v2.RouteModifiers.getDefaultInstance() + : routeModifiers_; + } + } + /** + * + * + *
+     * Optional. Modifiers for every route that takes this as the origin
+     * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteModifiers, + com.google.maps.routing.v2.RouteModifiers.Builder, + com.google.maps.routing.v2.RouteModifiersOrBuilder> + getRouteModifiersFieldBuilder() { + if (routeModifiersBuilder_ == null) { + routeModifiersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.RouteModifiers, + com.google.maps.routing.v2.RouteModifiers.Builder, + com.google.maps.routing.v2.RouteModifiersOrBuilder>( + getRouteModifiers(), getParentForChildren(), isClean()); + routeModifiers_ = null; + } + return routeModifiersBuilder_; + } + + @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.routing.v2.RouteMatrixOrigin) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteMatrixOrigin) + private static final com.google.maps.routing.v2.RouteMatrixOrigin DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteMatrixOrigin(); + } + + public static com.google.maps.routing.v2.RouteMatrixOrigin getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteMatrixOrigin 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.routing.v2.RouteMatrixOrigin getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixOriginOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixOriginOrBuilder.java new file mode 100644 index 000000000000..655dfd269c03 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteMatrixOriginOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public interface RouteMatrixOriginOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteMatrixOrigin) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Origin waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the waypoint field is set. + */ + boolean hasWaypoint(); + /** + * + * + *
+   * Required. Origin waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The waypoint. + */ + com.google.maps.routing.v2.Waypoint getWaypoint(); + /** + * + * + *
+   * Required. Origin waypoint
+   * 
+ * + * .google.maps.routing.v2.Waypoint waypoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.routing.v2.WaypointOrBuilder getWaypointOrBuilder(); + + /** + * + * + *
+   * Optional. Modifiers for every route that takes this as the origin
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routeModifiers field is set. + */ + boolean hasRouteModifiers(); + /** + * + * + *
+   * Optional. Modifiers for every route that takes this as the origin
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routeModifiers. + */ + com.google.maps.routing.v2.RouteModifiers getRouteModifiers(); + /** + * + * + *
+   * Optional. Modifiers for every route that takes this as the origin
+   * 
+ * + * + * .google.maps.routing.v2.RouteModifiers route_modifiers = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.maps.routing.v2.RouteModifiersOrBuilder getRouteModifiersOrBuilder(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiers.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiers.java new file mode 100644 index 000000000000..c78ff5bae4d1 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiers.java @@ -0,0 +1,1550 @@ +/* + * Copyright 2020 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/routing/v2/route_modifiers.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates a set of optional conditions to satisfy when calculating the
+ * routes.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteModifiers} + */ +public final class RouteModifiers extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteModifiers) + RouteModifiersOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteModifiers.newBuilder() to construct. + private RouteModifiers(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteModifiers() { + tollPasses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteModifiers(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteModifiersProto + .internal_static_google_maps_routing_v2_RouteModifiers_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteModifiersProto + .internal_static_google_maps_routing_v2_RouteModifiers_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteModifiers.class, + com.google.maps.routing.v2.RouteModifiers.Builder.class); + } + + public static final int AVOID_TOLLS_FIELD_NUMBER = 1; + private boolean avoidTolls_; + /** + * + * + *
+   * Specifies whether to avoid toll roads where reasonable. Preference will be
+   * given to routes not containing toll roads. Applies only to the `DRIVE` and
+   * `TWO_WHEELER` travel modes.
+   * 
+ * + * bool avoid_tolls = 1; + * + * @return The avoidTolls. + */ + @java.lang.Override + public boolean getAvoidTolls() { + return avoidTolls_; + } + + public static final int AVOID_HIGHWAYS_FIELD_NUMBER = 2; + private boolean avoidHighways_; + /** + * + * + *
+   * Specifies whether to avoid highways where reasonable. Preference will be
+   * given to routes not containing highways. Applies only to the `DRIVE` and
+   * `TWO_WHEELER` travel modes.
+   * 
+ * + * bool avoid_highways = 2; + * + * @return The avoidHighways. + */ + @java.lang.Override + public boolean getAvoidHighways() { + return avoidHighways_; + } + + public static final int AVOID_FERRIES_FIELD_NUMBER = 3; + private boolean avoidFerries_; + /** + * + * + *
+   * Specifies whether to avoid ferries where reasonable. Preference will be
+   * given to routes not containing travel by ferries.
+   * Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
+   * 
+ * + * bool avoid_ferries = 3; + * + * @return The avoidFerries. + */ + @java.lang.Override + public boolean getAvoidFerries() { + return avoidFerries_; + } + + public static final int AVOID_INDOOR_FIELD_NUMBER = 4; + private boolean avoidIndoor_; + /** + * + * + *
+   * Specifies whether to avoid navigating indoors where reasonable. Preference
+   * will be given to routes not containing indoor navigation.
+   * Applies only to the `WALK` travel mode.
+   * 
+ * + * bool avoid_indoor = 4; + * + * @return The avoidIndoor. + */ + @java.lang.Override + public boolean getAvoidIndoor() { + return avoidIndoor_; + } + + public static final int VEHICLE_INFO_FIELD_NUMBER = 5; + private com.google.maps.routing.v2.VehicleInfo vehicleInfo_; + /** + * + * + *
+   * Specifies the vehicle information.
+   * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + * + * @return Whether the vehicleInfo field is set. + */ + @java.lang.Override + public boolean hasVehicleInfo() { + return vehicleInfo_ != null; + } + /** + * + * + *
+   * Specifies the vehicle information.
+   * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + * + * @return The vehicleInfo. + */ + @java.lang.Override + public com.google.maps.routing.v2.VehicleInfo getVehicleInfo() { + return vehicleInfo_ == null + ? com.google.maps.routing.v2.VehicleInfo.getDefaultInstance() + : vehicleInfo_; + } + /** + * + * + *
+   * Specifies the vehicle information.
+   * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + @java.lang.Override + public com.google.maps.routing.v2.VehicleInfoOrBuilder getVehicleInfoOrBuilder() { + return getVehicleInfo(); + } + + public static final int TOLL_PASSES_FIELD_NUMBER = 6; + private java.util.List tollPasses_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.routing.v2.TollPass> + tollPasses_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.routing.v2.TollPass>() { + public com.google.maps.routing.v2.TollPass convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.TollPass result = + com.google.maps.routing.v2.TollPass.valueOf(from); + return result == null ? com.google.maps.routing.v2.TollPass.UNRECOGNIZED : result; + } + }; + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return A list containing the tollPasses. + */ + @java.lang.Override + public java.util.List getTollPassesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.routing.v2.TollPass>(tollPasses_, tollPasses_converter_); + } + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return The count of tollPasses. + */ + @java.lang.Override + public int getTollPassesCount() { + return tollPasses_.size(); + } + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index of the element to return. + * @return The tollPasses at the given index. + */ + @java.lang.Override + public com.google.maps.routing.v2.TollPass getTollPasses(int index) { + return tollPasses_converter_.convert(tollPasses_.get(index)); + } + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return A list containing the enum numeric values on the wire for tollPasses. + */ + @java.lang.Override + public java.util.List getTollPassesValueList() { + return tollPasses_; + } + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of tollPasses at the given index. + */ + @java.lang.Override + public int getTollPassesValue(int index) { + return tollPasses_.get(index); + } + + private int tollPassesMemoizedSerializedSize; + + 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(); + if (avoidTolls_ != false) { + output.writeBool(1, avoidTolls_); + } + if (avoidHighways_ != false) { + output.writeBool(2, avoidHighways_); + } + if (avoidFerries_ != false) { + output.writeBool(3, avoidFerries_); + } + if (avoidIndoor_ != false) { + output.writeBool(4, avoidIndoor_); + } + if (vehicleInfo_ != null) { + output.writeMessage(5, getVehicleInfo()); + } + if (getTollPassesList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(tollPassesMemoizedSerializedSize); + } + for (int i = 0; i < tollPasses_.size(); i++) { + output.writeEnumNoTag(tollPasses_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (avoidTolls_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, avoidTolls_); + } + if (avoidHighways_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, avoidHighways_); + } + if (avoidFerries_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, avoidFerries_); + } + if (avoidIndoor_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, avoidIndoor_); + } + if (vehicleInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getVehicleInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < tollPasses_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(tollPasses_.get(i)); + } + size += dataSize; + if (!getTollPassesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + tollPassesMemoizedSerializedSize = 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.routing.v2.RouteModifiers)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteModifiers other = + (com.google.maps.routing.v2.RouteModifiers) obj; + + if (getAvoidTolls() != other.getAvoidTolls()) return false; + if (getAvoidHighways() != other.getAvoidHighways()) return false; + if (getAvoidFerries() != other.getAvoidFerries()) return false; + if (getAvoidIndoor() != other.getAvoidIndoor()) return false; + if (hasVehicleInfo() != other.hasVehicleInfo()) return false; + if (hasVehicleInfo()) { + if (!getVehicleInfo().equals(other.getVehicleInfo())) return false; + } + if (!tollPasses_.equals(other.tollPasses_)) 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) + AVOID_TOLLS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAvoidTolls()); + hash = (37 * hash) + AVOID_HIGHWAYS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAvoidHighways()); + hash = (37 * hash) + AVOID_FERRIES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAvoidFerries()); + hash = (37 * hash) + AVOID_INDOOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAvoidIndoor()); + if (hasVehicleInfo()) { + hash = (37 * hash) + VEHICLE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getVehicleInfo().hashCode(); + } + if (getTollPassesCount() > 0) { + hash = (37 * hash) + TOLL_PASSES_FIELD_NUMBER; + hash = (53 * hash) + tollPasses_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteModifiers parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteModifiers 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.routing.v2.RouteModifiers parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteModifiers 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.routing.v2.RouteModifiers parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteModifiers parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteModifiers parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteModifiers 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.routing.v2.RouteModifiers parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteModifiers 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.routing.v2.RouteModifiers parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteModifiers 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.routing.v2.RouteModifiers 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 set of optional conditions to satisfy when calculating the
+   * routes.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteModifiers} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteModifiers) + com.google.maps.routing.v2.RouteModifiersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteModifiersProto + .internal_static_google_maps_routing_v2_RouteModifiers_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteModifiersProto + .internal_static_google_maps_routing_v2_RouteModifiers_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteModifiers.class, + com.google.maps.routing.v2.RouteModifiers.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteModifiers.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + avoidTolls_ = false; + + avoidHighways_ = false; + + avoidFerries_ = false; + + avoidIndoor_ = false; + + if (vehicleInfoBuilder_ == null) { + vehicleInfo_ = null; + } else { + vehicleInfo_ = null; + vehicleInfoBuilder_ = null; + } + tollPasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteModifiersProto + .internal_static_google_maps_routing_v2_RouteModifiers_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiers getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteModifiers.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiers build() { + com.google.maps.routing.v2.RouteModifiers result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteModifiers buildPartial() { + com.google.maps.routing.v2.RouteModifiers result = + new com.google.maps.routing.v2.RouteModifiers(this); + int from_bitField0_ = bitField0_; + result.avoidTolls_ = avoidTolls_; + result.avoidHighways_ = avoidHighways_; + result.avoidFerries_ = avoidFerries_; + result.avoidIndoor_ = avoidIndoor_; + if (vehicleInfoBuilder_ == null) { + result.vehicleInfo_ = vehicleInfo_; + } else { + result.vehicleInfo_ = vehicleInfoBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + tollPasses_ = java.util.Collections.unmodifiableList(tollPasses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tollPasses_ = tollPasses_; + 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.routing.v2.RouteModifiers) { + return mergeFrom((com.google.maps.routing.v2.RouteModifiers) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteModifiers other) { + if (other == com.google.maps.routing.v2.RouteModifiers.getDefaultInstance()) return this; + if (other.getAvoidTolls() != false) { + setAvoidTolls(other.getAvoidTolls()); + } + if (other.getAvoidHighways() != false) { + setAvoidHighways(other.getAvoidHighways()); + } + if (other.getAvoidFerries() != false) { + setAvoidFerries(other.getAvoidFerries()); + } + if (other.getAvoidIndoor() != false) { + setAvoidIndoor(other.getAvoidIndoor()); + } + if (other.hasVehicleInfo()) { + mergeVehicleInfo(other.getVehicleInfo()); + } + if (!other.tollPasses_.isEmpty()) { + if (tollPasses_.isEmpty()) { + tollPasses_ = other.tollPasses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTollPassesIsMutable(); + tollPasses_.addAll(other.tollPasses_); + } + 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: + { + avoidTolls_ = input.readBool(); + + break; + } // case 8 + case 16: + { + avoidHighways_ = input.readBool(); + + break; + } // case 16 + case 24: + { + avoidFerries_ = input.readBool(); + + break; + } // case 24 + case 32: + { + avoidIndoor_ = input.readBool(); + + break; + } // case 32 + case 42: + { + input.readMessage(getVehicleInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 48: + { + int tmpRaw = input.readEnum(); + ensureTollPassesIsMutable(); + tollPasses_.add(tmpRaw); + break; + } // case 48 + case 50: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureTollPassesIsMutable(); + tollPasses_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 boolean avoidTolls_; + /** + * + * + *
+     * Specifies whether to avoid toll roads where reasonable. Preference will be
+     * given to routes not containing toll roads. Applies only to the `DRIVE` and
+     * `TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_tolls = 1; + * + * @return The avoidTolls. + */ + @java.lang.Override + public boolean getAvoidTolls() { + return avoidTolls_; + } + /** + * + * + *
+     * Specifies whether to avoid toll roads where reasonable. Preference will be
+     * given to routes not containing toll roads. Applies only to the `DRIVE` and
+     * `TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_tolls = 1; + * + * @param value The avoidTolls to set. + * @return This builder for chaining. + */ + public Builder setAvoidTolls(boolean value) { + + avoidTolls_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies whether to avoid toll roads where reasonable. Preference will be
+     * given to routes not containing toll roads. Applies only to the `DRIVE` and
+     * `TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_tolls = 1; + * + * @return This builder for chaining. + */ + public Builder clearAvoidTolls() { + + avoidTolls_ = false; + onChanged(); + return this; + } + + private boolean avoidHighways_; + /** + * + * + *
+     * Specifies whether to avoid highways where reasonable. Preference will be
+     * given to routes not containing highways. Applies only to the `DRIVE` and
+     * `TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_highways = 2; + * + * @return The avoidHighways. + */ + @java.lang.Override + public boolean getAvoidHighways() { + return avoidHighways_; + } + /** + * + * + *
+     * Specifies whether to avoid highways where reasonable. Preference will be
+     * given to routes not containing highways. Applies only to the `DRIVE` and
+     * `TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_highways = 2; + * + * @param value The avoidHighways to set. + * @return This builder for chaining. + */ + public Builder setAvoidHighways(boolean value) { + + avoidHighways_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies whether to avoid highways where reasonable. Preference will be
+     * given to routes not containing highways. Applies only to the `DRIVE` and
+     * `TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_highways = 2; + * + * @return This builder for chaining. + */ + public Builder clearAvoidHighways() { + + avoidHighways_ = false; + onChanged(); + return this; + } + + private boolean avoidFerries_; + /** + * + * + *
+     * Specifies whether to avoid ferries where reasonable. Preference will be
+     * given to routes not containing travel by ferries.
+     * Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_ferries = 3; + * + * @return The avoidFerries. + */ + @java.lang.Override + public boolean getAvoidFerries() { + return avoidFerries_; + } + /** + * + * + *
+     * Specifies whether to avoid ferries where reasonable. Preference will be
+     * given to routes not containing travel by ferries.
+     * Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_ferries = 3; + * + * @param value The avoidFerries to set. + * @return This builder for chaining. + */ + public Builder setAvoidFerries(boolean value) { + + avoidFerries_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies whether to avoid ferries where reasonable. Preference will be
+     * given to routes not containing travel by ferries.
+     * Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
+     * 
+ * + * bool avoid_ferries = 3; + * + * @return This builder for chaining. + */ + public Builder clearAvoidFerries() { + + avoidFerries_ = false; + onChanged(); + return this; + } + + private boolean avoidIndoor_; + /** + * + * + *
+     * Specifies whether to avoid navigating indoors where reasonable. Preference
+     * will be given to routes not containing indoor navigation.
+     * Applies only to the `WALK` travel mode.
+     * 
+ * + * bool avoid_indoor = 4; + * + * @return The avoidIndoor. + */ + @java.lang.Override + public boolean getAvoidIndoor() { + return avoidIndoor_; + } + /** + * + * + *
+     * Specifies whether to avoid navigating indoors where reasonable. Preference
+     * will be given to routes not containing indoor navigation.
+     * Applies only to the `WALK` travel mode.
+     * 
+ * + * bool avoid_indoor = 4; + * + * @param value The avoidIndoor to set. + * @return This builder for chaining. + */ + public Builder setAvoidIndoor(boolean value) { + + avoidIndoor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies whether to avoid navigating indoors where reasonable. Preference
+     * will be given to routes not containing indoor navigation.
+     * Applies only to the `WALK` travel mode.
+     * 
+ * + * bool avoid_indoor = 4; + * + * @return This builder for chaining. + */ + public Builder clearAvoidIndoor() { + + avoidIndoor_ = false; + onChanged(); + return this; + } + + private com.google.maps.routing.v2.VehicleInfo vehicleInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.VehicleInfo, + com.google.maps.routing.v2.VehicleInfo.Builder, + com.google.maps.routing.v2.VehicleInfoOrBuilder> + vehicleInfoBuilder_; + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + * + * @return Whether the vehicleInfo field is set. + */ + public boolean hasVehicleInfo() { + return vehicleInfoBuilder_ != null || vehicleInfo_ != null; + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + * + * @return The vehicleInfo. + */ + public com.google.maps.routing.v2.VehicleInfo getVehicleInfo() { + if (vehicleInfoBuilder_ == null) { + return vehicleInfo_ == null + ? com.google.maps.routing.v2.VehicleInfo.getDefaultInstance() + : vehicleInfo_; + } else { + return vehicleInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + public Builder setVehicleInfo(com.google.maps.routing.v2.VehicleInfo value) { + if (vehicleInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vehicleInfo_ = value; + onChanged(); + } else { + vehicleInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + public Builder setVehicleInfo(com.google.maps.routing.v2.VehicleInfo.Builder builderForValue) { + if (vehicleInfoBuilder_ == null) { + vehicleInfo_ = builderForValue.build(); + onChanged(); + } else { + vehicleInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + public Builder mergeVehicleInfo(com.google.maps.routing.v2.VehicleInfo value) { + if (vehicleInfoBuilder_ == null) { + if (vehicleInfo_ != null) { + vehicleInfo_ = + com.google.maps.routing.v2.VehicleInfo.newBuilder(vehicleInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + vehicleInfo_ = value; + } + onChanged(); + } else { + vehicleInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + public Builder clearVehicleInfo() { + if (vehicleInfoBuilder_ == null) { + vehicleInfo_ = null; + onChanged(); + } else { + vehicleInfo_ = null; + vehicleInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + public com.google.maps.routing.v2.VehicleInfo.Builder getVehicleInfoBuilder() { + + onChanged(); + return getVehicleInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + public com.google.maps.routing.v2.VehicleInfoOrBuilder getVehicleInfoOrBuilder() { + if (vehicleInfoBuilder_ != null) { + return vehicleInfoBuilder_.getMessageOrBuilder(); + } else { + return vehicleInfo_ == null + ? com.google.maps.routing.v2.VehicleInfo.getDefaultInstance() + : vehicleInfo_; + } + } + /** + * + * + *
+     * Specifies the vehicle information.
+     * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.VehicleInfo, + com.google.maps.routing.v2.VehicleInfo.Builder, + com.google.maps.routing.v2.VehicleInfoOrBuilder> + getVehicleInfoFieldBuilder() { + if (vehicleInfoBuilder_ == null) { + vehicleInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.VehicleInfo, + com.google.maps.routing.v2.VehicleInfo.Builder, + com.google.maps.routing.v2.VehicleInfoOrBuilder>( + getVehicleInfo(), getParentForChildren(), isClean()); + vehicleInfo_ = null; + } + return vehicleInfoBuilder_; + } + + private java.util.List tollPasses_ = java.util.Collections.emptyList(); + + private void ensureTollPassesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tollPasses_ = new java.util.ArrayList(tollPasses_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return A list containing the tollPasses. + */ + public java.util.List getTollPassesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.routing.v2.TollPass>( + tollPasses_, tollPasses_converter_); + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return The count of tollPasses. + */ + public int getTollPassesCount() { + return tollPasses_.size(); + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index of the element to return. + * @return The tollPasses at the given index. + */ + public com.google.maps.routing.v2.TollPass getTollPasses(int index) { + return tollPasses_converter_.convert(tollPasses_.get(index)); + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index to set the value at. + * @param value The tollPasses to set. + * @return This builder for chaining. + */ + public Builder setTollPasses(int index, com.google.maps.routing.v2.TollPass value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTollPassesIsMutable(); + tollPasses_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param value The tollPasses to add. + * @return This builder for chaining. + */ + public Builder addTollPasses(com.google.maps.routing.v2.TollPass value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTollPassesIsMutable(); + tollPasses_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param values The tollPasses to add. + * @return This builder for chaining. + */ + public Builder addAllTollPasses( + java.lang.Iterable values) { + ensureTollPassesIsMutable(); + for (com.google.maps.routing.v2.TollPass value : values) { + tollPasses_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return This builder for chaining. + */ + public Builder clearTollPasses() { + tollPasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return A list containing the enum numeric values on the wire for tollPasses. + */ + public java.util.List getTollPassesValueList() { + return java.util.Collections.unmodifiableList(tollPasses_); + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of tollPasses at the given index. + */ + public int getTollPassesValue(int index) { + return tollPasses_.get(index); + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for tollPasses to set. + * @return This builder for chaining. + */ + public Builder setTollPassesValue(int index, int value) { + ensureTollPassesIsMutable(); + tollPasses_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param value The enum numeric value on the wire for tollPasses to add. + * @return This builder for chaining. + */ + public Builder addTollPassesValue(int value) { + ensureTollPassesIsMutable(); + tollPasses_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Encapsulates information about toll passes.
+     * If toll passes are provided, the API tries to return the pass price. If
+     * toll passes are not provided, the API treats the toll pass as unknown and
+     * tries to return the cash price.
+     * Applies only to the DRIVE and TWO_WHEELER travel modes.
+     * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param values The enum numeric values on the wire for tollPasses to add. + * @return This builder for chaining. + */ + public Builder addAllTollPassesValue(java.lang.Iterable values) { + ensureTollPassesIsMutable(); + for (int value : values) { + tollPasses_.add(value); + } + 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.routing.v2.RouteModifiers) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteModifiers) + private static final com.google.maps.routing.v2.RouteModifiers DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteModifiers(); + } + + public static com.google.maps.routing.v2.RouteModifiers getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteModifiers 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.routing.v2.RouteModifiers getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiersOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiersOrBuilder.java new file mode 100644 index 000000000000..6e207822df2d --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiersOrBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright 2020 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/routing/v2/route_modifiers.proto + +package com.google.maps.routing.v2; + +public interface RouteModifiersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteModifiers) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Specifies whether to avoid toll roads where reasonable. Preference will be
+   * given to routes not containing toll roads. Applies only to the `DRIVE` and
+   * `TWO_WHEELER` travel modes.
+   * 
+ * + * bool avoid_tolls = 1; + * + * @return The avoidTolls. + */ + boolean getAvoidTolls(); + + /** + * + * + *
+   * Specifies whether to avoid highways where reasonable. Preference will be
+   * given to routes not containing highways. Applies only to the `DRIVE` and
+   * `TWO_WHEELER` travel modes.
+   * 
+ * + * bool avoid_highways = 2; + * + * @return The avoidHighways. + */ + boolean getAvoidHighways(); + + /** + * + * + *
+   * Specifies whether to avoid ferries where reasonable. Preference will be
+   * given to routes not containing travel by ferries.
+   * Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
+   * 
+ * + * bool avoid_ferries = 3; + * + * @return The avoidFerries. + */ + boolean getAvoidFerries(); + + /** + * + * + *
+   * Specifies whether to avoid navigating indoors where reasonable. Preference
+   * will be given to routes not containing indoor navigation.
+   * Applies only to the `WALK` travel mode.
+   * 
+ * + * bool avoid_indoor = 4; + * + * @return The avoidIndoor. + */ + boolean getAvoidIndoor(); + + /** + * + * + *
+   * Specifies the vehicle information.
+   * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + * + * @return Whether the vehicleInfo field is set. + */ + boolean hasVehicleInfo(); + /** + * + * + *
+   * Specifies the vehicle information.
+   * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + * + * @return The vehicleInfo. + */ + com.google.maps.routing.v2.VehicleInfo getVehicleInfo(); + /** + * + * + *
+   * Specifies the vehicle information.
+   * 
+ * + * .google.maps.routing.v2.VehicleInfo vehicle_info = 5; + */ + com.google.maps.routing.v2.VehicleInfoOrBuilder getVehicleInfoOrBuilder(); + + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return A list containing the tollPasses. + */ + java.util.List getTollPassesList(); + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return The count of tollPasses. + */ + int getTollPassesCount(); + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index of the element to return. + * @return The tollPasses at the given index. + */ + com.google.maps.routing.v2.TollPass getTollPasses(int index); + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @return A list containing the enum numeric values on the wire for tollPasses. + */ + java.util.List getTollPassesValueList(); + /** + * + * + *
+   * Encapsulates information about toll passes.
+   * If toll passes are provided, the API tries to return the pass price. If
+   * toll passes are not provided, the API treats the toll pass as unknown and
+   * tries to return the cash price.
+   * Applies only to the DRIVE and TWO_WHEELER travel modes.
+   * 
+ * + * repeated .google.maps.routing.v2.TollPass toll_passes = 6; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of tollPasses at the given index. + */ + int getTollPassesValue(int index); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiersProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiersProto.java new file mode 100644 index 000000000000..f01f5afec580 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteModifiersProto.java @@ -0,0 +1,84 @@ +/* + * Copyright 2020 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/routing/v2/route_modifiers.proto + +package com.google.maps.routing.v2; + +public final class RouteModifiersProto { + private RouteModifiersProto() {} + + 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_routing_v2_RouteModifiers_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteModifiers_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/maps/routing/v2/route_modifiers" + + ".proto\022\026google.maps.routing.v2\032(google/m" + + "aps/routing/v2/toll_passes.proto\032)google" + + "/maps/routing/v2/vehicle_info.proto\"\334\001\n\016" + + "RouteModifiers\022\023\n\013avoid_tolls\030\001 \001(\010\022\026\n\016a" + + "void_highways\030\002 \001(\010\022\025\n\ravoid_ferries\030\003 \001" + + "(\010\022\024\n\014avoid_indoor\030\004 \001(\010\0229\n\014vehicle_info" + + "\030\005 \001(\0132#.google.maps.routing.v2.VehicleI" + + "nfo\0225\n\013toll_passes\030\006 \003(\0162 .google.maps.r" + + "outing.v2.TollPassB\313\001\n\032com.google.maps.r" + + "outing.v2B\023RouteModifiersProtoP\001Z=google" + + ".golang.org/genproto/googleapis/maps/rou" + + "ting/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Google.Maps" + + ".Routing.V2\312\002\026Google\\Maps\\Routing\\V2\352\002\031G" + + "oogle::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.maps.routing.v2.TollPassesProto.getDescriptor(), + com.google.maps.routing.v2.VehicleInfoProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_RouteModifiers_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_RouteModifiers_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteModifiers_descriptor, + new java.lang.String[] { + "AvoidTolls", + "AvoidHighways", + "AvoidFerries", + "AvoidIndoor", + "VehicleInfo", + "TollPasses", + }); + com.google.maps.routing.v2.TollPassesProto.getDescriptor(); + com.google.maps.routing.v2.VehicleInfoProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteOrBuilder.java new file mode 100644 index 000000000000..f3acda6beda8 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteOrBuilder.java @@ -0,0 +1,489 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public interface RouteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.Route) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return A list containing the routeLabels. + */ + java.util.List getRouteLabelsList(); + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return The count of routeLabels. + */ + int getRouteLabelsCount(); + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index of the element to return. + * @return The routeLabels at the given index. + */ + com.google.maps.routing.v2.RouteLabel getRouteLabels(int index); + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @return A list containing the enum numeric values on the wire for routeLabels. + */ + java.util.List getRouteLabelsValueList(); + /** + * + * + *
+   * Labels for the `Route` that are useful to identify specific properties
+   * of the route to compare against others.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLabel route_labels = 13; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of routeLabels at the given index. + */ + int getRouteLabelsValue(int index); + + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + java.util.List getLegsList(); + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + com.google.maps.routing.v2.RouteLeg getLegs(int index); + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + int getLegsCount(); + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + java.util.List getLegsOrBuilderList(); + /** + * + * + *
+   * A collection of legs (path segments between waypoints) that make-up the
+   * route. Each leg corresponds to the trip between two non-`via` Waypoints.
+   * For example, a route with no intermediate waypoints has only one leg. A
+   * route that includes one non-`via` intermediate waypoint has two legs. A
+   * route that includes one `via` intermediate waypoint has one leg. The order
+   * of the legs matches the order of Waypoints from `origin` to `intermediates`
+   * to `destination`.
+   * 
+ * + * repeated .google.maps.routing.v2.RouteLeg legs = 1; + */ + com.google.maps.routing.v2.RouteLegOrBuilder getLegsOrBuilder(int index); + + /** + * + * + *
+   * The travel distance of the route, in meters.
+   * 
+ * + * int32 distance_meters = 2; + * + * @return The distanceMeters. + */ + int getDistanceMeters(); + + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 3; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 3; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+   * The length of time needed to navigate the route. If you set the
+   * `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
+   * `static_duration`. If you set the `routing_preference` to either
+   * `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
+   * taking traffic conditions into account.
+   * 
+ * + * .google.protobuf.Duration duration = 3; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); + + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 4; + * + * @return Whether the staticDuration field is set. + */ + boolean hasStaticDuration(); + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 4; + * + * @return The staticDuration. + */ + com.google.protobuf.Duration getStaticDuration(); + /** + * + * + *
+   * The duration of traveling through the route without taking traffic
+   * conditions into consideration.
+   * 
+ * + * .google.protobuf.Duration static_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder(); + + /** + * + * + *
+   * The overall route polyline. This polyline will be the combined polyline of
+   * all `legs`.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + * + * @return Whether the polyline field is set. + */ + boolean hasPolyline(); + /** + * + * + *
+   * The overall route polyline. This polyline will be the combined polyline of
+   * all `legs`.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + * + * @return The polyline. + */ + com.google.maps.routing.v2.Polyline getPolyline(); + /** + * + * + *
+   * The overall route polyline. This polyline will be the combined polyline of
+   * all `legs`.
+   * 
+ * + * .google.maps.routing.v2.Polyline polyline = 5; + */ + com.google.maps.routing.v2.PolylineOrBuilder getPolylineOrBuilder(); + + /** + * + * + *
+   * A description of the route.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A description of the route.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @return A list containing the warnings. + */ + java.util.List getWarningsList(); + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @return The count of warnings. + */ + int getWarningsCount(); + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + java.lang.String getWarnings(int index); + /** + * + * + *
+   * An array of warnings to show when displaying the route.
+   * 
+ * + * repeated string warnings = 7; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + com.google.protobuf.ByteString getWarningsBytes(int index); + + /** + * + * + *
+   * The viewport bounding box of the polyline.
+   * 
+ * + * .google.geo.type.Viewport viewport = 8; + * + * @return Whether the viewport field is set. + */ + boolean hasViewport(); + /** + * + * + *
+   * The viewport bounding box of the polyline.
+   * 
+ * + * .google.geo.type.Viewport viewport = 8; + * + * @return The viewport. + */ + com.google.geo.type.Viewport getViewport(); + /** + * + * + *
+   * The viewport bounding box of the polyline.
+   * 
+ * + * .google.geo.type.Viewport viewport = 8; + */ + com.google.geo.type.ViewportOrBuilder getViewportOrBuilder(); + + /** + * + * + *
+   * Additional information about the route.
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + * + * @return Whether the travelAdvisory field is set. + */ + boolean hasTravelAdvisory(); + /** + * + * + *
+   * Additional information about the route.
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + * + * @return The travelAdvisory. + */ + com.google.maps.routing.v2.RouteTravelAdvisory getTravelAdvisory(); + /** + * + * + *
+   * Additional information about the route.
+   * 
+ * + * .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9; + */ + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder(); + + /** + * + * + *
+   * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+   * which allows the Navigation SDK to reconstruct the route during navigation,
+   * and in the event of rerouting honor the original intention when Routes
+   * ComputeRoutes is called. Customers should treat this token as an
+   * opaque blob.
+   * 
+ * + * string route_token = 12; + * + * @return The routeToken. + */ + java.lang.String getRouteToken(); + /** + * + * + *
+   * Web-safe base64 encoded route token that can be passed to NavigationSDK,
+   * which allows the Navigation SDK to reconstruct the route during navigation,
+   * and in the event of rerouting honor the original intention when Routes
+   * ComputeRoutes is called. Customers should treat this token as an
+   * opaque blob.
+   * 
+ * + * string route_token = 12; + * + * @return The bytes for routeToken. + */ + com.google.protobuf.ByteString getRouteTokenBytes(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteProto.java new file mode 100644 index 000000000000..8fb18903f5a6 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteProto.java @@ -0,0 +1,219 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public final class RouteProto { + private RouteProto() {} + + 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_routing_v2_Route_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_Route_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteTravelAdvisory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteTravelAdvisory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteLeg_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteLeg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteLegStep_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteLegStep_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\"google/maps/routing/v2/route.proto\022\026go" + + "ogle.maps.routing.v2\032\036google/geo/type/vi" + + "ewport.proto\032%google/maps/routing/v2/loc" + + "ation.proto\0323google/maps/routing/v2/navi" + + "gation_instruction.proto\032%google/maps/ro" + + "uting/v2/polyline.proto\032(google/maps/rou" + + "ting/v2/route_label.proto\0323google/maps/r" + + "outing/v2/speed_reading_interval.proto\032&" + + "google/maps/routing/v2/toll_info.proto\032\036" + + "google/protobuf/duration.proto\"\316\003\n\005Route" + + "\0228\n\014route_labels\030\r \003(\0162\".google.maps.rou" + + "ting.v2.RouteLabel\022.\n\004legs\030\001 \003(\0132 .googl" + + "e.maps.routing.v2.RouteLeg\022\027\n\017distance_m" + + "eters\030\002 \001(\005\022+\n\010duration\030\003 \001(\0132\031.google.p" + + "rotobuf.Duration\0222\n\017static_duration\030\004 \001(" + + "\0132\031.google.protobuf.Duration\0222\n\010polyline" + + "\030\005 \001(\0132 .google.maps.routing.v2.Polyline" + + "\022\023\n\013description\030\006 \001(\t\022\020\n\010warnings\030\007 \003(\t\022" + + "+\n\010viewport\030\010 \001(\0132\031.google.geo.type.View" + + "port\022D\n\017travel_advisory\030\t \001(\0132+.google.m" + + "aps.routing.v2.RouteTravelAdvisory\022\023\n\013ro" + + "ute_token\030\014 \001(\t\"\277\001\n\023RouteTravelAdvisory\022" + + "3\n\ttoll_info\030\002 \001(\0132 .google.maps.routing" + + ".v2.TollInfo\022M\n\027speed_reading_intervals\030" + + "\003 \003(\0132,.google.maps.routing.v2.SpeedRead" + + "ingInterval\022$\n\034fuel_consumption_microlit" + + "ers\030\005 \001(\003\"\234\001\n\026RouteLegTravelAdvisory\0223\n\t" + + "toll_info\030\001 \001(\0132 .google.maps.routing.v2" + + ".TollInfo\022M\n\027speed_reading_intervals\030\002 \003" + + "(\0132,.google.maps.routing.v2.SpeedReading" + + "Interval\"k\n\032RouteLegStepTravelAdvisory\022M" + + "\n\027speed_reading_intervals\030\001 \003(\0132,.google" + + ".maps.routing.v2.SpeedReadingInterval\"\250\003" + + "\n\010RouteLeg\022\027\n\017distance_meters\030\001 \001(\005\022+\n\010d" + + "uration\030\002 \001(\0132\031.google.protobuf.Duration" + + "\0222\n\017static_duration\030\003 \001(\0132\031.google.proto" + + "buf.Duration\0222\n\010polyline\030\004 \001(\0132 .google." + + "maps.routing.v2.Polyline\0228\n\016start_locati" + + "on\030\005 \001(\0132 .google.maps.routing.v2.Locati" + + "on\0226\n\014end_location\030\006 \001(\0132 .google.maps.r" + + "outing.v2.Location\0223\n\005steps\030\007 \003(\0132$.goog" + + "le.maps.routing.v2.RouteLegStep\022G\n\017trave" + + "l_advisory\030\010 \001(\0132..google.maps.routing.v" + + "2.RouteLegTravelAdvisory\"\235\003\n\014RouteLegSte" + + "p\022\027\n\017distance_meters\030\001 \001(\005\0222\n\017static_dur" + + "ation\030\002 \001(\0132\031.google.protobuf.Duration\0222" + + "\n\010polyline\030\003 \001(\0132 .google.maps.routing.v" + + "2.Polyline\0228\n\016start_location\030\004 \001(\0132 .goo" + + "gle.maps.routing.v2.Location\0226\n\014end_loca" + + "tion\030\005 \001(\0132 .google.maps.routing.v2.Loca" + + "tion\022M\n\026navigation_instruction\030\006 \001(\0132-.g" + + "oogle.maps.routing.v2.NavigationInstruct" + + "ion\022K\n\017travel_advisory\030\007 \001(\01322.google.ma" + + "ps.routing.v2.RouteLegStepTravelAdvisory" + + "B\302\001\n\032com.google.maps.routing.v2B\nRoutePr" + + "otoP\001Z=google.golang.org/genproto/google" + + "apis/maps/routing/v2;routing\370\001\001\242\002\005GMRV2\252" + + "\002\026Google.Maps.Routing.V2\312\002\026Google\\Maps\\R" + + "outing\\V2\352\002\031Google::Maps::Routing::V2b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.geo.type.ViewportProto.getDescriptor(), + com.google.maps.routing.v2.LocationProto.getDescriptor(), + com.google.maps.routing.v2.NavigationInstructionProto.getDescriptor(), + com.google.maps.routing.v2.PolylineProto.getDescriptor(), + com.google.maps.routing.v2.RouteLabelProto.getDescriptor(), + com.google.maps.routing.v2.SpeedReadingIntervalProto.getDescriptor(), + com.google.maps.routing.v2.TollInfoProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_Route_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_Route_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_Route_descriptor, + new java.lang.String[] { + "RouteLabels", + "Legs", + "DistanceMeters", + "Duration", + "StaticDuration", + "Polyline", + "Description", + "Warnings", + "Viewport", + "TravelAdvisory", + "RouteToken", + }); + internal_static_google_maps_routing_v2_RouteTravelAdvisory_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_maps_routing_v2_RouteTravelAdvisory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteTravelAdvisory_descriptor, + new java.lang.String[] { + "TollInfo", "SpeedReadingIntervals", "FuelConsumptionMicroliters", + }); + internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteLegTravelAdvisory_descriptor, + new java.lang.String[] { + "TollInfo", "SpeedReadingIntervals", + }); + internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteLegStepTravelAdvisory_descriptor, + new java.lang.String[] { + "SpeedReadingIntervals", + }); + internal_static_google_maps_routing_v2_RouteLeg_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_maps_routing_v2_RouteLeg_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteLeg_descriptor, + new java.lang.String[] { + "DistanceMeters", + "Duration", + "StaticDuration", + "Polyline", + "StartLocation", + "EndLocation", + "Steps", + "TravelAdvisory", + }); + internal_static_google_maps_routing_v2_RouteLegStep_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_maps_routing_v2_RouteLegStep_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteLegStep_descriptor, + new java.lang.String[] { + "DistanceMeters", + "StaticDuration", + "Polyline", + "StartLocation", + "EndLocation", + "NavigationInstruction", + "TravelAdvisory", + }); + com.google.geo.type.ViewportProto.getDescriptor(); + com.google.maps.routing.v2.LocationProto.getDescriptor(); + com.google.maps.routing.v2.NavigationInstructionProto.getDescriptor(); + com.google.maps.routing.v2.PolylineProto.getDescriptor(); + com.google.maps.routing.v2.RouteLabelProto.getDescriptor(); + com.google.maps.routing.v2.SpeedReadingIntervalProto.getDescriptor(); + com.google.maps.routing.v2.TollInfoProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelAdvisory.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelAdvisory.java new file mode 100644 index 000000000000..1c2d5e85a3da --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelAdvisory.java @@ -0,0 +1,1529 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates the additional information that the user should be informed
+ * about, such as possible traffic zone restriction etc.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteTravelAdvisory} + */ +public final class RouteTravelAdvisory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.RouteTravelAdvisory) + RouteTravelAdvisoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouteTravelAdvisory.newBuilder() to construct. + private RouteTravelAdvisory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouteTravelAdvisory() { + speedReadingIntervals_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouteTravelAdvisory(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteTravelAdvisory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteTravelAdvisory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteTravelAdvisory.class, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder.class); + } + + public static final int TOLL_INFO_FIELD_NUMBER = 2; + private com.google.maps.routing.v2.TollInfo tollInfo_; + /** + * + * + *
+   * Encapsulates information about tolls on the Route.
+   * This field is only populated if we expect there are tolls on the Route.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field is not set, then we expect there is no toll on the Route.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + * + * @return Whether the tollInfo field is set. + */ + @java.lang.Override + public boolean hasTollInfo() { + return tollInfo_ != null; + } + /** + * + * + *
+   * Encapsulates information about tolls on the Route.
+   * This field is only populated if we expect there are tolls on the Route.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field is not set, then we expect there is no toll on the Route.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + * + * @return The tollInfo. + */ + @java.lang.Override + public com.google.maps.routing.v2.TollInfo getTollInfo() { + return tollInfo_ == null ? com.google.maps.routing.v2.TollInfo.getDefaultInstance() : tollInfo_; + } + /** + * + * + *
+   * Encapsulates information about tolls on the Route.
+   * This field is only populated if we expect there are tolls on the Route.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field is not set, then we expect there is no toll on the Route.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + @java.lang.Override + public com.google.maps.routing.v2.TollInfoOrBuilder getTollInfoOrBuilder() { + return getTollInfo(); + } + + public static final int SPEED_READING_INTERVALS_FIELD_NUMBER = 3; + private java.util.List speedReadingIntervals_; + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + @java.lang.Override + public java.util.List + getSpeedReadingIntervalsList() { + return speedReadingIntervals_; + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + @java.lang.Override + public java.util.List + getSpeedReadingIntervalsOrBuilderList() { + return speedReadingIntervals_; + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + @java.lang.Override + public int getSpeedReadingIntervalsCount() { + return speedReadingIntervals_.size(); + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index) { + return speedReadingIntervals_.get(index); + } + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder getSpeedReadingIntervalsOrBuilder( + int index) { + return speedReadingIntervals_.get(index); + } + + public static final int FUEL_CONSUMPTION_MICROLITERS_FIELD_NUMBER = 5; + private long fuelConsumptionMicroliters_; + /** + * + * + *
+   * The fuel consumption prediction in microliters.
+   * 
+ * + * int64 fuel_consumption_microliters = 5; + * + * @return The fuelConsumptionMicroliters. + */ + @java.lang.Override + public long getFuelConsumptionMicroliters() { + return fuelConsumptionMicroliters_; + } + + 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 (tollInfo_ != null) { + output.writeMessage(2, getTollInfo()); + } + for (int i = 0; i < speedReadingIntervals_.size(); i++) { + output.writeMessage(3, speedReadingIntervals_.get(i)); + } + if (fuelConsumptionMicroliters_ != 0L) { + output.writeInt64(5, fuelConsumptionMicroliters_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tollInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTollInfo()); + } + for (int i = 0; i < speedReadingIntervals_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, speedReadingIntervals_.get(i)); + } + if (fuelConsumptionMicroliters_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size(5, fuelConsumptionMicroliters_); + } + 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.routing.v2.RouteTravelAdvisory)) { + return super.equals(obj); + } + com.google.maps.routing.v2.RouteTravelAdvisory other = + (com.google.maps.routing.v2.RouteTravelAdvisory) obj; + + if (hasTollInfo() != other.hasTollInfo()) return false; + if (hasTollInfo()) { + if (!getTollInfo().equals(other.getTollInfo())) return false; + } + if (!getSpeedReadingIntervalsList().equals(other.getSpeedReadingIntervalsList())) return false; + if (getFuelConsumptionMicroliters() != other.getFuelConsumptionMicroliters()) 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 (hasTollInfo()) { + hash = (37 * hash) + TOLL_INFO_FIELD_NUMBER; + hash = (53 * hash) + getTollInfo().hashCode(); + } + if (getSpeedReadingIntervalsCount() > 0) { + hash = (37 * hash) + SPEED_READING_INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getSpeedReadingIntervalsList().hashCode(); + } + hash = (37 * hash) + FUEL_CONSUMPTION_MICROLITERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFuelConsumptionMicroliters()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory 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.routing.v2.RouteTravelAdvisory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory 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.routing.v2.RouteTravelAdvisory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory 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.routing.v2.RouteTravelAdvisory parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory 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.routing.v2.RouteTravelAdvisory parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory 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.routing.v2.RouteTravelAdvisory 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 the additional information that the user should be informed
+   * about, such as possible traffic zone restriction etc.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.RouteTravelAdvisory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.RouteTravelAdvisory) + com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteTravelAdvisory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteTravelAdvisory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.RouteTravelAdvisory.class, + com.google.maps.routing.v2.RouteTravelAdvisory.Builder.class); + } + + // Construct using com.google.maps.routing.v2.RouteTravelAdvisory.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tollInfoBuilder_ == null) { + tollInfo_ = null; + } else { + tollInfo_ = null; + tollInfoBuilder_ = null; + } + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervals_ = java.util.Collections.emptyList(); + } else { + speedReadingIntervals_ = null; + speedReadingIntervalsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + fuelConsumptionMicroliters_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.RouteProto + .internal_static_google_maps_routing_v2_RouteTravelAdvisory_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisory getDefaultInstanceForType() { + return com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisory build() { + com.google.maps.routing.v2.RouteTravelAdvisory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.RouteTravelAdvisory buildPartial() { + com.google.maps.routing.v2.RouteTravelAdvisory result = + new com.google.maps.routing.v2.RouteTravelAdvisory(this); + int from_bitField0_ = bitField0_; + if (tollInfoBuilder_ == null) { + result.tollInfo_ = tollInfo_; + } else { + result.tollInfo_ = tollInfoBuilder_.build(); + } + if (speedReadingIntervalsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + speedReadingIntervals_ = java.util.Collections.unmodifiableList(speedReadingIntervals_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.speedReadingIntervals_ = speedReadingIntervals_; + } else { + result.speedReadingIntervals_ = speedReadingIntervalsBuilder_.build(); + } + result.fuelConsumptionMicroliters_ = fuelConsumptionMicroliters_; + 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.routing.v2.RouteTravelAdvisory) { + return mergeFrom((com.google.maps.routing.v2.RouteTravelAdvisory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.RouteTravelAdvisory other) { + if (other == com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance()) return this; + if (other.hasTollInfo()) { + mergeTollInfo(other.getTollInfo()); + } + if (speedReadingIntervalsBuilder_ == null) { + if (!other.speedReadingIntervals_.isEmpty()) { + if (speedReadingIntervals_.isEmpty()) { + speedReadingIntervals_ = other.speedReadingIntervals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.addAll(other.speedReadingIntervals_); + } + onChanged(); + } + } else { + if (!other.speedReadingIntervals_.isEmpty()) { + if (speedReadingIntervalsBuilder_.isEmpty()) { + speedReadingIntervalsBuilder_.dispose(); + speedReadingIntervalsBuilder_ = null; + speedReadingIntervals_ = other.speedReadingIntervals_; + bitField0_ = (bitField0_ & ~0x00000001); + speedReadingIntervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpeedReadingIntervalsFieldBuilder() + : null; + } else { + speedReadingIntervalsBuilder_.addAllMessages(other.speedReadingIntervals_); + } + } + } + if (other.getFuelConsumptionMicroliters() != 0L) { + setFuelConsumptionMicroliters(other.getFuelConsumptionMicroliters()); + } + 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 18: + { + input.readMessage(getTollInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + com.google.maps.routing.v2.SpeedReadingInterval m = + input.readMessage( + com.google.maps.routing.v2.SpeedReadingInterval.parser(), + extensionRegistry); + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(m); + } else { + speedReadingIntervalsBuilder_.addMessage(m); + } + break; + } // case 26 + case 40: + { + fuelConsumptionMicroliters_ = input.readInt64(); + + break; + } // case 40 + 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.routing.v2.TollInfo tollInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.TollInfo, + com.google.maps.routing.v2.TollInfo.Builder, + com.google.maps.routing.v2.TollInfoOrBuilder> + tollInfoBuilder_; + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + * + * @return Whether the tollInfo field is set. + */ + public boolean hasTollInfo() { + return tollInfoBuilder_ != null || tollInfo_ != null; + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + * + * @return The tollInfo. + */ + public com.google.maps.routing.v2.TollInfo getTollInfo() { + if (tollInfoBuilder_ == null) { + return tollInfo_ == null + ? com.google.maps.routing.v2.TollInfo.getDefaultInstance() + : tollInfo_; + } else { + return tollInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + public Builder setTollInfo(com.google.maps.routing.v2.TollInfo value) { + if (tollInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tollInfo_ = value; + onChanged(); + } else { + tollInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + public Builder setTollInfo(com.google.maps.routing.v2.TollInfo.Builder builderForValue) { + if (tollInfoBuilder_ == null) { + tollInfo_ = builderForValue.build(); + onChanged(); + } else { + tollInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + public Builder mergeTollInfo(com.google.maps.routing.v2.TollInfo value) { + if (tollInfoBuilder_ == null) { + if (tollInfo_ != null) { + tollInfo_ = + com.google.maps.routing.v2.TollInfo.newBuilder(tollInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + tollInfo_ = value; + } + onChanged(); + } else { + tollInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + public Builder clearTollInfo() { + if (tollInfoBuilder_ == null) { + tollInfo_ = null; + onChanged(); + } else { + tollInfo_ = null; + tollInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + public com.google.maps.routing.v2.TollInfo.Builder getTollInfoBuilder() { + + onChanged(); + return getTollInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + public com.google.maps.routing.v2.TollInfoOrBuilder getTollInfoOrBuilder() { + if (tollInfoBuilder_ != null) { + return tollInfoBuilder_.getMessageOrBuilder(); + } else { + return tollInfo_ == null + ? com.google.maps.routing.v2.TollInfo.getDefaultInstance() + : tollInfo_; + } + } + /** + * + * + *
+     * Encapsulates information about tolls on the Route.
+     * This field is only populated if we expect there are tolls on the Route.
+     * If this field is set but the estimated_price subfield is not populated,
+     * we expect that road contains tolls but we do not know an estimated price.
+     * If this field is not set, then we expect there is no toll on the Route.
+     * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.TollInfo, + com.google.maps.routing.v2.TollInfo.Builder, + com.google.maps.routing.v2.TollInfoOrBuilder> + getTollInfoFieldBuilder() { + if (tollInfoBuilder_ == null) { + tollInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.TollInfo, + com.google.maps.routing.v2.TollInfo.Builder, + com.google.maps.routing.v2.TollInfoOrBuilder>( + getTollInfo(), getParentForChildren(), isClean()); + tollInfo_ = null; + } + return tollInfoBuilder_; + } + + private java.util.List speedReadingIntervals_ = + java.util.Collections.emptyList(); + + private void ensureSpeedReadingIntervalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + speedReadingIntervals_ = + new java.util.ArrayList( + speedReadingIntervals_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder> + speedReadingIntervalsBuilder_; + + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public java.util.List + getSpeedReadingIntervalsList() { + if (speedReadingIntervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(speedReadingIntervals_); + } else { + return speedReadingIntervalsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public int getSpeedReadingIntervalsCount() { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.size(); + } else { + return speedReadingIntervalsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index) { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.get(index); + } else { + return speedReadingIntervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder setSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.set(index, value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder setSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.set(index, builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder addSpeedReadingIntervals(com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder addSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval value) { + if (speedReadingIntervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(index, value); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder addSpeedReadingIntervals( + com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder addSpeedReadingIntervals( + int index, com.google.maps.routing.v2.SpeedReadingInterval.Builder builderForValue) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.add(index, builderForValue.build()); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder addAllSpeedReadingIntervals( + java.lang.Iterable values) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, speedReadingIntervals_); + onChanged(); + } else { + speedReadingIntervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder clearSpeedReadingIntervals() { + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + speedReadingIntervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public Builder removeSpeedReadingIntervals(int index) { + if (speedReadingIntervalsBuilder_ == null) { + ensureSpeedReadingIntervalsIsMutable(); + speedReadingIntervals_.remove(index); + onChanged(); + } else { + speedReadingIntervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder getSpeedReadingIntervalsBuilder( + int index) { + return getSpeedReadingIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder + getSpeedReadingIntervalsOrBuilder(int index) { + if (speedReadingIntervalsBuilder_ == null) { + return speedReadingIntervals_.get(index); + } else { + return speedReadingIntervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public java.util.List + getSpeedReadingIntervalsOrBuilderList() { + if (speedReadingIntervalsBuilder_ != null) { + return speedReadingIntervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(speedReadingIntervals_); + } + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder + addSpeedReadingIntervalsBuilder() { + return getSpeedReadingIntervalsFieldBuilder() + .addBuilder(com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public com.google.maps.routing.v2.SpeedReadingInterval.Builder addSpeedReadingIntervalsBuilder( + int index) { + return getSpeedReadingIntervalsFieldBuilder() + .addBuilder(index, com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()); + } + /** + * + * + *
+     * Speed reading intervals detailing traffic density. Applicable in case of
+     * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+     * The intervals cover the entire polyline of the route without overlap.
+     * The start point of a specified interval is the same as the end point of the
+     * preceding interval.
+     * Example:
+     *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+     *     speed_reading_intervals: [A,C), [C,D), [D,G).
+     * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + * + */ + public java.util.List + getSpeedReadingIntervalsBuilderList() { + return getSpeedReadingIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder> + getSpeedReadingIntervalsFieldBuilder() { + if (speedReadingIntervalsBuilder_ == null) { + speedReadingIntervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.routing.v2.SpeedReadingInterval, + com.google.maps.routing.v2.SpeedReadingInterval.Builder, + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder>( + speedReadingIntervals_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + speedReadingIntervals_ = null; + } + return speedReadingIntervalsBuilder_; + } + + private long fuelConsumptionMicroliters_; + /** + * + * + *
+     * The fuel consumption prediction in microliters.
+     * 
+ * + * int64 fuel_consumption_microliters = 5; + * + * @return The fuelConsumptionMicroliters. + */ + @java.lang.Override + public long getFuelConsumptionMicroliters() { + return fuelConsumptionMicroliters_; + } + /** + * + * + *
+     * The fuel consumption prediction in microliters.
+     * 
+ * + * int64 fuel_consumption_microliters = 5; + * + * @param value The fuelConsumptionMicroliters to set. + * @return This builder for chaining. + */ + public Builder setFuelConsumptionMicroliters(long value) { + + fuelConsumptionMicroliters_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The fuel consumption prediction in microliters.
+     * 
+ * + * int64 fuel_consumption_microliters = 5; + * + * @return This builder for chaining. + */ + public Builder clearFuelConsumptionMicroliters() { + + fuelConsumptionMicroliters_ = 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.routing.v2.RouteTravelAdvisory) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.RouteTravelAdvisory) + private static final com.google.maps.routing.v2.RouteTravelAdvisory DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.RouteTravelAdvisory(); + } + + public static com.google.maps.routing.v2.RouteTravelAdvisory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouteTravelAdvisory 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.routing.v2.RouteTravelAdvisory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelAdvisoryOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelAdvisoryOrBuilder.java new file mode 100644 index 000000000000..ccaea0896cfd --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelAdvisoryOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2020 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/routing/v2/route.proto + +package com.google.maps.routing.v2; + +public interface RouteTravelAdvisoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.RouteTravelAdvisory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Encapsulates information about tolls on the Route.
+   * This field is only populated if we expect there are tolls on the Route.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field is not set, then we expect there is no toll on the Route.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + * + * @return Whether the tollInfo field is set. + */ + boolean hasTollInfo(); + /** + * + * + *
+   * Encapsulates information about tolls on the Route.
+   * This field is only populated if we expect there are tolls on the Route.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field is not set, then we expect there is no toll on the Route.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + * + * @return The tollInfo. + */ + com.google.maps.routing.v2.TollInfo getTollInfo(); + /** + * + * + *
+   * Encapsulates information about tolls on the Route.
+   * This field is only populated if we expect there are tolls on the Route.
+   * If this field is set but the estimated_price subfield is not populated,
+   * we expect that road contains tolls but we do not know an estimated price.
+   * If this field is not set, then we expect there is no toll on the Route.
+   * 
+ * + * .google.maps.routing.v2.TollInfo toll_info = 2; + */ + com.google.maps.routing.v2.TollInfoOrBuilder getTollInfoOrBuilder(); + + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + java.util.List getSpeedReadingIntervalsList(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + com.google.maps.routing.v2.SpeedReadingInterval getSpeedReadingIntervals(int index); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + int getSpeedReadingIntervalsCount(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + java.util.List + getSpeedReadingIntervalsOrBuilderList(); + /** + * + * + *
+   * Speed reading intervals detailing traffic density. Applicable in case of
+   * `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
+   * The intervals cover the entire polyline of the route without overlap.
+   * The start point of a specified interval is the same as the end point of the
+   * preceding interval.
+   * Example:
+   *     polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
+   *     speed_reading_intervals: [A,C), [C,D), [D,G).
+   * 
+ * + * repeated .google.maps.routing.v2.SpeedReadingInterval speed_reading_intervals = 3; + */ + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder getSpeedReadingIntervalsOrBuilder( + int index); + + /** + * + * + *
+   * The fuel consumption prediction in microliters.
+   * 
+ * + * int64 fuel_consumption_microliters = 5; + * + * @return The fuelConsumptionMicroliters. + */ + long getFuelConsumptionMicroliters(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelMode.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelMode.java new file mode 100644 index 000000000000..b405e143175b --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelMode.java @@ -0,0 +1,222 @@ +/* + * Copyright 2020 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/routing/v2/route_travel_mode.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A set of values used to specify the mode of travel.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.RouteTravelMode} + */ +public enum RouteTravelMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No travel mode specified. Defaults to `DRIVE`.
+   * 
+ * + * TRAVEL_MODE_UNSPECIFIED = 0; + */ + TRAVEL_MODE_UNSPECIFIED(0), + /** + * + * + *
+   * Travel by passenger car.
+   * 
+ * + * DRIVE = 1; + */ + DRIVE(1), + /** + * + * + *
+   * Travel by bicycle.
+   * 
+ * + * BICYCLE = 2; + */ + BICYCLE(2), + /** + * + * + *
+   * Travel by walking.
+   * 
+ * + * WALK = 3; + */ + WALK(3), + /** + * + * + *
+   * Two-wheeled, motorized vehicle. For example, motorcycle. Note that this
+   * differs from the `BICYCLE` travel mode which covers human-powered mode.
+   * 
+ * + * TWO_WHEELER = 4; + */ + TWO_WHEELER(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No travel mode specified. Defaults to `DRIVE`.
+   * 
+ * + * TRAVEL_MODE_UNSPECIFIED = 0; + */ + public static final int TRAVEL_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Travel by passenger car.
+   * 
+ * + * DRIVE = 1; + */ + public static final int DRIVE_VALUE = 1; + /** + * + * + *
+   * Travel by bicycle.
+   * 
+ * + * BICYCLE = 2; + */ + public static final int BICYCLE_VALUE = 2; + /** + * + * + *
+   * Travel by walking.
+   * 
+ * + * WALK = 3; + */ + public static final int WALK_VALUE = 3; + /** + * + * + *
+   * Two-wheeled, motorized vehicle. For example, motorcycle. Note that this
+   * differs from the `BICYCLE` travel mode which covers human-powered mode.
+   * 
+ * + * TWO_WHEELER = 4; + */ + public static final int TWO_WHEELER_VALUE = 4; + + 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 RouteTravelMode 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 RouteTravelMode forNumber(int value) { + switch (value) { + case 0: + return TRAVEL_MODE_UNSPECIFIED; + case 1: + return DRIVE; + case 2: + return BICYCLE; + case 3: + return WALK; + case 4: + return TWO_WHEELER; + 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 RouteTravelMode findValueByNumber(int number) { + return RouteTravelMode.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.routing.v2.RouteTravelModeProto.getDescriptor().getEnumTypes().get(0); + } + + private static final RouteTravelMode[] VALUES = values(); + + public static RouteTravelMode 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 RouteTravelMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.RouteTravelMode) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelModeProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelModeProto.java new file mode 100644 index 000000000000..aef7e626a506 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RouteTravelModeProto.java @@ -0,0 +1,55 @@ +/* + * Copyright 2020 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/routing/v2/route_travel_mode.proto + +package com.google.maps.routing.v2; + +public final class RouteTravelModeProto { + private RouteTravelModeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/maps/routing/v2/route_travel_mo" + + "de.proto\022\026google.maps.routing.v2*a\n\017Rout" + + "eTravelMode\022\033\n\027TRAVEL_MODE_UNSPECIFIED\020\000" + + "\022\t\n\005DRIVE\020\001\022\013\n\007BICYCLE\020\002\022\010\n\004WALK\020\003\022\017\n\013TW" + + "O_WHEELER\020\004B\314\001\n\032com.google.maps.routing." + + "v2B\024RouteTravelModeProtoP\001Z=google.golan" + + "g.org/genproto/googleapis/maps/routing/v" + + "2;routing\370\001\001\242\002\005GMRV2\252\002\026Google.Maps.Routi" + + "ng.V2\312\002\026Google\\Maps\\Routing\\V2\352\002\031Google:" + + ":Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutesServiceProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutesServiceProto.java new file mode 100644 index 000000000000..c849957989f0 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutesServiceProto.java @@ -0,0 +1,263 @@ +/* + * Copyright 2020 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/routing/v2/routes_service.proto + +package com.google.maps.routing.v2; + +public final class RoutesServiceProto { + private RoutesServiceProto() {} + + 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_routing_v2_ComputeRoutesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_ComputeRoutesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_ComputeRoutesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_ComputeRoutesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteMatrixOrigin_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteMatrixOrigin_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteMatrixDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteMatrixDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_routing_v2_RouteMatrixElement_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_RouteMatrixElement_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/maps/routing/v2/routes_service." + + "proto\022\026google.maps.routing.v2\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032*g" + + "oogle/maps/routing/v2/fallback_info.prot" + + "o\032%google/maps/routing/v2/polyline.proto" + + "\032\"google/maps/routing/v2/route.proto\032,go" + + "ogle/maps/routing/v2/route_modifiers.pro" + + "to\032.google/maps/routing/v2/route_travel_" + + "mode.proto\032/google/maps/routing/v2/routi" + + "ng_preference.proto\032\"google/maps/routing" + + "/v2/units.proto\032%google/maps/routing/v2/" + + "waypoint.proto\032\036google/protobuf/duration" + + ".proto\032\037google/protobuf/timestamp.proto\032" + + "\027google/rpc/status.proto\"\214\007\n\024ComputeRout" + + "esRequest\0225\n\006origin\030\001 \001(\0132 .google.maps." + + "routing.v2.WaypointB\003\340A\002\022:\n\013destination\030" + + "\002 \001(\0132 .google.maps.routing.v2.WaypointB" + + "\003\340A\002\022<\n\rintermediates\030\003 \003(\0132 .google.map" + + "s.routing.v2.WaypointB\003\340A\001\022A\n\013travel_mod" + + "e\030\004 \001(\0162\'.google.maps.routing.v2.RouteTr" + + "avelModeB\003\340A\001\022J\n\022routing_preference\030\005 \001(" + + "\0162).google.maps.routing.v2.RoutingPrefer" + + "enceB\003\340A\001\022F\n\020polyline_quality\030\006 \001(\0162\'.go" + + "ogle.maps.routing.v2.PolylineQualityB\003\340A" + + "\001\022H\n\021polyline_encoding\030\014 \001(\0162(.google.ma" + + "ps.routing.v2.PolylineEncodingB\003\340A\001\0227\n\016d" + + "eparture_time\030\007 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\001\022\'\n\032compute_alternative_rout" + + "es\030\010 \001(\010B\003\340A\001\022D\n\017route_modifiers\030\t \001(\0132&" + + ".google.maps.routing.v2.RouteModifiersB\003" + + "\340A\001\022\032\n\rlanguage_code\030\n \001(\tB\003\340A\001\0221\n\005units" + + "\030\013 \001(\0162\035.google.maps.routing.v2.UnitsB\003\340" + + "A\001\022d\n\032requested_reference_routes\030\016 \003(\0162;" + + ".google.maps.routing.v2.ComputeRoutesReq" + + "uest.ReferenceRouteB\003\340A\001\"E\n\016ReferenceRou" + + "te\022\037\n\033REFERENCE_ROUTE_UNSPECIFIED\020\000\022\022\n\016F" + + "UEL_EFFICIENT\020\001\"\203\001\n\025ComputeRoutesRespons" + + "e\022-\n\006routes\030\001 \003(\0132\035.google.maps.routing." + + "v2.Route\022;\n\rfallback_info\030\002 \001(\0132$.google" + + ".maps.routing.v2.FallbackInfo\"\357\002\n\031Comput" + + "eRouteMatrixRequest\022?\n\007origins\030\001 \003(\0132).g" + + "oogle.maps.routing.v2.RouteMatrixOriginB" + + "\003\340A\002\022I\n\014destinations\030\002 \003(\0132..google.maps" + + ".routing.v2.RouteMatrixDestinationB\003\340A\002\022" + + "A\n\013travel_mode\030\003 \001(\0162\'.google.maps.routi" + + "ng.v2.RouteTravelModeB\003\340A\001\022J\n\022routing_pr" + + "eference\030\004 \001(\0162).google.maps.routing.v2." + + "RoutingPreferenceB\003\340A\001\0227\n\016departure_time" + + "\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\001\"" + + "\222\001\n\021RouteMatrixOrigin\0227\n\010waypoint\030\001 \001(\0132" + + " .google.maps.routing.v2.WaypointB\003\340A\002\022D" + + "\n\017route_modifiers\030\002 \001(\0132&.google.maps.ro" + + "uting.v2.RouteModifiersB\003\340A\001\"Q\n\026RouteMat" + + "rixDestination\0227\n\010waypoint\030\001 \001(\0132 .googl" + + "e.maps.routing.v2.WaypointB\003\340A\002\"\337\003\n\022Rout" + + "eMatrixElement\022\031\n\014origin_index\030\001 \001(\005H\000\210\001" + + "\001\022\036\n\021destination_index\030\002 \001(\005H\001\210\001\001\022\"\n\006sta" + + "tus\030\003 \001(\0132\022.google.rpc.Status\022F\n\tconditi" + + "on\030\t \001(\01623.google.maps.routing.v2.RouteM" + + "atrixElementCondition\022\027\n\017distance_meters" + + "\030\004 \001(\005\022+\n\010duration\030\005 \001(\0132\031.google.protob" + + "uf.Duration\0222\n\017static_duration\030\006 \001(\0132\031.g" + + "oogle.protobuf.Duration\022D\n\017travel_adviso" + + "ry\030\007 \001(\0132+.google.maps.routing.v2.RouteT" + + "ravelAdvisory\022;\n\rfallback_info\030\010 \001(\0132$.g" + + "oogle.maps.routing.v2.FallbackInfoB\017\n\r_o" + + "rigin_indexB\024\n\022_destination_index*t\n\033Rou" + + "teMatrixElementCondition\022.\n*ROUTE_MATRIX" + + "_ELEMENT_CONDITION_UNSPECIFIED\020\000\022\020\n\014ROUT" + + "E_EXISTS\020\001\022\023\n\017ROUTE_NOT_FOUND\020\0022\344\002\n\006Rout" + + "es\022\225\001\n\rComputeRoutes\022,.google.maps.routi" + + "ng.v2.ComputeRoutesRequest\032-.google.maps" + + ".routing.v2.ComputeRoutesResponse\"\'\202\323\344\223\002" + + "!\"\034/directions/v2:computeRoutes:\001*\022\247\001\n\022C" + + "omputeRouteMatrix\0221.google.maps.routing." + + "v2.ComputeRouteMatrixRequest\032*.google.ma" + + "ps.routing.v2.RouteMatrixElement\"0\202\323\344\223\002*" + + "\"%/distanceMatrix/v2:computeRouteMatrix:" + + "\001*0\001\032\030\312A\025routes.googleapis.comB\312\001\n\032com.g" + + "oogle.maps.routing.v2B\022RoutesServiceProt" + + "oP\001Z=google.golang.org/genproto/googleap" + + "is/maps/routing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026" + + "Google.Maps.Routing.V2\312\002\026Google\\Maps\\Rou" + + "ting\\V2\352\002\031Google::Maps::Routing::V2b\006pro" + + "to3" + }; + 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.maps.routing.v2.FallbackInfoProto.getDescriptor(), + com.google.maps.routing.v2.PolylineProto.getDescriptor(), + com.google.maps.routing.v2.RouteProto.getDescriptor(), + com.google.maps.routing.v2.RouteModifiersProto.getDescriptor(), + com.google.maps.routing.v2.RouteTravelModeProto.getDescriptor(), + com.google.maps.routing.v2.RoutingPreferenceProto.getDescriptor(), + com.google.maps.routing.v2.UnitsProto.getDescriptor(), + com.google.maps.routing.v2.WaypointProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_ComputeRoutesRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_ComputeRoutesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_ComputeRoutesRequest_descriptor, + new java.lang.String[] { + "Origin", + "Destination", + "Intermediates", + "TravelMode", + "RoutingPreference", + "PolylineQuality", + "PolylineEncoding", + "DepartureTime", + "ComputeAlternativeRoutes", + "RouteModifiers", + "LanguageCode", + "Units", + "RequestedReferenceRoutes", + }); + internal_static_google_maps_routing_v2_ComputeRoutesResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_maps_routing_v2_ComputeRoutesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_ComputeRoutesResponse_descriptor, + new java.lang.String[] { + "Routes", "FallbackInfo", + }); + internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_ComputeRouteMatrixRequest_descriptor, + new java.lang.String[] { + "Origins", "Destinations", "TravelMode", "RoutingPreference", "DepartureTime", + }); + internal_static_google_maps_routing_v2_RouteMatrixOrigin_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_maps_routing_v2_RouteMatrixOrigin_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteMatrixOrigin_descriptor, + new java.lang.String[] { + "Waypoint", "RouteModifiers", + }); + internal_static_google_maps_routing_v2_RouteMatrixDestination_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_maps_routing_v2_RouteMatrixDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteMatrixDestination_descriptor, + new java.lang.String[] { + "Waypoint", + }); + internal_static_google_maps_routing_v2_RouteMatrixElement_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_maps_routing_v2_RouteMatrixElement_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_RouteMatrixElement_descriptor, + new java.lang.String[] { + "OriginIndex", + "DestinationIndex", + "Status", + "Condition", + "DistanceMeters", + "Duration", + "StaticDuration", + "TravelAdvisory", + "FallbackInfo", + "OriginIndex", + "DestinationIndex", + }); + 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); + 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.maps.routing.v2.FallbackInfoProto.getDescriptor(); + com.google.maps.routing.v2.PolylineProto.getDescriptor(); + com.google.maps.routing.v2.RouteProto.getDescriptor(); + com.google.maps.routing.v2.RouteModifiersProto.getDescriptor(); + com.google.maps.routing.v2.RouteTravelModeProto.getDescriptor(); + com.google.maps.routing.v2.RoutingPreferenceProto.getDescriptor(); + com.google.maps.routing.v2.UnitsProto.getDescriptor(); + com.google.maps.routing.v2.WaypointProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutingPreference.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutingPreference.java new file mode 100644 index 000000000000..c571bba8e83e --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutingPreference.java @@ -0,0 +1,225 @@ +/* + * Copyright 2020 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/routing/v2/routing_preference.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A set of values that specify factors to take into consideration when
+ * calculating the route.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.RoutingPreference} + */ +public enum RoutingPreference implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No routing preference specified. Default to `TRAFFIC_UNAWARE`.
+   * 
+ * + * ROUTING_PREFERENCE_UNSPECIFIED = 0; + */ + ROUTING_PREFERENCE_UNSPECIFIED(0), + /** + * + * + *
+   * Computes routes without taking live traffic conditions into consideration.
+   * Suitable when traffic conditions don't matter or are not applicable.
+   * Using this value produces the lowest latency.
+   * Note: For `RouteTravelMode` DRIVE and TWO_WHEELER choice of route and
+   * duration are based on road network and average time-independent traffic
+   * conditions. Results for a given request may vary over time due to changes
+   * in the road network, updated average traffic conditions, and the
+   * distributed nature of the service. Results may also vary between
+   * nearly-equivalent routes at any time or frequency.
+   * 
+ * + * TRAFFIC_UNAWARE = 1; + */ + TRAFFIC_UNAWARE(1), + /** + * + * + *
+   * Calculates routes taking live traffic conditions into consideration.
+   * In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to
+   * significantly reduce latency.
+   * 
+ * + * TRAFFIC_AWARE = 2; + */ + TRAFFIC_AWARE(2), + /** + * + * + *
+   * Calculates the routes taking live traffic conditions into consideration,
+   * without applying most performance optimizations. Using this value produces
+   * the highest latency.
+   * 
+ * + * TRAFFIC_AWARE_OPTIMAL = 3; + */ + TRAFFIC_AWARE_OPTIMAL(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No routing preference specified. Default to `TRAFFIC_UNAWARE`.
+   * 
+ * + * ROUTING_PREFERENCE_UNSPECIFIED = 0; + */ + public static final int ROUTING_PREFERENCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Computes routes without taking live traffic conditions into consideration.
+   * Suitable when traffic conditions don't matter or are not applicable.
+   * Using this value produces the lowest latency.
+   * Note: For `RouteTravelMode` DRIVE and TWO_WHEELER choice of route and
+   * duration are based on road network and average time-independent traffic
+   * conditions. Results for a given request may vary over time due to changes
+   * in the road network, updated average traffic conditions, and the
+   * distributed nature of the service. Results may also vary between
+   * nearly-equivalent routes at any time or frequency.
+   * 
+ * + * TRAFFIC_UNAWARE = 1; + */ + public static final int TRAFFIC_UNAWARE_VALUE = 1; + /** + * + * + *
+   * Calculates routes taking live traffic conditions into consideration.
+   * In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to
+   * significantly reduce latency.
+   * 
+ * + * TRAFFIC_AWARE = 2; + */ + public static final int TRAFFIC_AWARE_VALUE = 2; + /** + * + * + *
+   * Calculates the routes taking live traffic conditions into consideration,
+   * without applying most performance optimizations. Using this value produces
+   * the highest latency.
+   * 
+ * + * TRAFFIC_AWARE_OPTIMAL = 3; + */ + public static final int TRAFFIC_AWARE_OPTIMAL_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 RoutingPreference 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 RoutingPreference forNumber(int value) { + switch (value) { + case 0: + return ROUTING_PREFERENCE_UNSPECIFIED; + case 1: + return TRAFFIC_UNAWARE; + case 2: + return TRAFFIC_AWARE; + case 3: + return TRAFFIC_AWARE_OPTIMAL; + 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 RoutingPreference findValueByNumber(int number) { + return RoutingPreference.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.routing.v2.RoutingPreferenceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final RoutingPreference[] VALUES = values(); + + public static RoutingPreference 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 RoutingPreference(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.RoutingPreference) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutingPreferenceProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutingPreferenceProto.java new file mode 100644 index 000000000000..ff6abe39e2ae --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/RoutingPreferenceProto.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 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/routing/v2/routing_preference.proto + +package com.google.maps.routing.v2; + +public final class RoutingPreferenceProto { + private RoutingPreferenceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n/google/maps/routing/v2/routing_prefere" + + "nce.proto\022\026google.maps.routing.v2*z\n\021Rou" + + "tingPreference\022\"\n\036ROUTING_PREFERENCE_UNS" + + "PECIFIED\020\000\022\023\n\017TRAFFIC_UNAWARE\020\001\022\021\n\rTRAFF" + + "IC_AWARE\020\002\022\031\n\025TRAFFIC_AWARE_OPTIMAL\020\003B\316\001" + + "\n\032com.google.maps.routing.v2B\026RoutingPre" + + "ferenceProtoP\001Z=google.golang.org/genpro" + + "to/googleapis/maps/routing/v2;routing\370\001\001" + + "\242\002\005GMRV2\252\002\026Google.Maps.Routing.V2\312\002\026Goog" + + "le\\Maps\\Routing\\V2\352\002\031Google::Maps::Routi" + + "ng::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingInterval.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingInterval.java new file mode 100644 index 000000000000..b36867eb8892 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingInterval.java @@ -0,0 +1,1041 @@ +/* + * Copyright 2020 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/routing/v2/speed_reading_interval.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Traffic density indicator on a contiguous segment of a polyline or path.
+ * Given a path with points P_0, P_1, ... , P_N (zero-based index), the
+ * SpeedReadingInterval defines an interval and describes its traffic using the
+ * following categories.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.SpeedReadingInterval} + */ +public final class SpeedReadingInterval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.SpeedReadingInterval) + SpeedReadingIntervalOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpeedReadingInterval.newBuilder() to construct. + private SpeedReadingInterval(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpeedReadingInterval() { + speed_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpeedReadingInterval(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.SpeedReadingIntervalProto + .internal_static_google_maps_routing_v2_SpeedReadingInterval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.SpeedReadingIntervalProto + .internal_static_google_maps_routing_v2_SpeedReadingInterval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.SpeedReadingInterval.class, + com.google.maps.routing.v2.SpeedReadingInterval.Builder.class); + } + + /** + * + * + *
+   * The classification of polyline speed based on traffic data.
+   * 
+ * + * Protobuf enum {@code google.maps.routing.v2.SpeedReadingInterval.Speed} + */ + public enum Speed implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * SPEED_UNSPECIFIED = 0; + */ + SPEED_UNSPECIFIED(0), + /** + * + * + *
+     * Normal speed, no slowdown is detected.
+     * 
+ * + * NORMAL = 1; + */ + NORMAL(1), + /** + * + * + *
+     * Slowdown detected, but no traffic jam formed.
+     * 
+ * + * SLOW = 2; + */ + SLOW(2), + /** + * + * + *
+     * Traffic jam detected.
+     * 
+ * + * TRAFFIC_JAM = 3; + */ + TRAFFIC_JAM(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * SPEED_UNSPECIFIED = 0; + */ + public static final int SPEED_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Normal speed, no slowdown is detected.
+     * 
+ * + * NORMAL = 1; + */ + public static final int NORMAL_VALUE = 1; + /** + * + * + *
+     * Slowdown detected, but no traffic jam formed.
+     * 
+ * + * SLOW = 2; + */ + public static final int SLOW_VALUE = 2; + /** + * + * + *
+     * Traffic jam detected.
+     * 
+ * + * TRAFFIC_JAM = 3; + */ + public static final int TRAFFIC_JAM_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 Speed 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 Speed forNumber(int value) { + switch (value) { + case 0: + return SPEED_UNSPECIFIED; + case 1: + return NORMAL; + case 2: + return SLOW; + case 3: + return TRAFFIC_JAM; + 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 Speed findValueByNumber(int number) { + return Speed.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.routing.v2.SpeedReadingInterval.getDescriptor().getEnumTypes().get(0); + } + + private static final Speed[] VALUES = values(); + + public static Speed 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 Speed(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.SpeedReadingInterval.Speed) + } + + private int bitField0_; + public static final int START_POLYLINE_POINT_INDEX_FIELD_NUMBER = 1; + private int startPolylinePointIndex_; + /** + * + * + *
+   * The starting index of this interval in the polyline.
+   * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return Whether the startPolylinePointIndex field is set. + */ + @java.lang.Override + public boolean hasStartPolylinePointIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The starting index of this interval in the polyline.
+   * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return The startPolylinePointIndex. + */ + @java.lang.Override + public int getStartPolylinePointIndex() { + return startPolylinePointIndex_; + } + + public static final int END_POLYLINE_POINT_INDEX_FIELD_NUMBER = 2; + private int endPolylinePointIndex_; + /** + * + * + *
+   * The ending index of this interval in the polyline.
+   * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return Whether the endPolylinePointIndex field is set. + */ + @java.lang.Override + public boolean hasEndPolylinePointIndex() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The ending index of this interval in the polyline.
+   * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return The endPolylinePointIndex. + */ + @java.lang.Override + public int getEndPolylinePointIndex() { + return endPolylinePointIndex_; + } + + public static final int SPEED_FIELD_NUMBER = 3; + private int speed_; + /** + * + * + *
+   * Traffic speed in this interval.
+   * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return The enum numeric value on the wire for speed. + */ + @java.lang.Override + public int getSpeedValue() { + return speed_; + } + /** + * + * + *
+   * Traffic speed in this interval.
+   * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return The speed. + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval.Speed getSpeed() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.SpeedReadingInterval.Speed result = + com.google.maps.routing.v2.SpeedReadingInterval.Speed.valueOf(speed_); + return result == null + ? com.google.maps.routing.v2.SpeedReadingInterval.Speed.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, startPolylinePointIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, endPolylinePointIndex_); + } + if (speed_ + != com.google.maps.routing.v2.SpeedReadingInterval.Speed.SPEED_UNSPECIFIED.getNumber()) { + output.writeEnum(3, speed_); + } + 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, startPolylinePointIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, endPolylinePointIndex_); + } + if (speed_ + != com.google.maps.routing.v2.SpeedReadingInterval.Speed.SPEED_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, speed_); + } + 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.routing.v2.SpeedReadingInterval)) { + return super.equals(obj); + } + com.google.maps.routing.v2.SpeedReadingInterval other = + (com.google.maps.routing.v2.SpeedReadingInterval) obj; + + if (hasStartPolylinePointIndex() != other.hasStartPolylinePointIndex()) return false; + if (hasStartPolylinePointIndex()) { + if (getStartPolylinePointIndex() != other.getStartPolylinePointIndex()) return false; + } + if (hasEndPolylinePointIndex() != other.hasEndPolylinePointIndex()) return false; + if (hasEndPolylinePointIndex()) { + if (getEndPolylinePointIndex() != other.getEndPolylinePointIndex()) return false; + } + if (speed_ != other.speed_) 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 (hasStartPolylinePointIndex()) { + hash = (37 * hash) + START_POLYLINE_POINT_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getStartPolylinePointIndex(); + } + if (hasEndPolylinePointIndex()) { + hash = (37 * hash) + END_POLYLINE_POINT_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getEndPolylinePointIndex(); + } + hash = (37 * hash) + SPEED_FIELD_NUMBER; + hash = (53 * hash) + speed_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.SpeedReadingInterval parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval 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.routing.v2.SpeedReadingInterval parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval 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.routing.v2.SpeedReadingInterval parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval 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.routing.v2.SpeedReadingInterval parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval 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.routing.v2.SpeedReadingInterval parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval 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.routing.v2.SpeedReadingInterval 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; + } + /** + * + * + *
+   * Traffic density indicator on a contiguous segment of a polyline or path.
+   * Given a path with points P_0, P_1, ... , P_N (zero-based index), the
+   * SpeedReadingInterval defines an interval and describes its traffic using the
+   * following categories.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.SpeedReadingInterval} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.SpeedReadingInterval) + com.google.maps.routing.v2.SpeedReadingIntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.SpeedReadingIntervalProto + .internal_static_google_maps_routing_v2_SpeedReadingInterval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.SpeedReadingIntervalProto + .internal_static_google_maps_routing_v2_SpeedReadingInterval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.SpeedReadingInterval.class, + com.google.maps.routing.v2.SpeedReadingInterval.Builder.class); + } + + // Construct using com.google.maps.routing.v2.SpeedReadingInterval.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + startPolylinePointIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + endPolylinePointIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + speed_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.SpeedReadingIntervalProto + .internal_static_google_maps_routing_v2_SpeedReadingInterval_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval getDefaultInstanceForType() { + return com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval build() { + com.google.maps.routing.v2.SpeedReadingInterval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval buildPartial() { + com.google.maps.routing.v2.SpeedReadingInterval result = + new com.google.maps.routing.v2.SpeedReadingInterval(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startPolylinePointIndex_ = startPolylinePointIndex_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endPolylinePointIndex_ = endPolylinePointIndex_; + to_bitField0_ |= 0x00000002; + } + result.speed_ = speed_; + result.bitField0_ = to_bitField0_; + 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.routing.v2.SpeedReadingInterval) { + return mergeFrom((com.google.maps.routing.v2.SpeedReadingInterval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.SpeedReadingInterval other) { + if (other == com.google.maps.routing.v2.SpeedReadingInterval.getDefaultInstance()) + return this; + if (other.hasStartPolylinePointIndex()) { + setStartPolylinePointIndex(other.getStartPolylinePointIndex()); + } + if (other.hasEndPolylinePointIndex()) { + setEndPolylinePointIndex(other.getEndPolylinePointIndex()); + } + if (other.speed_ != 0) { + setSpeedValue(other.getSpeedValue()); + } + 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: + { + startPolylinePointIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + endPolylinePointIndex_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + speed_ = input.readEnum(); + + 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 startPolylinePointIndex_; + /** + * + * + *
+     * The starting index of this interval in the polyline.
+     * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return Whether the startPolylinePointIndex field is set. + */ + @java.lang.Override + public boolean hasStartPolylinePointIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The starting index of this interval in the polyline.
+     * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return The startPolylinePointIndex. + */ + @java.lang.Override + public int getStartPolylinePointIndex() { + return startPolylinePointIndex_; + } + /** + * + * + *
+     * The starting index of this interval in the polyline.
+     * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @param value The startPolylinePointIndex to set. + * @return This builder for chaining. + */ + public Builder setStartPolylinePointIndex(int value) { + bitField0_ |= 0x00000001; + startPolylinePointIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting index of this interval in the polyline.
+     * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartPolylinePointIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + startPolylinePointIndex_ = 0; + onChanged(); + return this; + } + + private int endPolylinePointIndex_; + /** + * + * + *
+     * The ending index of this interval in the polyline.
+     * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return Whether the endPolylinePointIndex field is set. + */ + @java.lang.Override + public boolean hasEndPolylinePointIndex() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The ending index of this interval in the polyline.
+     * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return The endPolylinePointIndex. + */ + @java.lang.Override + public int getEndPolylinePointIndex() { + return endPolylinePointIndex_; + } + /** + * + * + *
+     * The ending index of this interval in the polyline.
+     * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @param value The endPolylinePointIndex to set. + * @return This builder for chaining. + */ + public Builder setEndPolylinePointIndex(int value) { + bitField0_ |= 0x00000002; + endPolylinePointIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ending index of this interval in the polyline.
+     * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndPolylinePointIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + endPolylinePointIndex_ = 0; + onChanged(); + return this; + } + + private int speed_ = 0; + /** + * + * + *
+     * Traffic speed in this interval.
+     * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return The enum numeric value on the wire for speed. + */ + @java.lang.Override + public int getSpeedValue() { + return speed_; + } + /** + * + * + *
+     * Traffic speed in this interval.
+     * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @param value The enum numeric value on the wire for speed to set. + * @return This builder for chaining. + */ + public Builder setSpeedValue(int value) { + + speed_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Traffic speed in this interval.
+     * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return The speed. + */ + @java.lang.Override + public com.google.maps.routing.v2.SpeedReadingInterval.Speed getSpeed() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.SpeedReadingInterval.Speed result = + com.google.maps.routing.v2.SpeedReadingInterval.Speed.valueOf(speed_); + return result == null + ? com.google.maps.routing.v2.SpeedReadingInterval.Speed.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Traffic speed in this interval.
+     * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @param value The speed to set. + * @return This builder for chaining. + */ + public Builder setSpeed(com.google.maps.routing.v2.SpeedReadingInterval.Speed value) { + if (value == null) { + throw new NullPointerException(); + } + + speed_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Traffic speed in this interval.
+     * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return This builder for chaining. + */ + public Builder clearSpeed() { + + speed_ = 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.routing.v2.SpeedReadingInterval) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.SpeedReadingInterval) + private static final com.google.maps.routing.v2.SpeedReadingInterval DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.SpeedReadingInterval(); + } + + public static com.google.maps.routing.v2.SpeedReadingInterval getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeedReadingInterval 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.routing.v2.SpeedReadingInterval getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingIntervalOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingIntervalOrBuilder.java new file mode 100644 index 000000000000..df4bba08ee49 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingIntervalOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 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/routing/v2/speed_reading_interval.proto + +package com.google.maps.routing.v2; + +public interface SpeedReadingIntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.SpeedReadingInterval) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The starting index of this interval in the polyline.
+   * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return Whether the startPolylinePointIndex field is set. + */ + boolean hasStartPolylinePointIndex(); + /** + * + * + *
+   * The starting index of this interval in the polyline.
+   * 
+ * + * optional int32 start_polyline_point_index = 1; + * + * @return The startPolylinePointIndex. + */ + int getStartPolylinePointIndex(); + + /** + * + * + *
+   * The ending index of this interval in the polyline.
+   * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return Whether the endPolylinePointIndex field is set. + */ + boolean hasEndPolylinePointIndex(); + /** + * + * + *
+   * The ending index of this interval in the polyline.
+   * 
+ * + * optional int32 end_polyline_point_index = 2; + * + * @return The endPolylinePointIndex. + */ + int getEndPolylinePointIndex(); + + /** + * + * + *
+   * Traffic speed in this interval.
+   * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return The enum numeric value on the wire for speed. + */ + int getSpeedValue(); + /** + * + * + *
+   * Traffic speed in this interval.
+   * 
+ * + * .google.maps.routing.v2.SpeedReadingInterval.Speed speed = 3; + * + * @return The speed. + */ + com.google.maps.routing.v2.SpeedReadingInterval.Speed getSpeed(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingIntervalProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingIntervalProto.java new file mode 100644 index 000000000000..31094d5dcea0 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/SpeedReadingIntervalProto.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 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/routing/v2/speed_reading_interval.proto + +package com.google.maps.routing.v2; + +public final class SpeedReadingIntervalProto { + private SpeedReadingIntervalProto() {} + + 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_routing_v2_SpeedReadingInterval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_SpeedReadingInterval_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/maps/routing/v2/speed_reading_i" + + "nterval.proto\022\026google.maps.routing.v2\"\254\002" + + "\n\024SpeedReadingInterval\022\'\n\032start_polyline" + + "_point_index\030\001 \001(\005H\000\210\001\001\022%\n\030end_polyline_" + + "point_index\030\002 \001(\005H\001\210\001\001\022A\n\005speed\030\003 \001(\01622." + + "google.maps.routing.v2.SpeedReadingInter" + + "val.Speed\"E\n\005Speed\022\025\n\021SPEED_UNSPECIFIED\020" + + "\000\022\n\n\006NORMAL\020\001\022\010\n\004SLOW\020\002\022\017\n\013TRAFFIC_JAM\020\003" + + "B\035\n\033_start_polyline_point_indexB\033\n\031_end_" + + "polyline_point_indexB\321\001\n\032com.google.maps" + + ".routing.v2B\031SpeedReadingIntervalProtoP\001" + + "Z=google.golang.org/genproto/googleapis/" + + "maps/routing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Goo" + + "gle.Maps.Routing.V2\312\002\026Google\\Maps\\Routin" + + "g\\V2\352\002\031Google::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_maps_routing_v2_SpeedReadingInterval_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_SpeedReadingInterval_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_SpeedReadingInterval_descriptor, + new java.lang.String[] { + "StartPolylinePointIndex", + "EndPolylinePointIndex", + "Speed", + "StartPolylinePointIndex", + "EndPolylinePointIndex", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfo.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfo.java new file mode 100644 index 000000000000..371aea9216d3 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfo.java @@ -0,0 +1,1030 @@ +/* + * Copyright 2020 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/routing/v2/toll_info.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates toll information on a `Route` or on a `RouteLeg`.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.TollInfo} + */ +public final class TollInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.TollInfo) + TollInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use TollInfo.newBuilder() to construct. + private TollInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TollInfo() { + estimatedPrice_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TollInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.TollInfoProto + .internal_static_google_maps_routing_v2_TollInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.TollInfoProto + .internal_static_google_maps_routing_v2_TollInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.TollInfo.class, + com.google.maps.routing.v2.TollInfo.Builder.class); + } + + public static final int ESTIMATED_PRICE_FIELD_NUMBER = 1; + private java.util.List estimatedPrice_; + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + @java.lang.Override + public java.util.List getEstimatedPriceList() { + return estimatedPrice_; + } + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + @java.lang.Override + public java.util.List getEstimatedPriceOrBuilderList() { + return estimatedPrice_; + } + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + @java.lang.Override + public int getEstimatedPriceCount() { + return estimatedPrice_.size(); + } + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + @java.lang.Override + public com.google.type.Money getEstimatedPrice(int index) { + return estimatedPrice_.get(index); + } + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + @java.lang.Override + public com.google.type.MoneyOrBuilder getEstimatedPriceOrBuilder(int index) { + return estimatedPrice_.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 < estimatedPrice_.size(); i++) { + output.writeMessage(1, estimatedPrice_.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 < estimatedPrice_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, estimatedPrice_.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.routing.v2.TollInfo)) { + return super.equals(obj); + } + com.google.maps.routing.v2.TollInfo other = (com.google.maps.routing.v2.TollInfo) obj; + + if (!getEstimatedPriceList().equals(other.getEstimatedPriceList())) 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 (getEstimatedPriceCount() > 0) { + hash = (37 * hash) + ESTIMATED_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getEstimatedPriceList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.TollInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.TollInfo 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.routing.v2.TollInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.TollInfo 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.routing.v2.TollInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.TollInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.TollInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.TollInfo 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.routing.v2.TollInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.TollInfo 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.routing.v2.TollInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.TollInfo 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.routing.v2.TollInfo 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 toll information on a `Route` or on a `RouteLeg`.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.TollInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.TollInfo) + com.google.maps.routing.v2.TollInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.TollInfoProto + .internal_static_google_maps_routing_v2_TollInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.TollInfoProto + .internal_static_google_maps_routing_v2_TollInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.TollInfo.class, + com.google.maps.routing.v2.TollInfo.Builder.class); + } + + // Construct using com.google.maps.routing.v2.TollInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (estimatedPriceBuilder_ == null) { + estimatedPrice_ = java.util.Collections.emptyList(); + } else { + estimatedPrice_ = null; + estimatedPriceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.TollInfoProto + .internal_static_google_maps_routing_v2_TollInfo_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.TollInfo getDefaultInstanceForType() { + return com.google.maps.routing.v2.TollInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.TollInfo build() { + com.google.maps.routing.v2.TollInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.TollInfo buildPartial() { + com.google.maps.routing.v2.TollInfo result = new com.google.maps.routing.v2.TollInfo(this); + int from_bitField0_ = bitField0_; + if (estimatedPriceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + estimatedPrice_ = java.util.Collections.unmodifiableList(estimatedPrice_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.estimatedPrice_ = estimatedPrice_; + } else { + result.estimatedPrice_ = estimatedPriceBuilder_.build(); + } + 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.routing.v2.TollInfo) { + return mergeFrom((com.google.maps.routing.v2.TollInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.TollInfo other) { + if (other == com.google.maps.routing.v2.TollInfo.getDefaultInstance()) return this; + if (estimatedPriceBuilder_ == null) { + if (!other.estimatedPrice_.isEmpty()) { + if (estimatedPrice_.isEmpty()) { + estimatedPrice_ = other.estimatedPrice_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEstimatedPriceIsMutable(); + estimatedPrice_.addAll(other.estimatedPrice_); + } + onChanged(); + } + } else { + if (!other.estimatedPrice_.isEmpty()) { + if (estimatedPriceBuilder_.isEmpty()) { + estimatedPriceBuilder_.dispose(); + estimatedPriceBuilder_ = null; + estimatedPrice_ = other.estimatedPrice_; + bitField0_ = (bitField0_ & ~0x00000001); + estimatedPriceBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEstimatedPriceFieldBuilder() + : null; + } else { + estimatedPriceBuilder_.addAllMessages(other.estimatedPrice_); + } + } + } + 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.type.Money m = + input.readMessage(com.google.type.Money.parser(), extensionRegistry); + if (estimatedPriceBuilder_ == null) { + ensureEstimatedPriceIsMutable(); + estimatedPrice_.add(m); + } else { + estimatedPriceBuilder_.addMessage(m); + } + 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.util.List estimatedPrice_ = + java.util.Collections.emptyList(); + + private void ensureEstimatedPriceIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + estimatedPrice_ = new java.util.ArrayList(estimatedPrice_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> + estimatedPriceBuilder_; + + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public java.util.List getEstimatedPriceList() { + if (estimatedPriceBuilder_ == null) { + return java.util.Collections.unmodifiableList(estimatedPrice_); + } else { + return estimatedPriceBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public int getEstimatedPriceCount() { + if (estimatedPriceBuilder_ == null) { + return estimatedPrice_.size(); + } else { + return estimatedPriceBuilder_.getCount(); + } + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public com.google.type.Money getEstimatedPrice(int index) { + if (estimatedPriceBuilder_ == null) { + return estimatedPrice_.get(index); + } else { + return estimatedPriceBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder setEstimatedPrice(int index, com.google.type.Money value) { + if (estimatedPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEstimatedPriceIsMutable(); + estimatedPrice_.set(index, value); + onChanged(); + } else { + estimatedPriceBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder setEstimatedPrice(int index, com.google.type.Money.Builder builderForValue) { + if (estimatedPriceBuilder_ == null) { + ensureEstimatedPriceIsMutable(); + estimatedPrice_.set(index, builderForValue.build()); + onChanged(); + } else { + estimatedPriceBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder addEstimatedPrice(com.google.type.Money value) { + if (estimatedPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEstimatedPriceIsMutable(); + estimatedPrice_.add(value); + onChanged(); + } else { + estimatedPriceBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder addEstimatedPrice(int index, com.google.type.Money value) { + if (estimatedPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEstimatedPriceIsMutable(); + estimatedPrice_.add(index, value); + onChanged(); + } else { + estimatedPriceBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder addEstimatedPrice(com.google.type.Money.Builder builderForValue) { + if (estimatedPriceBuilder_ == null) { + ensureEstimatedPriceIsMutable(); + estimatedPrice_.add(builderForValue.build()); + onChanged(); + } else { + estimatedPriceBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder addEstimatedPrice(int index, com.google.type.Money.Builder builderForValue) { + if (estimatedPriceBuilder_ == null) { + ensureEstimatedPriceIsMutable(); + estimatedPrice_.add(index, builderForValue.build()); + onChanged(); + } else { + estimatedPriceBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder addAllEstimatedPrice( + java.lang.Iterable values) { + if (estimatedPriceBuilder_ == null) { + ensureEstimatedPriceIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, estimatedPrice_); + onChanged(); + } else { + estimatedPriceBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder clearEstimatedPrice() { + if (estimatedPriceBuilder_ == null) { + estimatedPrice_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + estimatedPriceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public Builder removeEstimatedPrice(int index) { + if (estimatedPriceBuilder_ == null) { + ensureEstimatedPriceIsMutable(); + estimatedPrice_.remove(index); + onChanged(); + } else { + estimatedPriceBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public com.google.type.Money.Builder getEstimatedPriceBuilder(int index) { + return getEstimatedPriceFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public com.google.type.MoneyOrBuilder getEstimatedPriceOrBuilder(int index) { + if (estimatedPriceBuilder_ == null) { + return estimatedPrice_.get(index); + } else { + return estimatedPriceBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public java.util.List + getEstimatedPriceOrBuilderList() { + if (estimatedPriceBuilder_ != null) { + return estimatedPriceBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(estimatedPrice_); + } + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public com.google.type.Money.Builder addEstimatedPriceBuilder() { + return getEstimatedPriceFieldBuilder().addBuilder(com.google.type.Money.getDefaultInstance()); + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public com.google.type.Money.Builder addEstimatedPriceBuilder(int index) { + return getEstimatedPriceFieldBuilder() + .addBuilder(index, com.google.type.Money.getDefaultInstance()); + } + /** + * + * + *
+     * The monetary amount of tolls for the corresponding Route or RouteLeg.
+     * This list contains a money amount for each currency that is expected
+     * to be charged by the toll stations. Typically this list will contain only
+     * one item for routes with tolls in one currency. For international trips,
+     * this list may contain multiple items to reflect tolls in different
+     * currencies.
+     * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + public java.util.List getEstimatedPriceBuilderList() { + return getEstimatedPriceFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> + getEstimatedPriceFieldBuilder() { + if (estimatedPriceBuilder_ == null) { + estimatedPriceBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.type.Money, + com.google.type.Money.Builder, + com.google.type.MoneyOrBuilder>( + estimatedPrice_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + estimatedPrice_ = null; + } + return estimatedPriceBuilder_; + } + + @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.routing.v2.TollInfo) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.TollInfo) + private static final com.google.maps.routing.v2.TollInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.TollInfo(); + } + + public static com.google.maps.routing.v2.TollInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TollInfo 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.routing.v2.TollInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfoOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfoOrBuilder.java new file mode 100644 index 000000000000..ba94fc699952 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfoOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 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/routing/v2/toll_info.proto + +package com.google.maps.routing.v2; + +public interface TollInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.TollInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + java.util.List getEstimatedPriceList(); + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + com.google.type.Money getEstimatedPrice(int index); + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + int getEstimatedPriceCount(); + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + java.util.List getEstimatedPriceOrBuilderList(); + /** + * + * + *
+   * The monetary amount of tolls for the corresponding Route or RouteLeg.
+   * This list contains a money amount for each currency that is expected
+   * to be charged by the toll stations. Typically this list will contain only
+   * one item for routes with tolls in one currency. For international trips,
+   * this list may contain multiple items to reflect tolls in different
+   * currencies.
+   * 
+ * + * repeated .google.type.Money estimated_price = 1; + */ + com.google.type.MoneyOrBuilder getEstimatedPriceOrBuilder(int index); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfoProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfoProto.java new file mode 100644 index 000000000000..2a9ed26f48f0 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollInfoProto.java @@ -0,0 +1,71 @@ +/* + * Copyright 2020 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/routing/v2/toll_info.proto + +package com.google.maps.routing.v2; + +public final class TollInfoProto { + private TollInfoProto() {} + + 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_routing_v2_TollInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_TollInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/maps/routing/v2/toll_info.proto" + + "\022\026google.maps.routing.v2\032\027google/type/mo" + + "ney.proto\"7\n\010TollInfo\022+\n\017estimated_price" + + "\030\001 \003(\0132\022.google.type.MoneyB\305\001\n\032com.googl" + + "e.maps.routing.v2B\rTollInfoProtoP\001Z=goog" + + "le.golang.org/genproto/googleapis/maps/r" + + "outing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Google.Ma" + + "ps.Routing.V2\312\002\026Google\\Maps\\Routing\\V2\352\002" + + "\031Google::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.type.MoneyProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_TollInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_TollInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_TollInfo_descriptor, + new java.lang.String[] { + "EstimatedPrice", + }); + com.google.type.MoneyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollPass.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollPass.java new file mode 100644 index 000000000000..3bdb1b220654 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollPass.java @@ -0,0 +1,2164 @@ +/* + * Copyright 2020 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/routing/v2/toll_passes.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * List of toll passes around the world that we support.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.TollPass} + */ +public enum TollPass implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not used. If this value is used, then the request fails.
+   * 
+ * + * TOLL_PASS_UNSPECIFIED = 0; + */ + TOLL_PASS_UNSPECIFIED(0), + /** + * + * + *
+   * Sydney toll pass. See additional details at https://www.myetoll.com.au.
+   * 
+ * + * AU_ETOLL_TAG = 82; + */ + AU_ETOLL_TAG(82), + /** + * + * + *
+   * Sydney toll pass. See additional details at https://www.tollpay.com.au.
+   * 
+ * + * AU_EWAY_TAG = 83; + */ + AU_EWAY_TAG(83), + /** + * + * + *
+   * Australia-wide toll pass.
+   * See additional details at https://www.linkt.com.au/.
+   * 
+ * + * AU_LINKT = 2; + */ + AU_LINKT(2), + /** + * + * + *
+   * Argentina toll pass. See additional details at https://telepase.com.ar
+   * 
+ * + * AR_TELEPASE = 3; + */ + AR_TELEPASE(3), + /** + * + * + *
+   * Brazil toll pass. See additional details at https://www.autoexpreso.com
+   * 
+ * + * BR_AUTO_EXPRESO = 81; + */ + BR_AUTO_EXPRESO(81), + /** + * + * + *
+   * Brazil toll pass. See additional details at https://conectcar.com.
+   * 
+ * + * BR_CONECTCAR = 7; + */ + BR_CONECTCAR(7), + /** + * + * + *
+   * Brazil toll pass. See additional details at https://movemais.com.
+   * 
+ * + * BR_MOVE_MAIS = 8; + */ + BR_MOVE_MAIS(8), + /** + * + * + *
+   * Brazil toll pass. See additional details at https://pasorapido.gob.do/
+   * 
+ * + * BR_PASSA_RAPIDO = 88; + */ + BR_PASSA_RAPIDO(88), + /** + * + * + *
+   * Brazil toll pass. See additional details at https://www.semparar.com.br.
+   * 
+ * + * BR_SEM_PARAR = 9; + */ + BR_SEM_PARAR(9), + /** + * + * + *
+   * Brazil toll pass. See additional details at https://taggy.com.br.
+   * 
+ * + * BR_TAGGY = 10; + */ + BR_TAGGY(10), + /** + * + * + *
+   * Brazil toll pass. See additional details at
+   * https://veloe.com.br/site/onde-usar.
+   * 
+ * + * BR_VELOE = 11; + */ + BR_VELOE(11), + /** + * + * + *
+   * Canada to United States border crossing.
+   * 
+ * + * CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84; + */ + CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD(84), + /** + * + * + *
+   * Canada to United States border crossing.
+   * 
+ * + * CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85; + */ + CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD(85), + /** + * + * + *
+   * Ontario, Canada to Michigan, United States border crossing.
+   * 
+ * + * CA_US_BLUE_WATER_EDGE_PASS = 18; + */ + CA_US_BLUE_WATER_EDGE_PASS(18), + /** + * + * + *
+   * Ontario, Canada to Michigan, United States border crossing.
+   * 
+ * + * CA_US_CONNEXION = 19; + */ + CA_US_CONNEXION(19), + /** + * + * + *
+   * Canada to United States border crossing.
+   * 
+ * + * CA_US_NEXUS_CARD = 20; + */ + CA_US_NEXUS_CARD(20), + /** + * + * + *
+   * Indonesia.
+   * E-card provided by multiple banks used to pay for tolls. All e-cards
+   * via banks are charged the same so only one enum value is needed. E.g.
+   * - Bank Mandiri https://www.bankmandiri.co.id/e-money
+   * - BCA https://www.bca.co.id/flazz
+   * - BNI https://www.bni.co.id/id-id/ebanking/tapcash
+   * 
+ * + * ID_E_TOLL = 16; + */ + ID_E_TOLL(16), + /** + * + * + *
+   * India.
+   * 
+ * + * IN_FASTAG = 78; + */ + IN_FASTAG(78), + /** + * + * + *
+   * India, HP state plate exemption.
+   * 
+ * + * IN_LOCAL_HP_PLATE_EXEMPT = 79; + */ + IN_LOCAL_HP_PLATE_EXEMPT(79), + /** + * + * + *
+   * Mexico toll pass.
+   * https://iave.capufe.gob.mx/#/
+   * 
+ * + * MX_IAVE = 90; + */ + MX_IAVE(90), + /** + * + * + *
+   * Mexico
+   * https://www.pase.com.mx
+   * 
+ * + * MX_PASE = 91; + */ + MX_PASE(91), + /** + * + * + *
+   * Mexico
+   *  https://operadoravial.com/quick-pass/
+   * 
+ * + * MX_QUICKPASS = 93; + */ + MX_QUICKPASS(93), + /** + * + * + *
+   * http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf
+   * 
+ * + * MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89; + */ + MX_SISTEMA_TELEPEAJE_CHIHUAHUA(89), + /** + * + * + *
+   * Mexico
+   * 
+ * + * MX_TAG_IAVE = 12; + */ + MX_TAG_IAVE(12), + /** + * + * + *
+   * Mexico toll pass company. One of many operating in Mexico City. See
+   * additional details at https://www.televia.com.mx.
+   * 
+ * + * MX_TAG_TELEVIA = 13; + */ + MX_TAG_TELEVIA(13), + /** + * + * + *
+   * Mexico toll pass company. One of many operating in Mexico City.
+   * https://www.televia.com.mx
+   * 
+ * + * MX_TELEVIA = 92; + */ + MX_TELEVIA(92), + /** + * + * + *
+   * Mexico toll pass. See additional details at
+   * https://www.viapass.com.mx/viapass/web_home.aspx.
+   * 
+ * + * MX_VIAPASS = 14; + */ + MX_VIAPASS(14), + /** + * + * + *
+   * AL, USA.
+   * 
+ * + * US_AL_FREEDOM_PASS = 21; + */ + US_AL_FREEDOM_PASS(21), + /** + * + * + *
+   * AK, USA.
+   * 
+ * + * US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22; + */ + US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS(22), + /** + * + * + *
+   * CA, USA.
+   * 
+ * + * US_CA_FASTRAK = 4; + */ + US_CA_FASTRAK(4), + /** + * + * + *
+   * Indicates driver has any FasTrak pass in addition to the DMV issued Clean
+   * Air Vehicle (CAV) sticker.
+   * https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml
+   * 
+ * + * US_CA_FASTRAK_CAV_STICKER = 86; + */ + US_CA_FASTRAK_CAV_STICKER(86), + /** + * + * + *
+   * CO, USA.
+   * 
+ * + * US_CO_EXPRESSTOLL = 23; + */ + US_CO_EXPRESSTOLL(23), + /** + * + * + *
+   * CO, USA.
+   * 
+ * + * US_CO_GO_PASS = 24; + */ + US_CO_GO_PASS(24), + /** + * + * + *
+   * DE, USA.
+   * 
+ * + * US_DE_EZPASSDE = 25; + */ + US_DE_EZPASSDE(25), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65; + */ + US_FL_BOB_SIKES_TOLL_BRIDGE_PASS(65), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66; + */ + US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD(66), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_EPASS = 67; + */ + US_FL_EPASS(67), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_GIBA_TOLL_PASS = 68; + */ + US_FL_GIBA_TOLL_PASS(68), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_LEEWAY = 69; + */ + US_FL_LEEWAY(69), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_SUNPASS = 70; + */ + US_FL_SUNPASS(70), + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_SUNPASS_PRO = 71; + */ + US_FL_SUNPASS_PRO(71), + /** + * + * + *
+   * IL, USA.
+   * 
+ * + * US_IL_EZPASSIL = 73; + */ + US_IL_EZPASSIL(73), + /** + * + * + *
+   * IL, USA.
+   * 
+ * + * US_IL_IPASS = 72; + */ + US_IL_IPASS(72), + /** + * + * + *
+   * IN, USA.
+   * 
+ * + * US_IN_EZPASSIN = 26; + */ + US_IN_EZPASSIN(26), + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_BESTPASS_HORIZON = 27; + */ + US_KS_BESTPASS_HORIZON(27), + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_KTAG = 28; + */ + US_KS_KTAG(28), + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_NATIONALPASS = 29; + */ + US_KS_NATIONALPASS(29), + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_PREPASS_ELITEPASS = 30; + */ + US_KS_PREPASS_ELITEPASS(30), + /** + * + * + *
+   * KY, USA.
+   * 
+ * + * US_KY_RIVERLINK = 31; + */ + US_KY_RIVERLINK(31), + /** + * + * + *
+   * LA, USA.
+   * 
+ * + * US_LA_GEAUXPASS = 32; + */ + US_LA_GEAUXPASS(32), + /** + * + * + *
+   * LA, USA.
+   * 
+ * + * US_LA_TOLL_TAG = 33; + */ + US_LA_TOLL_TAG(33), + /** + * + * + *
+   * MA, USA.
+   * 
+ * + * US_MA_EZPASSMA = 6; + */ + US_MA_EZPASSMA(6), + /** + * + * + *
+   * MD, USA.
+   * 
+ * + * US_MD_EZPASSMD = 34; + */ + US_MD_EZPASSMD(34), + /** + * + * + *
+   * ME, USA.
+   * 
+ * + * US_ME_EZPASSME = 35; + */ + US_ME_EZPASSME(35), + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36; + */ + US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD(36), + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37; + */ + US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG(37), + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_IQ_PROX_CARD = 38; + */ + US_MI_IQ_PROX_CARD(38), + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_MACKINAC_BRIDGE_MAC_PASS = 39; + */ + US_MI_MACKINAC_BRIDGE_MAC_PASS(39), + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_NEXPRESS_TOLL = 40; + */ + US_MI_NEXPRESS_TOLL(40), + /** + * + * + *
+   * MN, USA.
+   * 
+ * + * US_MN_EZPASSMN = 41; + */ + US_MN_EZPASSMN(41), + /** + * + * + *
+   * NC, USA.
+   * 
+ * + * US_NC_EZPASSNC = 42; + */ + US_NC_EZPASSNC(42), + /** + * + * + *
+   * NC, USA.
+   * 
+ * + * US_NC_PEACH_PASS = 87; + */ + US_NC_PEACH_PASS(87), + /** + * + * + *
+   * NC, USA.
+   * 
+ * + * US_NC_QUICK_PASS = 43; + */ + US_NC_QUICK_PASS(43), + /** + * + * + *
+   * NH, USA.
+   * 
+ * + * US_NH_EZPASSNH = 80; + */ + US_NH_EZPASSNH(80), + /** + * + * + *
+   * NJ, USA.
+   * 
+ * + * US_NJ_DOWNBEACH_EXPRESS_PASS = 75; + */ + US_NJ_DOWNBEACH_EXPRESS_PASS(75), + /** + * + * + *
+   * NJ, USA.
+   * 
+ * + * US_NJ_EZPASSNJ = 74; + */ + US_NJ_EZPASSNJ(74), + /** + * + * + *
+   * NY, USA.
+   * 
+ * + * US_NY_EXPRESSPASS = 76; + */ + US_NY_EXPRESSPASS(76), + /** + * + * + *
+   * NY, USA.
+   * 
+ * + * US_NY_EZPASSNY = 77; + */ + US_NY_EZPASSNY(77), + /** + * + * + *
+   * OH, USA.
+   * 
+ * + * US_OH_EZPASSOH = 44; + */ + US_OH_EZPASSOH(44), + /** + * + * + *
+   * PA, USA.
+   * 
+ * + * US_PA_EZPASSPA = 45; + */ + US_PA_EZPASSPA(45), + /** + * + * + *
+   * RI, USA.
+   * 
+ * + * US_RI_EZPASSRI = 46; + */ + US_RI_EZPASSRI(46), + /** + * + * + *
+   * SC, USA.
+   * 
+ * + * US_SC_PALPASS = 47; + */ + US_SC_PALPASS(47), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_BANCPASS = 48; + */ + US_TX_BANCPASS(48), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_DEL_RIO_PASS = 49; + */ + US_TX_DEL_RIO_PASS(49), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EFAST_PASS = 50; + */ + US_TX_EFAST_PASS(50), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EAGLE_PASS_EXPRESS_CARD = 51; + */ + US_TX_EAGLE_PASS_EXPRESS_CARD(51), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EPTOLL = 52; + */ + US_TX_EPTOLL(52), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EZ_CROSS = 53; + */ + US_TX_EZ_CROSS(53), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EZTAG = 54; + */ + US_TX_EZTAG(54), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_LAREDO_TRADE_TAG = 55; + */ + US_TX_LAREDO_TRADE_TAG(55), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_PLUSPASS = 56; + */ + US_TX_PLUSPASS(56), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_TOLLTAG = 57; + */ + US_TX_TOLLTAG(57), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_TXTAG = 58; + */ + US_TX_TXTAG(58), + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_XPRESS_CARD = 59; + */ + US_TX_XPRESS_CARD(59), + /** + * + * + *
+   * UT, USA.
+   * 
+ * + * US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60; + */ + US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD(60), + /** + * + * + *
+   * VA, USA.
+   * 
+ * + * US_VA_EZPASSVA = 61; + */ + US_VA_EZPASSVA(61), + /** + * + * + *
+   * WA, USA.
+   * 
+ * + * US_WA_BREEZEBY = 17; + */ + US_WA_BREEZEBY(17), + /** + * + * + *
+   * WA, USA.
+   * 
+ * + * US_WA_GOOD_TO_GO = 1; + */ + US_WA_GOOD_TO_GO(1), + /** + * + * + *
+   * WV, USA.
+   * 
+ * + * US_WV_EZPASSWV = 62; + */ + US_WV_EZPASSWV(62), + /** + * + * + *
+   * WV, USA.
+   * 
+ * + * US_WV_MEMORIAL_BRIDGE_TICKETS = 63; + */ + US_WV_MEMORIAL_BRIDGE_TICKETS(63), + /** + * + * + *
+   * WV, USA.
+   * 
+ * + * US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64; + */ + US_WV_NEWELL_TOLL_BRIDGE_TICKET(64), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not used. If this value is used, then the request fails.
+   * 
+ * + * TOLL_PASS_UNSPECIFIED = 0; + */ + public static final int TOLL_PASS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Sydney toll pass. See additional details at https://www.myetoll.com.au.
+   * 
+ * + * AU_ETOLL_TAG = 82; + */ + public static final int AU_ETOLL_TAG_VALUE = 82; + /** + * + * + *
+   * Sydney toll pass. See additional details at https://www.tollpay.com.au.
+   * 
+ * + * AU_EWAY_TAG = 83; + */ + public static final int AU_EWAY_TAG_VALUE = 83; + /** + * + * + *
+   * Australia-wide toll pass.
+   * See additional details at https://www.linkt.com.au/.
+   * 
+ * + * AU_LINKT = 2; + */ + public static final int AU_LINKT_VALUE = 2; + /** + * + * + *
+   * Argentina toll pass. See additional details at https://telepase.com.ar
+   * 
+ * + * AR_TELEPASE = 3; + */ + public static final int AR_TELEPASE_VALUE = 3; + /** + * + * + *
+   * Brazil toll pass. See additional details at https://www.autoexpreso.com
+   * 
+ * + * BR_AUTO_EXPRESO = 81; + */ + public static final int BR_AUTO_EXPRESO_VALUE = 81; + /** + * + * + *
+   * Brazil toll pass. See additional details at https://conectcar.com.
+   * 
+ * + * BR_CONECTCAR = 7; + */ + public static final int BR_CONECTCAR_VALUE = 7; + /** + * + * + *
+   * Brazil toll pass. See additional details at https://movemais.com.
+   * 
+ * + * BR_MOVE_MAIS = 8; + */ + public static final int BR_MOVE_MAIS_VALUE = 8; + /** + * + * + *
+   * Brazil toll pass. See additional details at https://pasorapido.gob.do/
+   * 
+ * + * BR_PASSA_RAPIDO = 88; + */ + public static final int BR_PASSA_RAPIDO_VALUE = 88; + /** + * + * + *
+   * Brazil toll pass. See additional details at https://www.semparar.com.br.
+   * 
+ * + * BR_SEM_PARAR = 9; + */ + public static final int BR_SEM_PARAR_VALUE = 9; + /** + * + * + *
+   * Brazil toll pass. See additional details at https://taggy.com.br.
+   * 
+ * + * BR_TAGGY = 10; + */ + public static final int BR_TAGGY_VALUE = 10; + /** + * + * + *
+   * Brazil toll pass. See additional details at
+   * https://veloe.com.br/site/onde-usar.
+   * 
+ * + * BR_VELOE = 11; + */ + public static final int BR_VELOE_VALUE = 11; + /** + * + * + *
+   * Canada to United States border crossing.
+   * 
+ * + * CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84; + */ + public static final int CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD_VALUE = 84; + /** + * + * + *
+   * Canada to United States border crossing.
+   * 
+ * + * CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85; + */ + public static final int CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD_VALUE = 85; + /** + * + * + *
+   * Ontario, Canada to Michigan, United States border crossing.
+   * 
+ * + * CA_US_BLUE_WATER_EDGE_PASS = 18; + */ + public static final int CA_US_BLUE_WATER_EDGE_PASS_VALUE = 18; + /** + * + * + *
+   * Ontario, Canada to Michigan, United States border crossing.
+   * 
+ * + * CA_US_CONNEXION = 19; + */ + public static final int CA_US_CONNEXION_VALUE = 19; + /** + * + * + *
+   * Canada to United States border crossing.
+   * 
+ * + * CA_US_NEXUS_CARD = 20; + */ + public static final int CA_US_NEXUS_CARD_VALUE = 20; + /** + * + * + *
+   * Indonesia.
+   * E-card provided by multiple banks used to pay for tolls. All e-cards
+   * via banks are charged the same so only one enum value is needed. E.g.
+   * - Bank Mandiri https://www.bankmandiri.co.id/e-money
+   * - BCA https://www.bca.co.id/flazz
+   * - BNI https://www.bni.co.id/id-id/ebanking/tapcash
+   * 
+ * + * ID_E_TOLL = 16; + */ + public static final int ID_E_TOLL_VALUE = 16; + /** + * + * + *
+   * India.
+   * 
+ * + * IN_FASTAG = 78; + */ + public static final int IN_FASTAG_VALUE = 78; + /** + * + * + *
+   * India, HP state plate exemption.
+   * 
+ * + * IN_LOCAL_HP_PLATE_EXEMPT = 79; + */ + public static final int IN_LOCAL_HP_PLATE_EXEMPT_VALUE = 79; + /** + * + * + *
+   * Mexico toll pass.
+   * https://iave.capufe.gob.mx/#/
+   * 
+ * + * MX_IAVE = 90; + */ + public static final int MX_IAVE_VALUE = 90; + /** + * + * + *
+   * Mexico
+   * https://www.pase.com.mx
+   * 
+ * + * MX_PASE = 91; + */ + public static final int MX_PASE_VALUE = 91; + /** + * + * + *
+   * Mexico
+   *  https://operadoravial.com/quick-pass/
+   * 
+ * + * MX_QUICKPASS = 93; + */ + public static final int MX_QUICKPASS_VALUE = 93; + /** + * + * + *
+   * http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf
+   * 
+ * + * MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89; + */ + public static final int MX_SISTEMA_TELEPEAJE_CHIHUAHUA_VALUE = 89; + /** + * + * + *
+   * Mexico
+   * 
+ * + * MX_TAG_IAVE = 12; + */ + public static final int MX_TAG_IAVE_VALUE = 12; + /** + * + * + *
+   * Mexico toll pass company. One of many operating in Mexico City. See
+   * additional details at https://www.televia.com.mx.
+   * 
+ * + * MX_TAG_TELEVIA = 13; + */ + public static final int MX_TAG_TELEVIA_VALUE = 13; + /** + * + * + *
+   * Mexico toll pass company. One of many operating in Mexico City.
+   * https://www.televia.com.mx
+   * 
+ * + * MX_TELEVIA = 92; + */ + public static final int MX_TELEVIA_VALUE = 92; + /** + * + * + *
+   * Mexico toll pass. See additional details at
+   * https://www.viapass.com.mx/viapass/web_home.aspx.
+   * 
+ * + * MX_VIAPASS = 14; + */ + public static final int MX_VIAPASS_VALUE = 14; + /** + * + * + *
+   * AL, USA.
+   * 
+ * + * US_AL_FREEDOM_PASS = 21; + */ + public static final int US_AL_FREEDOM_PASS_VALUE = 21; + /** + * + * + *
+   * AK, USA.
+   * 
+ * + * US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22; + */ + public static final int US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS_VALUE = 22; + /** + * + * + *
+   * CA, USA.
+   * 
+ * + * US_CA_FASTRAK = 4; + */ + public static final int US_CA_FASTRAK_VALUE = 4; + /** + * + * + *
+   * Indicates driver has any FasTrak pass in addition to the DMV issued Clean
+   * Air Vehicle (CAV) sticker.
+   * https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml
+   * 
+ * + * US_CA_FASTRAK_CAV_STICKER = 86; + */ + public static final int US_CA_FASTRAK_CAV_STICKER_VALUE = 86; + /** + * + * + *
+   * CO, USA.
+   * 
+ * + * US_CO_EXPRESSTOLL = 23; + */ + public static final int US_CO_EXPRESSTOLL_VALUE = 23; + /** + * + * + *
+   * CO, USA.
+   * 
+ * + * US_CO_GO_PASS = 24; + */ + public static final int US_CO_GO_PASS_VALUE = 24; + /** + * + * + *
+   * DE, USA.
+   * 
+ * + * US_DE_EZPASSDE = 25; + */ + public static final int US_DE_EZPASSDE_VALUE = 25; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65; + */ + public static final int US_FL_BOB_SIKES_TOLL_BRIDGE_PASS_VALUE = 65; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66; + */ + public static final int US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD_VALUE = 66; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_EPASS = 67; + */ + public static final int US_FL_EPASS_VALUE = 67; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_GIBA_TOLL_PASS = 68; + */ + public static final int US_FL_GIBA_TOLL_PASS_VALUE = 68; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_LEEWAY = 69; + */ + public static final int US_FL_LEEWAY_VALUE = 69; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_SUNPASS = 70; + */ + public static final int US_FL_SUNPASS_VALUE = 70; + /** + * + * + *
+   * FL, USA.
+   * 
+ * + * US_FL_SUNPASS_PRO = 71; + */ + public static final int US_FL_SUNPASS_PRO_VALUE = 71; + /** + * + * + *
+   * IL, USA.
+   * 
+ * + * US_IL_EZPASSIL = 73; + */ + public static final int US_IL_EZPASSIL_VALUE = 73; + /** + * + * + *
+   * IL, USA.
+   * 
+ * + * US_IL_IPASS = 72; + */ + public static final int US_IL_IPASS_VALUE = 72; + /** + * + * + *
+   * IN, USA.
+   * 
+ * + * US_IN_EZPASSIN = 26; + */ + public static final int US_IN_EZPASSIN_VALUE = 26; + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_BESTPASS_HORIZON = 27; + */ + public static final int US_KS_BESTPASS_HORIZON_VALUE = 27; + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_KTAG = 28; + */ + public static final int US_KS_KTAG_VALUE = 28; + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_NATIONALPASS = 29; + */ + public static final int US_KS_NATIONALPASS_VALUE = 29; + /** + * + * + *
+   * KS, USA.
+   * 
+ * + * US_KS_PREPASS_ELITEPASS = 30; + */ + public static final int US_KS_PREPASS_ELITEPASS_VALUE = 30; + /** + * + * + *
+   * KY, USA.
+   * 
+ * + * US_KY_RIVERLINK = 31; + */ + public static final int US_KY_RIVERLINK_VALUE = 31; + /** + * + * + *
+   * LA, USA.
+   * 
+ * + * US_LA_GEAUXPASS = 32; + */ + public static final int US_LA_GEAUXPASS_VALUE = 32; + /** + * + * + *
+   * LA, USA.
+   * 
+ * + * US_LA_TOLL_TAG = 33; + */ + public static final int US_LA_TOLL_TAG_VALUE = 33; + /** + * + * + *
+   * MA, USA.
+   * 
+ * + * US_MA_EZPASSMA = 6; + */ + public static final int US_MA_EZPASSMA_VALUE = 6; + /** + * + * + *
+   * MD, USA.
+   * 
+ * + * US_MD_EZPASSMD = 34; + */ + public static final int US_MD_EZPASSMD_VALUE = 34; + /** + * + * + *
+   * ME, USA.
+   * 
+ * + * US_ME_EZPASSME = 35; + */ + public static final int US_ME_EZPASSME_VALUE = 35; + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36; + */ + public static final int US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD_VALUE = 36; + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37; + */ + public static final int US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG_VALUE = 37; + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_IQ_PROX_CARD = 38; + */ + public static final int US_MI_IQ_PROX_CARD_VALUE = 38; + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_MACKINAC_BRIDGE_MAC_PASS = 39; + */ + public static final int US_MI_MACKINAC_BRIDGE_MAC_PASS_VALUE = 39; + /** + * + * + *
+   * MI, USA.
+   * 
+ * + * US_MI_NEXPRESS_TOLL = 40; + */ + public static final int US_MI_NEXPRESS_TOLL_VALUE = 40; + /** + * + * + *
+   * MN, USA.
+   * 
+ * + * US_MN_EZPASSMN = 41; + */ + public static final int US_MN_EZPASSMN_VALUE = 41; + /** + * + * + *
+   * NC, USA.
+   * 
+ * + * US_NC_EZPASSNC = 42; + */ + public static final int US_NC_EZPASSNC_VALUE = 42; + /** + * + * + *
+   * NC, USA.
+   * 
+ * + * US_NC_PEACH_PASS = 87; + */ + public static final int US_NC_PEACH_PASS_VALUE = 87; + /** + * + * + *
+   * NC, USA.
+   * 
+ * + * US_NC_QUICK_PASS = 43; + */ + public static final int US_NC_QUICK_PASS_VALUE = 43; + /** + * + * + *
+   * NH, USA.
+   * 
+ * + * US_NH_EZPASSNH = 80; + */ + public static final int US_NH_EZPASSNH_VALUE = 80; + /** + * + * + *
+   * NJ, USA.
+   * 
+ * + * US_NJ_DOWNBEACH_EXPRESS_PASS = 75; + */ + public static final int US_NJ_DOWNBEACH_EXPRESS_PASS_VALUE = 75; + /** + * + * + *
+   * NJ, USA.
+   * 
+ * + * US_NJ_EZPASSNJ = 74; + */ + public static final int US_NJ_EZPASSNJ_VALUE = 74; + /** + * + * + *
+   * NY, USA.
+   * 
+ * + * US_NY_EXPRESSPASS = 76; + */ + public static final int US_NY_EXPRESSPASS_VALUE = 76; + /** + * + * + *
+   * NY, USA.
+   * 
+ * + * US_NY_EZPASSNY = 77; + */ + public static final int US_NY_EZPASSNY_VALUE = 77; + /** + * + * + *
+   * OH, USA.
+   * 
+ * + * US_OH_EZPASSOH = 44; + */ + public static final int US_OH_EZPASSOH_VALUE = 44; + /** + * + * + *
+   * PA, USA.
+   * 
+ * + * US_PA_EZPASSPA = 45; + */ + public static final int US_PA_EZPASSPA_VALUE = 45; + /** + * + * + *
+   * RI, USA.
+   * 
+ * + * US_RI_EZPASSRI = 46; + */ + public static final int US_RI_EZPASSRI_VALUE = 46; + /** + * + * + *
+   * SC, USA.
+   * 
+ * + * US_SC_PALPASS = 47; + */ + public static final int US_SC_PALPASS_VALUE = 47; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_BANCPASS = 48; + */ + public static final int US_TX_BANCPASS_VALUE = 48; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_DEL_RIO_PASS = 49; + */ + public static final int US_TX_DEL_RIO_PASS_VALUE = 49; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EFAST_PASS = 50; + */ + public static final int US_TX_EFAST_PASS_VALUE = 50; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EAGLE_PASS_EXPRESS_CARD = 51; + */ + public static final int US_TX_EAGLE_PASS_EXPRESS_CARD_VALUE = 51; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EPTOLL = 52; + */ + public static final int US_TX_EPTOLL_VALUE = 52; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EZ_CROSS = 53; + */ + public static final int US_TX_EZ_CROSS_VALUE = 53; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_EZTAG = 54; + */ + public static final int US_TX_EZTAG_VALUE = 54; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_LAREDO_TRADE_TAG = 55; + */ + public static final int US_TX_LAREDO_TRADE_TAG_VALUE = 55; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_PLUSPASS = 56; + */ + public static final int US_TX_PLUSPASS_VALUE = 56; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_TOLLTAG = 57; + */ + public static final int US_TX_TOLLTAG_VALUE = 57; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_TXTAG = 58; + */ + public static final int US_TX_TXTAG_VALUE = 58; + /** + * + * + *
+   * TX, USA.
+   * 
+ * + * US_TX_XPRESS_CARD = 59; + */ + public static final int US_TX_XPRESS_CARD_VALUE = 59; + /** + * + * + *
+   * UT, USA.
+   * 
+ * + * US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60; + */ + public static final int US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD_VALUE = 60; + /** + * + * + *
+   * VA, USA.
+   * 
+ * + * US_VA_EZPASSVA = 61; + */ + public static final int US_VA_EZPASSVA_VALUE = 61; + /** + * + * + *
+   * WA, USA.
+   * 
+ * + * US_WA_BREEZEBY = 17; + */ + public static final int US_WA_BREEZEBY_VALUE = 17; + /** + * + * + *
+   * WA, USA.
+   * 
+ * + * US_WA_GOOD_TO_GO = 1; + */ + public static final int US_WA_GOOD_TO_GO_VALUE = 1; + /** + * + * + *
+   * WV, USA.
+   * 
+ * + * US_WV_EZPASSWV = 62; + */ + public static final int US_WV_EZPASSWV_VALUE = 62; + /** + * + * + *
+   * WV, USA.
+   * 
+ * + * US_WV_MEMORIAL_BRIDGE_TICKETS = 63; + */ + public static final int US_WV_MEMORIAL_BRIDGE_TICKETS_VALUE = 63; + /** + * + * + *
+   * WV, USA.
+   * 
+ * + * US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64; + */ + public static final int US_WV_NEWELL_TOLL_BRIDGE_TICKET_VALUE = 64; + + 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 TollPass 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 TollPass forNumber(int value) { + switch (value) { + case 0: + return TOLL_PASS_UNSPECIFIED; + case 82: + return AU_ETOLL_TAG; + case 83: + return AU_EWAY_TAG; + case 2: + return AU_LINKT; + case 3: + return AR_TELEPASE; + case 81: + return BR_AUTO_EXPRESO; + case 7: + return BR_CONECTCAR; + case 8: + return BR_MOVE_MAIS; + case 88: + return BR_PASSA_RAPIDO; + case 9: + return BR_SEM_PARAR; + case 10: + return BR_TAGGY; + case 11: + return BR_VELOE; + case 84: + return CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD; + case 85: + return CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD; + case 18: + return CA_US_BLUE_WATER_EDGE_PASS; + case 19: + return CA_US_CONNEXION; + case 20: + return CA_US_NEXUS_CARD; + case 16: + return ID_E_TOLL; + case 78: + return IN_FASTAG; + case 79: + return IN_LOCAL_HP_PLATE_EXEMPT; + case 90: + return MX_IAVE; + case 91: + return MX_PASE; + case 93: + return MX_QUICKPASS; + case 89: + return MX_SISTEMA_TELEPEAJE_CHIHUAHUA; + case 12: + return MX_TAG_IAVE; + case 13: + return MX_TAG_TELEVIA; + case 92: + return MX_TELEVIA; + case 14: + return MX_VIAPASS; + case 21: + return US_AL_FREEDOM_PASS; + case 22: + return US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS; + case 4: + return US_CA_FASTRAK; + case 86: + return US_CA_FASTRAK_CAV_STICKER; + case 23: + return US_CO_EXPRESSTOLL; + case 24: + return US_CO_GO_PASS; + case 25: + return US_DE_EZPASSDE; + case 65: + return US_FL_BOB_SIKES_TOLL_BRIDGE_PASS; + case 66: + return US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD; + case 67: + return US_FL_EPASS; + case 68: + return US_FL_GIBA_TOLL_PASS; + case 69: + return US_FL_LEEWAY; + case 70: + return US_FL_SUNPASS; + case 71: + return US_FL_SUNPASS_PRO; + case 73: + return US_IL_EZPASSIL; + case 72: + return US_IL_IPASS; + case 26: + return US_IN_EZPASSIN; + case 27: + return US_KS_BESTPASS_HORIZON; + case 28: + return US_KS_KTAG; + case 29: + return US_KS_NATIONALPASS; + case 30: + return US_KS_PREPASS_ELITEPASS; + case 31: + return US_KY_RIVERLINK; + case 32: + return US_LA_GEAUXPASS; + case 33: + return US_LA_TOLL_TAG; + case 6: + return US_MA_EZPASSMA; + case 34: + return US_MD_EZPASSMD; + case 35: + return US_ME_EZPASSME; + case 36: + return US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD; + case 37: + return US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG; + case 38: + return US_MI_IQ_PROX_CARD; + case 39: + return US_MI_MACKINAC_BRIDGE_MAC_PASS; + case 40: + return US_MI_NEXPRESS_TOLL; + case 41: + return US_MN_EZPASSMN; + case 42: + return US_NC_EZPASSNC; + case 87: + return US_NC_PEACH_PASS; + case 43: + return US_NC_QUICK_PASS; + case 80: + return US_NH_EZPASSNH; + case 75: + return US_NJ_DOWNBEACH_EXPRESS_PASS; + case 74: + return US_NJ_EZPASSNJ; + case 76: + return US_NY_EXPRESSPASS; + case 77: + return US_NY_EZPASSNY; + case 44: + return US_OH_EZPASSOH; + case 45: + return US_PA_EZPASSPA; + case 46: + return US_RI_EZPASSRI; + case 47: + return US_SC_PALPASS; + case 48: + return US_TX_BANCPASS; + case 49: + return US_TX_DEL_RIO_PASS; + case 50: + return US_TX_EFAST_PASS; + case 51: + return US_TX_EAGLE_PASS_EXPRESS_CARD; + case 52: + return US_TX_EPTOLL; + case 53: + return US_TX_EZ_CROSS; + case 54: + return US_TX_EZTAG; + case 55: + return US_TX_LAREDO_TRADE_TAG; + case 56: + return US_TX_PLUSPASS; + case 57: + return US_TX_TOLLTAG; + case 58: + return US_TX_TXTAG; + case 59: + return US_TX_XPRESS_CARD; + case 60: + return US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD; + case 61: + return US_VA_EZPASSVA; + case 17: + return US_WA_BREEZEBY; + case 1: + return US_WA_GOOD_TO_GO; + case 62: + return US_WV_EZPASSWV; + case 63: + return US_WV_MEMORIAL_BRIDGE_TICKETS; + case 64: + return US_WV_NEWELL_TOLL_BRIDGE_TICKET; + 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 TollPass findValueByNumber(int number) { + return TollPass.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.routing.v2.TollPassesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final TollPass[] VALUES = values(); + + public static TollPass 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 TollPass(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.TollPass) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollPassesProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollPassesProto.java new file mode 100644 index 000000000000..c2008ea40f54 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/TollPassesProto.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 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/routing/v2/toll_passes.proto + +package com.google.maps.routing.v2; + +public final class TollPassesProto { + private TollPassesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/maps/routing/v2/toll_passes.pro" + + "to\022\026google.maps.routing.v2*\201\021\n\010TollPass\022" + + "\031\n\025TOLL_PASS_UNSPECIFIED\020\000\022\020\n\014AU_ETOLL_T" + + "AG\020R\022\017\n\013AU_EWAY_TAG\020S\022\014\n\010AU_LINKT\020\002\022\017\n\013A" + + "R_TELEPASE\020\003\022\023\n\017BR_AUTO_EXPRESO\020Q\022\020\n\014BR_" + + "CONECTCAR\020\007\022\020\n\014BR_MOVE_MAIS\020\010\022\023\n\017BR_PASS" + + "A_RAPIDO\020X\022\020\n\014BR_SEM_PARAR\020\t\022\014\n\010BR_TAGGY" + + "\020\n\022\014\n\010BR_VELOE\020\013\022)\n%CA_US_AKWASASNE_SEAW" + + "AY_CORPORATE_CARD\020T\022\'\n#CA_US_AKWASASNE_S" + + "EAWAY_TRANSIT_CARD\020U\022\036\n\032CA_US_BLUE_WATER" + + "_EDGE_PASS\020\022\022\023\n\017CA_US_CONNEXION\020\023\022\024\n\020CA_" + + "US_NEXUS_CARD\020\024\022\r\n\tID_E_TOLL\020\020\022\r\n\tIN_FAS" + + "TAG\020N\022\034\n\030IN_LOCAL_HP_PLATE_EXEMPT\020O\022\013\n\007M" + + "X_IAVE\020Z\022\013\n\007MX_PASE\020[\022\020\n\014MX_QUICKPASS\020]\022" + + "\"\n\036MX_SISTEMA_TELEPEAJE_CHIHUAHUA\020Y\022\017\n\013M" + + "X_TAG_IAVE\020\014\022\022\n\016MX_TAG_TELEVIA\020\r\022\016\n\nMX_T" + + "ELEVIA\020\\\022\016\n\nMX_VIAPASS\020\016\022\026\n\022US_AL_FREEDO" + + "M_PASS\020\025\0222\n.US_AK_ANTON_ANDERSON_TUNNEL_" + + "BOOK_OF_10_TICKETS\020\026\022\021\n\rUS_CA_FASTRAK\020\004\022" + + "\035\n\031US_CA_FASTRAK_CAV_STICKER\020V\022\025\n\021US_CO_" + + "EXPRESSTOLL\020\027\022\021\n\rUS_CO_GO_PASS\020\030\022\022\n\016US_D" + + "E_EZPASSDE\020\031\022$\n US_FL_BOB_SIKES_TOLL_BRI" + + "DGE_PASS\020A\022:\n6US_FL_DUNES_COMMUNITY_DEVE" + + "LOPMENT_DISTRICT_EXPRESSCARD\020B\022\017\n\013US_FL_" + + "EPASS\020C\022\030\n\024US_FL_GIBA_TOLL_PASS\020D\022\020\n\014US_" + + "FL_LEEWAY\020E\022\021\n\rUS_FL_SUNPASS\020F\022\025\n\021US_FL_" + + "SUNPASS_PRO\020G\022\022\n\016US_IL_EZPASSIL\020I\022\017\n\013US_" + + "IL_IPASS\020H\022\022\n\016US_IN_EZPASSIN\020\032\022\032\n\026US_KS_" + + "BESTPASS_HORIZON\020\033\022\016\n\nUS_KS_KTAG\020\034\022\026\n\022US" + + "_KS_NATIONALPASS\020\035\022\033\n\027US_KS_PREPASS_ELIT" + + "EPASS\020\036\022\023\n\017US_KY_RIVERLINK\020\037\022\023\n\017US_LA_GE" + + "AUXPASS\020 \022\022\n\016US_LA_TOLL_TAG\020!\022\022\n\016US_MA_E" + + "ZPASSMA\020\006\022\022\n\016US_MD_EZPASSMD\020\"\022\022\n\016US_ME_E" + + "ZPASSME\020#\0221\n-US_MI_AMBASSADOR_BRIDGE_PRE" + + "MIER_COMMUTER_CARD\020$\022)\n%US_MI_GROSSE_ILE" + + "_TOLL_BRIDGE_PASS_TAG\020%\022\026\n\022US_MI_IQ_PROX" + + "_CARD\020&\022\"\n\036US_MI_MACKINAC_BRIDGE_MAC_PAS" + + "S\020\'\022\027\n\023US_MI_NEXPRESS_TOLL\020(\022\022\n\016US_MN_EZ" + + "PASSMN\020)\022\022\n\016US_NC_EZPASSNC\020*\022\024\n\020US_NC_PE" + + "ACH_PASS\020W\022\024\n\020US_NC_QUICK_PASS\020+\022\022\n\016US_N" + + "H_EZPASSNH\020P\022 \n\034US_NJ_DOWNBEACH_EXPRESS_" + + "PASS\020K\022\022\n\016US_NJ_EZPASSNJ\020J\022\025\n\021US_NY_EXPR" + + "ESSPASS\020L\022\022\n\016US_NY_EZPASSNY\020M\022\022\n\016US_OH_E" + + "ZPASSOH\020,\022\022\n\016US_PA_EZPASSPA\020-\022\022\n\016US_RI_E" + + "ZPASSRI\020.\022\021\n\rUS_SC_PALPASS\020/\022\022\n\016US_TX_BA" + + "NCPASS\0200\022\026\n\022US_TX_DEL_RIO_PASS\0201\022\024\n\020US_T" + + "X_EFAST_PASS\0202\022!\n\035US_TX_EAGLE_PASS_EXPRE" + + "SS_CARD\0203\022\020\n\014US_TX_EPTOLL\0204\022\022\n\016US_TX_EZ_" + + "CROSS\0205\022\017\n\013US_TX_EZTAG\0206\022\032\n\026US_TX_LAREDO" + + "_TRADE_TAG\0207\022\022\n\016US_TX_PLUSPASS\0208\022\021\n\rUS_T" + + "X_TOLLTAG\0209\022\017\n\013US_TX_TXTAG\020:\022\025\n\021US_TX_XP" + + "RESS_CARD\020;\022\'\n#US_UT_ADAMS_AVE_PARKWAY_E" + + "XPRESSCARD\020<\022\022\n\016US_VA_EZPASSVA\020=\022\022\n\016US_W" + + "A_BREEZEBY\020\021\022\024\n\020US_WA_GOOD_TO_GO\020\001\022\022\n\016US" + + "_WV_EZPASSWV\020>\022!\n\035US_WV_MEMORIAL_BRIDGE_" + + "TICKETS\020?\022#\n\037US_WV_NEWELL_TOLL_BRIDGE_TI" + + "CKET\020@B\307\001\n\032com.google.maps.routing.v2B\017T" + + "ollPassesProtoP\001Z=google.golang.org/genp" + + "roto/googleapis/maps/routing/v2;routing\370" + + "\001\001\242\002\005GMRV2\252\002\026Google.Maps.Routing.V2\312\002\026Go" + + "ogle\\Maps\\Routing\\V2\352\002\031Google::Maps::Rou" + + "ting::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Units.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Units.java new file mode 100644 index 000000000000..1b67a78379a8 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Units.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 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/routing/v2/units.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A set of values that specify the unit of measure used in the display.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.Units} + */ +public enum Units implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Units of measure not specified. Defaults to the unit of measure inferred
+   * from the request.
+   * 
+ * + * UNITS_UNSPECIFIED = 0; + */ + UNITS_UNSPECIFIED(0), + /** + * + * + *
+   * Metric units of measure.
+   * 
+ * + * METRIC = 1; + */ + METRIC(1), + /** + * + * + *
+   * Imperial (English) units of measure.
+   * 
+ * + * IMPERIAL = 2; + */ + IMPERIAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Units of measure not specified. Defaults to the unit of measure inferred
+   * from the request.
+   * 
+ * + * UNITS_UNSPECIFIED = 0; + */ + public static final int UNITS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Metric units of measure.
+   * 
+ * + * METRIC = 1; + */ + public static final int METRIC_VALUE = 1; + /** + * + * + *
+   * Imperial (English) units of measure.
+   * 
+ * + * IMPERIAL = 2; + */ + public static final int IMPERIAL_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 Units 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 Units forNumber(int value) { + switch (value) { + case 0: + return UNITS_UNSPECIFIED; + case 1: + return METRIC; + case 2: + return IMPERIAL; + 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 Units findValueByNumber(int number) { + return Units.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.routing.v2.UnitsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Units[] VALUES = values(); + + public static Units 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 Units(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.Units) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/UnitsProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/UnitsProto.java new file mode 100644 index 000000000000..cc81ec25ded8 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/UnitsProto.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 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/routing/v2/units.proto + +package com.google.maps.routing.v2; + +public final class UnitsProto { + private UnitsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\"google/maps/routing/v2/units.proto\022\026go" + + "ogle.maps.routing.v2*8\n\005Units\022\025\n\021UNITS_U" + + "NSPECIFIED\020\000\022\n\n\006METRIC\020\001\022\014\n\010IMPERIAL\020\002B\302" + + "\001\n\032com.google.maps.routing.v2B\nUnitsProt" + + "oP\001Z=google.golang.org/genproto/googleap" + + "is/maps/routing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026" + + "Google.Maps.Routing.V2\312\002\026Google\\Maps\\Rou" + + "ting\\V2\352\002\031Google::Maps::Routing::V2b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleEmissionType.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleEmissionType.java new file mode 100644 index 000000000000..803f9265f976 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleEmissionType.java @@ -0,0 +1,226 @@ +/* + * Copyright 2020 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/routing/v2/vehicle_emission_type.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * A set of values describing the vehicle's emission type.
+ * Applies only to the DRIVE travel mode.
+ * 
+ * + * Protobuf enum {@code google.maps.routing.v2.VehicleEmissionType} + */ +public enum VehicleEmissionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No emission type specified. Default to GASOLINE.
+   * 
+ * + * VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0; + */ + VEHICLE_EMISSION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Gasoline/petrol fueled vehicle.
+   * 
+ * + * GASOLINE = 1; + */ + GASOLINE(1), + /** + * + * + *
+   * Electricity powered vehicle.
+   * 
+ * + * ELECTRIC = 2; + */ + ELECTRIC(2), + /** + * + * + *
+   * Hybrid fuel (such as gasoline + electric) vehicle.
+   * 
+ * + * HYBRID = 3; + */ + HYBRID(3), + /** + * + * + *
+   * Diesel fueled vehicle.
+   * 
+ * + * DIESEL = 4; + */ + DIESEL(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No emission type specified. Default to GASOLINE.
+   * 
+ * + * VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0; + */ + public static final int VEHICLE_EMISSION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Gasoline/petrol fueled vehicle.
+   * 
+ * + * GASOLINE = 1; + */ + public static final int GASOLINE_VALUE = 1; + /** + * + * + *
+   * Electricity powered vehicle.
+   * 
+ * + * ELECTRIC = 2; + */ + public static final int ELECTRIC_VALUE = 2; + /** + * + * + *
+   * Hybrid fuel (such as gasoline + electric) vehicle.
+   * 
+ * + * HYBRID = 3; + */ + public static final int HYBRID_VALUE = 3; + /** + * + * + *
+   * Diesel fueled vehicle.
+   * 
+ * + * DIESEL = 4; + */ + public static final int DIESEL_VALUE = 4; + + 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 VehicleEmissionType 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 VehicleEmissionType forNumber(int value) { + switch (value) { + case 0: + return VEHICLE_EMISSION_TYPE_UNSPECIFIED; + case 1: + return GASOLINE; + case 2: + return ELECTRIC; + case 3: + return HYBRID; + case 4: + return DIESEL; + 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 VehicleEmissionType findValueByNumber(int number) { + return VehicleEmissionType.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.routing.v2.VehicleEmissionTypeProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final VehicleEmissionType[] VALUES = values(); + + public static VehicleEmissionType 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 VehicleEmissionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.routing.v2.VehicleEmissionType) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleEmissionTypeProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleEmissionTypeProto.java new file mode 100644 index 000000000000..c8d9ac7c9dcc --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleEmissionTypeProto.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 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/routing/v2/vehicle_emission_type.proto + +package com.google.maps.routing.v2; + +public final class VehicleEmissionTypeProto { + private VehicleEmissionTypeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/maps/routing/v2/vehicle_emissio" + + "n_type.proto\022\026google.maps.routing.v2*p\n\023" + + "VehicleEmissionType\022%\n!VEHICLE_EMISSION_" + + "TYPE_UNSPECIFIED\020\000\022\014\n\010GASOLINE\020\001\022\014\n\010ELEC" + + "TRIC\020\002\022\n\n\006HYBRID\020\003\022\n\n\006DIESEL\020\004B\320\001\n\032com.g" + + "oogle.maps.routing.v2B\030VehicleEmissionTy" + + "peProtoP\001Z=google.golang.org/genproto/go" + + "ogleapis/maps/routing/v2;routing\370\001\001\242\002\005GM" + + "RV2\252\002\026Google.Maps.Routing.V2\312\002\026Google\\Ma" + + "ps\\Routing\\V2\352\002\031Google::Maps::Routing::V" + + "2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfo.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfo.java new file mode 100644 index 000000000000..6a11f5ebfb4d --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfo.java @@ -0,0 +1,597 @@ +/* + * Copyright 2020 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/routing/v2/vehicle_info.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates the vehicle information, such as the license plate last
+ * character.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.VehicleInfo} + */ +public final class VehicleInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.VehicleInfo) + VehicleInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use VehicleInfo.newBuilder() to construct. + private VehicleInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VehicleInfo() { + emissionType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VehicleInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.VehicleInfoProto + .internal_static_google_maps_routing_v2_VehicleInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.VehicleInfoProto + .internal_static_google_maps_routing_v2_VehicleInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.VehicleInfo.class, + com.google.maps.routing.v2.VehicleInfo.Builder.class); + } + + public static final int EMISSION_TYPE_FIELD_NUMBER = 2; + private int emissionType_; + /** + * + * + *
+   * Describes the vehicle's emission type.
+   * Applies only to the DRIVE travel mode.
+   * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return The enum numeric value on the wire for emissionType. + */ + @java.lang.Override + public int getEmissionTypeValue() { + return emissionType_; + } + /** + * + * + *
+   * Describes the vehicle's emission type.
+   * Applies only to the DRIVE travel mode.
+   * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return The emissionType. + */ + @java.lang.Override + public com.google.maps.routing.v2.VehicleEmissionType getEmissionType() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.VehicleEmissionType result = + com.google.maps.routing.v2.VehicleEmissionType.valueOf(emissionType_); + return result == null ? com.google.maps.routing.v2.VehicleEmissionType.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 (emissionType_ + != com.google.maps.routing.v2.VehicleEmissionType.VEHICLE_EMISSION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, emissionType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (emissionType_ + != com.google.maps.routing.v2.VehicleEmissionType.VEHICLE_EMISSION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, emissionType_); + } + 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.routing.v2.VehicleInfo)) { + return super.equals(obj); + } + com.google.maps.routing.v2.VehicleInfo other = (com.google.maps.routing.v2.VehicleInfo) obj; + + if (emissionType_ != other.emissionType_) 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) + EMISSION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + emissionType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.routing.v2.VehicleInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.VehicleInfo 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.routing.v2.VehicleInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.VehicleInfo 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.routing.v2.VehicleInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.VehicleInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.VehicleInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.VehicleInfo 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.routing.v2.VehicleInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.VehicleInfo 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.routing.v2.VehicleInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.VehicleInfo 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.routing.v2.VehicleInfo 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 the vehicle information, such as the license plate last
+   * character.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.VehicleInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.VehicleInfo) + com.google.maps.routing.v2.VehicleInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.VehicleInfoProto + .internal_static_google_maps_routing_v2_VehicleInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.VehicleInfoProto + .internal_static_google_maps_routing_v2_VehicleInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.VehicleInfo.class, + com.google.maps.routing.v2.VehicleInfo.Builder.class); + } + + // Construct using com.google.maps.routing.v2.VehicleInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + emissionType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.VehicleInfoProto + .internal_static_google_maps_routing_v2_VehicleInfo_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.VehicleInfo getDefaultInstanceForType() { + return com.google.maps.routing.v2.VehicleInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.VehicleInfo build() { + com.google.maps.routing.v2.VehicleInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.VehicleInfo buildPartial() { + com.google.maps.routing.v2.VehicleInfo result = + new com.google.maps.routing.v2.VehicleInfo(this); + result.emissionType_ = emissionType_; + 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.routing.v2.VehicleInfo) { + return mergeFrom((com.google.maps.routing.v2.VehicleInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.VehicleInfo other) { + if (other == com.google.maps.routing.v2.VehicleInfo.getDefaultInstance()) return this; + if (other.emissionType_ != 0) { + setEmissionTypeValue(other.getEmissionTypeValue()); + } + 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: + { + emissionType_ = input.readEnum(); + + 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 emissionType_ = 0; + /** + * + * + *
+     * Describes the vehicle's emission type.
+     * Applies only to the DRIVE travel mode.
+     * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return The enum numeric value on the wire for emissionType. + */ + @java.lang.Override + public int getEmissionTypeValue() { + return emissionType_; + } + /** + * + * + *
+     * Describes the vehicle's emission type.
+     * Applies only to the DRIVE travel mode.
+     * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @param value The enum numeric value on the wire for emissionType to set. + * @return This builder for chaining. + */ + public Builder setEmissionTypeValue(int value) { + + emissionType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Describes the vehicle's emission type.
+     * Applies only to the DRIVE travel mode.
+     * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return The emissionType. + */ + @java.lang.Override + public com.google.maps.routing.v2.VehicleEmissionType getEmissionType() { + @SuppressWarnings("deprecation") + com.google.maps.routing.v2.VehicleEmissionType result = + com.google.maps.routing.v2.VehicleEmissionType.valueOf(emissionType_); + return result == null ? com.google.maps.routing.v2.VehicleEmissionType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Describes the vehicle's emission type.
+     * Applies only to the DRIVE travel mode.
+     * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @param value The emissionType to set. + * @return This builder for chaining. + */ + public Builder setEmissionType(com.google.maps.routing.v2.VehicleEmissionType value) { + if (value == null) { + throw new NullPointerException(); + } + + emissionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Describes the vehicle's emission type.
+     * Applies only to the DRIVE travel mode.
+     * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearEmissionType() { + + emissionType_ = 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.routing.v2.VehicleInfo) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.VehicleInfo) + private static final com.google.maps.routing.v2.VehicleInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.VehicleInfo(); + } + + public static com.google.maps.routing.v2.VehicleInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VehicleInfo 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.routing.v2.VehicleInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfoOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfoOrBuilder.java new file mode 100644 index 000000000000..b5cfc41e2b51 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfoOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 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/routing/v2/vehicle_info.proto + +package com.google.maps.routing.v2; + +public interface VehicleInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.VehicleInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Describes the vehicle's emission type.
+   * Applies only to the DRIVE travel mode.
+   * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return The enum numeric value on the wire for emissionType. + */ + int getEmissionTypeValue(); + /** + * + * + *
+   * Describes the vehicle's emission type.
+   * Applies only to the DRIVE travel mode.
+   * 
+ * + * .google.maps.routing.v2.VehicleEmissionType emission_type = 2; + * + * @return The emissionType. + */ + com.google.maps.routing.v2.VehicleEmissionType getEmissionType(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfoProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfoProto.java new file mode 100644 index 000000000000..9b6b78cf0360 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/VehicleInfoProto.java @@ -0,0 +1,73 @@ +/* + * Copyright 2020 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/routing/v2/vehicle_info.proto + +package com.google.maps.routing.v2; + +public final class VehicleInfoProto { + private VehicleInfoProto() {} + + 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_routing_v2_VehicleInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_VehicleInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/maps/routing/v2/vehicle_info.pr" + + "oto\022\026google.maps.routing.v2\0322google/maps" + + "/routing/v2/vehicle_emission_type.proto\"" + + "Q\n\013VehicleInfo\022B\n\remission_type\030\002 \001(\0162+." + + "google.maps.routing.v2.VehicleEmissionTy" + + "peB\310\001\n\032com.google.maps.routing.v2B\020Vehic" + + "leInfoProtoP\001Z=google.golang.org/genprot" + + "o/googleapis/maps/routing/v2;routing\370\001\001\242" + + "\002\005GMRV2\252\002\026Google.Maps.Routing.V2\312\002\026Googl" + + "e\\Maps\\Routing\\V2\352\002\031Google::Maps::Routin" + + "g::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.maps.routing.v2.VehicleEmissionTypeProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_VehicleInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_VehicleInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_VehicleInfo_descriptor, + new java.lang.String[] { + "EmissionType", + }); + com.google.maps.routing.v2.VehicleEmissionTypeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Waypoint.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Waypoint.java new file mode 100644 index 000000000000..cd404bd844db --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/Waypoint.java @@ -0,0 +1,1404 @@ +/* + * Copyright 2020 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/routing/v2/waypoint.proto + +package com.google.maps.routing.v2; + +/** + * + * + *
+ * Encapsulates a waypoint. Waypoints mark both the beginning and end of a
+ * route, and include intermediate stops along the route.
+ * 
+ * + * Protobuf type {@code google.maps.routing.v2.Waypoint} + */ +public final class Waypoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.routing.v2.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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.WaypointProto + .internal_static_google_maps_routing_v2_Waypoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.WaypointProto + .internal_static_google_maps_routing_v2_Waypoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Waypoint.class, + com.google.maps.routing.v2.Waypoint.Builder.class); + } + + private int locationTypeCase_ = 0; + 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.routing.v2.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.routing.v2.Location location = 1; + * + * @return The location. + */ + @java.lang.Override + public com.google.maps.routing.v2.Location getLocation() { + if (locationTypeCase_ == 1) { + return (com.google.maps.routing.v2.Location) locationType_; + } + return com.google.maps.routing.v2.Location.getDefaultInstance(); + } + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routing.v2.Location location = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.LocationOrBuilder getLocationOrBuilder() { + if (locationTypeCase_ == 1) { + return (com.google.maps.routing.v2.Location) locationType_; + } + return com.google.maps.routing.v2.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 VIA_FIELD_NUMBER = 3; + private boolean via_; + /** + * + * + *
+   * Marks this waypoint as a milestone rather a stopping point. For
+   * each non-via waypoint in the request, the response appends an entry to the
+   * `legs` array to provide the details for stopovers on that leg of the
+   * trip. Set this value to true when you want the route to pass through this
+   * waypoint without stopping over. Via waypoints don't cause an entry to be
+   * added to the `legs` array, but they do route the journey through the
+   * waypoint. You can only set this value on waypoints that are intermediates.
+   * The request fails if you set this field on terminal waypoints.
+   * If `ComputeRoutesRequest.optimize_waypoint_order`
+   * is set to true then this field cannot be set to
+   * true; otherwise, the request fails.
+   * 
+ * + * bool via = 3; + * + * @return The via. + */ + @java.lang.Override + public boolean getVia() { + return via_; + } + + public static final int VEHICLE_STOPOVER_FIELD_NUMBER = 4; + private boolean vehicleStopover_; + /** + * + * + *
+   * Indicates that the waypoint is meant for vehicles to stop at, where the
+   * intention is to either pickup or drop-off. When you set this value, the
+   * calculated route won't include non-`via` waypoints on roads that are
+   * unsuitable for pickup and drop-off. This option works only for `DRIVE` and
+   * `TWO_WHEELER` travel modes, and when the `location_type` is `location`.
+   * 
+ * + * bool vehicle_stopover = 4; + * + * @return The vehicleStopover. + */ + @java.lang.Override + public boolean getVehicleStopover() { + return vehicleStopover_; + } + + public static final int SIDE_OF_ROAD_FIELD_NUMBER = 5; + private boolean sideOfRoad_; + /** + * + * + *
+   * 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 works only for 'DRIVE' and 'TWO_WHEELER'
+   * travel modes.
+   * 
+ * + * bool side_of_road = 5; + * + * @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.routing.v2.Location) locationType_); + } + if (locationTypeCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, locationType_); + } + if (via_ != false) { + output.writeBool(3, via_); + } + if (vehicleStopover_ != false) { + output.writeBool(4, vehicleStopover_); + } + if (sideOfRoad_ != false) { + output.writeBool(5, 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.routing.v2.Location) locationType_); + } + if (locationTypeCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, locationType_); + } + if (via_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, via_); + } + if (vehicleStopover_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, vehicleStopover_); + } + if (sideOfRoad_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, 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.routing.v2.Waypoint)) { + return super.equals(obj); + } + com.google.maps.routing.v2.Waypoint other = (com.google.maps.routing.v2.Waypoint) obj; + + if (getVia() != other.getVia()) return false; + if (getVehicleStopover() != other.getVehicleStopover()) return false; + 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) + VIA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVia()); + hash = (37 * hash) + VEHICLE_STOPOVER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getVehicleStopover()); + 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.routing.v2.Waypoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.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.routing.v2.Waypoint parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.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.routing.v2.Waypoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.routing.v2.Waypoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.routing.v2.Waypoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.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.routing.v2.Waypoint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.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.routing.v2.Waypoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.routing.v2.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.routing.v2.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 both the beginning and end of a
+   * route, and include intermediate stops along the route.
+   * 
+ * + * Protobuf type {@code google.maps.routing.v2.Waypoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.routing.v2.Waypoint) + com.google.maps.routing.v2.WaypointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.routing.v2.WaypointProto + .internal_static_google_maps_routing_v2_Waypoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.routing.v2.WaypointProto + .internal_static_google_maps_routing_v2_Waypoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.routing.v2.Waypoint.class, + com.google.maps.routing.v2.Waypoint.Builder.class); + } + + // Construct using com.google.maps.routing.v2.Waypoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (locationBuilder_ != null) { + locationBuilder_.clear(); + } + via_ = false; + + vehicleStopover_ = false; + + sideOfRoad_ = false; + + locationTypeCase_ = 0; + locationType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.routing.v2.WaypointProto + .internal_static_google_maps_routing_v2_Waypoint_descriptor; + } + + @java.lang.Override + public com.google.maps.routing.v2.Waypoint getDefaultInstanceForType() { + return com.google.maps.routing.v2.Waypoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.routing.v2.Waypoint build() { + com.google.maps.routing.v2.Waypoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.routing.v2.Waypoint buildPartial() { + com.google.maps.routing.v2.Waypoint result = new com.google.maps.routing.v2.Waypoint(this); + if (locationTypeCase_ == 1) { + if (locationBuilder_ == null) { + result.locationType_ = locationType_; + } else { + result.locationType_ = locationBuilder_.build(); + } + } + if (locationTypeCase_ == 2) { + result.locationType_ = locationType_; + } + result.via_ = via_; + result.vehicleStopover_ = vehicleStopover_; + result.sideOfRoad_ = sideOfRoad_; + result.locationTypeCase_ = locationTypeCase_; + 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.routing.v2.Waypoint) { + return mergeFrom((com.google.maps.routing.v2.Waypoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.routing.v2.Waypoint other) { + if (other == com.google.maps.routing.v2.Waypoint.getDefaultInstance()) return this; + if (other.getVia() != false) { + setVia(other.getVia()); + } + if (other.getVehicleStopover() != false) { + setVehicleStopover(other.getVehicleStopover()); + } + 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: + { + via_ = input.readBool(); + + break; + } // case 24 + case 32: + { + vehicleStopover_ = input.readBool(); + + break; + } // case 32 + case 40: + { + sideOfRoad_ = input.readBool(); + + break; + } // case 40 + 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 com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + locationBuilder_; + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routing.v2.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.routing.v2.Location location = 1; + * + * @return The location. + */ + @java.lang.Override + public com.google.maps.routing.v2.Location getLocation() { + if (locationBuilder_ == null) { + if (locationTypeCase_ == 1) { + return (com.google.maps.routing.v2.Location) locationType_; + } + return com.google.maps.routing.v2.Location.getDefaultInstance(); + } else { + if (locationTypeCase_ == 1) { + return locationBuilder_.getMessage(); + } + return com.google.maps.routing.v2.Location.getDefaultInstance(); + } + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routing.v2.Location location = 1; + */ + public Builder setLocation(com.google.maps.routing.v2.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.routing.v2.Location location = 1; + */ + public Builder setLocation(com.google.maps.routing.v2.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.routing.v2.Location location = 1; + */ + public Builder mergeLocation(com.google.maps.routing.v2.Location value) { + if (locationBuilder_ == null) { + if (locationTypeCase_ == 1 + && locationType_ != com.google.maps.routing.v2.Location.getDefaultInstance()) { + locationType_ = + com.google.maps.routing.v2.Location.newBuilder( + (com.google.maps.routing.v2.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.routing.v2.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.routing.v2.Location location = 1; + */ + public com.google.maps.routing.v2.Location.Builder getLocationBuilder() { + return getLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routing.v2.Location location = 1; + */ + @java.lang.Override + public com.google.maps.routing.v2.LocationOrBuilder getLocationOrBuilder() { + if ((locationTypeCase_ == 1) && (locationBuilder_ != null)) { + return locationBuilder_.getMessageOrBuilder(); + } else { + if (locationTypeCase_ == 1) { + return (com.google.maps.routing.v2.Location) locationType_; + } + return com.google.maps.routing.v2.Location.getDefaultInstance(); + } + } + /** + * + * + *
+     * A point specified using geographic coordinates, including an optional
+     * heading.
+     * 
+ * + * .google.maps.routing.v2.Location location = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + if (!(locationTypeCase_ == 1)) { + locationType_ = com.google.maps.routing.v2.Location.getDefaultInstance(); + } + locationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.routing.v2.Location, + com.google.maps.routing.v2.Location.Builder, + com.google.maps.routing.v2.LocationOrBuilder>( + (com.google.maps.routing.v2.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 via_; + /** + * + * + *
+     * Marks this waypoint as a milestone rather a stopping point. For
+     * each non-via waypoint in the request, the response appends an entry to the
+     * `legs` array to provide the details for stopovers on that leg of the
+     * trip. Set this value to true when you want the route to pass through this
+     * waypoint without stopping over. Via waypoints don't cause an entry to be
+     * added to the `legs` array, but they do route the journey through the
+     * waypoint. You can only set this value on waypoints that are intermediates.
+     * The request fails if you set this field on terminal waypoints.
+     * If `ComputeRoutesRequest.optimize_waypoint_order`
+     * is set to true then this field cannot be set to
+     * true; otherwise, the request fails.
+     * 
+ * + * bool via = 3; + * + * @return The via. + */ + @java.lang.Override + public boolean getVia() { + return via_; + } + /** + * + * + *
+     * Marks this waypoint as a milestone rather a stopping point. For
+     * each non-via waypoint in the request, the response appends an entry to the
+     * `legs` array to provide the details for stopovers on that leg of the
+     * trip. Set this value to true when you want the route to pass through this
+     * waypoint without stopping over. Via waypoints don't cause an entry to be
+     * added to the `legs` array, but they do route the journey through the
+     * waypoint. You can only set this value on waypoints that are intermediates.
+     * The request fails if you set this field on terminal waypoints.
+     * If `ComputeRoutesRequest.optimize_waypoint_order`
+     * is set to true then this field cannot be set to
+     * true; otherwise, the request fails.
+     * 
+ * + * bool via = 3; + * + * @param value The via to set. + * @return This builder for chaining. + */ + public Builder setVia(boolean value) { + + via_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Marks this waypoint as a milestone rather a stopping point. For
+     * each non-via waypoint in the request, the response appends an entry to the
+     * `legs` array to provide the details for stopovers on that leg of the
+     * trip. Set this value to true when you want the route to pass through this
+     * waypoint without stopping over. Via waypoints don't cause an entry to be
+     * added to the `legs` array, but they do route the journey through the
+     * waypoint. You can only set this value on waypoints that are intermediates.
+     * The request fails if you set this field on terminal waypoints.
+     * If `ComputeRoutesRequest.optimize_waypoint_order`
+     * is set to true then this field cannot be set to
+     * true; otherwise, the request fails.
+     * 
+ * + * bool via = 3; + * + * @return This builder for chaining. + */ + public Builder clearVia() { + + via_ = false; + onChanged(); + return this; + } + + private boolean vehicleStopover_; + /** + * + * + *
+     * Indicates that the waypoint is meant for vehicles to stop at, where the
+     * intention is to either pickup or drop-off. When you set this value, the
+     * calculated route won't include non-`via` waypoints on roads that are
+     * unsuitable for pickup and drop-off. This option works only for `DRIVE` and
+     * `TWO_WHEELER` travel modes, and when the `location_type` is `location`.
+     * 
+ * + * bool vehicle_stopover = 4; + * + * @return The vehicleStopover. + */ + @java.lang.Override + public boolean getVehicleStopover() { + return vehicleStopover_; + } + /** + * + * + *
+     * Indicates that the waypoint is meant for vehicles to stop at, where the
+     * intention is to either pickup or drop-off. When you set this value, the
+     * calculated route won't include non-`via` waypoints on roads that are
+     * unsuitable for pickup and drop-off. This option works only for `DRIVE` and
+     * `TWO_WHEELER` travel modes, and when the `location_type` is `location`.
+     * 
+ * + * bool vehicle_stopover = 4; + * + * @param value The vehicleStopover to set. + * @return This builder for chaining. + */ + public Builder setVehicleStopover(boolean value) { + + vehicleStopover_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates that the waypoint is meant for vehicles to stop at, where the
+     * intention is to either pickup or drop-off. When you set this value, the
+     * calculated route won't include non-`via` waypoints on roads that are
+     * unsuitable for pickup and drop-off. This option works only for `DRIVE` and
+     * `TWO_WHEELER` travel modes, and when the `location_type` is `location`.
+     * 
+ * + * bool vehicle_stopover = 4; + * + * @return This builder for chaining. + */ + public Builder clearVehicleStopover() { + + vehicleStopover_ = false; + onChanged(); + return this; + } + + private boolean sideOfRoad_; + /** + * + * + *
+     * 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 works only for 'DRIVE' and 'TWO_WHEELER'
+     * travel modes.
+     * 
+ * + * bool side_of_road = 5; + * + * @return The sideOfRoad. + */ + @java.lang.Override + public boolean getSideOfRoad() { + return sideOfRoad_; + } + /** + * + * + *
+     * 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 works only for 'DRIVE' and 'TWO_WHEELER'
+     * travel modes.
+     * 
+ * + * bool side_of_road = 5; + * + * @param value The sideOfRoad to set. + * @return This builder for chaining. + */ + public Builder setSideOfRoad(boolean value) { + + sideOfRoad_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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 works only for 'DRIVE' and 'TWO_WHEELER'
+     * travel modes.
+     * 
+ * + * bool side_of_road = 5; + * + * @return This builder for chaining. + */ + public Builder clearSideOfRoad() { + + 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.routing.v2.Waypoint) + } + + // @@protoc_insertion_point(class_scope:google.maps.routing.v2.Waypoint) + private static final com.google.maps.routing.v2.Waypoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.routing.v2.Waypoint(); + } + + public static com.google.maps.routing.v2.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.routing.v2.Waypoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/WaypointOrBuilder.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/WaypointOrBuilder.java new file mode 100644 index 000000000000..01e9e24bfa2b --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/WaypointOrBuilder.java @@ -0,0 +1,160 @@ +/* + * Copyright 2020 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/routing/v2/waypoint.proto + +package com.google.maps.routing.v2; + +public interface WaypointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.routing.v2.Waypoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routing.v2.Location location = 1; + * + * @return Whether the location field is set. + */ + boolean hasLocation(); + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routing.v2.Location location = 1; + * + * @return The location. + */ + com.google.maps.routing.v2.Location getLocation(); + /** + * + * + *
+   * A point specified using geographic coordinates, including an optional
+   * heading.
+   * 
+ * + * .google.maps.routing.v2.Location location = 1; + */ + com.google.maps.routing.v2.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(); + + /** + * + * + *
+   * Marks this waypoint as a milestone rather a stopping point. For
+   * each non-via waypoint in the request, the response appends an entry to the
+   * `legs` array to provide the details for stopovers on that leg of the
+   * trip. Set this value to true when you want the route to pass through this
+   * waypoint without stopping over. Via waypoints don't cause an entry to be
+   * added to the `legs` array, but they do route the journey through the
+   * waypoint. You can only set this value on waypoints that are intermediates.
+   * The request fails if you set this field on terminal waypoints.
+   * If `ComputeRoutesRequest.optimize_waypoint_order`
+   * is set to true then this field cannot be set to
+   * true; otherwise, the request fails.
+   * 
+ * + * bool via = 3; + * + * @return The via. + */ + boolean getVia(); + + /** + * + * + *
+   * Indicates that the waypoint is meant for vehicles to stop at, where the
+   * intention is to either pickup or drop-off. When you set this value, the
+   * calculated route won't include non-`via` waypoints on roads that are
+   * unsuitable for pickup and drop-off. This option works only for `DRIVE` and
+   * `TWO_WHEELER` travel modes, and when the `location_type` is `location`.
+   * 
+ * + * bool vehicle_stopover = 4; + * + * @return The vehicleStopover. + */ + boolean getVehicleStopover(); + + /** + * + * + *
+   * 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 works only for 'DRIVE' and 'TWO_WHEELER'
+   * travel modes.
+   * 
+ * + * bool side_of_road = 5; + * + * @return The sideOfRoad. + */ + boolean getSideOfRoad(); + + public com.google.maps.routing.v2.Waypoint.LocationTypeCase getLocationTypeCase(); +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/WaypointProto.java b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/WaypointProto.java new file mode 100644 index 000000000000..dfabac701a3f --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/java/com/google/maps/routing/v2/WaypointProto.java @@ -0,0 +1,74 @@ +/* + * Copyright 2020 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/routing/v2/waypoint.proto + +package com.google.maps.routing.v2; + +public final class WaypointProto { + private WaypointProto() {} + + 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_routing_v2_Waypoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_routing_v2_Waypoint_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/maps/routing/v2/waypoint.proto\022" + + "\026google.maps.routing.v2\032%google/maps/rou" + + "ting/v2/location.proto\"\242\001\n\010Waypoint\0224\n\010l" + + "ocation\030\001 \001(\0132 .google.maps.routing.v2.L" + + "ocationH\000\022\022\n\010place_id\030\002 \001(\tH\000\022\013\n\003via\030\003 \001" + + "(\010\022\030\n\020vehicle_stopover\030\004 \001(\010\022\024\n\014side_of_" + + "road\030\005 \001(\010B\017\n\rlocation_typeB\305\001\n\032com.goog" + + "le.maps.routing.v2B\rWaypointProtoP\001Z=goo" + + "gle.golang.org/genproto/googleapis/maps/" + + "routing/v2;routing\370\001\001\242\002\005GMRV2\252\002\026Google.M" + + "aps.Routing.V2\312\002\026Google\\Maps\\Routing\\V2\352" + + "\002\031Google::Maps::Routing::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.maps.routing.v2.LocationProto.getDescriptor(), + }); + internal_static_google_maps_routing_v2_Waypoint_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_routing_v2_Waypoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_routing_v2_Waypoint_descriptor, + new java.lang.String[] { + "Location", "PlaceId", "Via", "VehicleStopover", "SideOfRoad", "LocationType", + }); + com.google.maps.routing.v2.LocationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/fallback_info.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/fallback_info.proto new file mode 100644 index 000000000000..e8ba9520555f --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/fallback_info.proto @@ -0,0 +1,72 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "FallbackInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Information related to how and why a fallback result was used. If this field +// is set, then it means the server used a different routing mode from your +// preferred mode as fallback. +message FallbackInfo { + // Routing mode used for the response. If fallback was triggered, the mode + // may be different from routing preference set in the original client + // request. + FallbackRoutingMode routing_mode = 1; + + // The reason why fallback response was used instead of the original response. + // This field is only populated when the fallback mode is triggered and the + // fallback response is returned. + FallbackReason reason = 2; +} + +// Reasons for using fallback response. +enum FallbackReason { + // No fallback reason specified. + FALLBACK_REASON_UNSPECIFIED = 0; + + // A server error happened while calculating routes with your preferred + // routing mode, but we were able to return a result calculated by an + // alternative mode. + SERVER_ERROR = 1; + + // We were not able to finish the calculation with your preferred routing mode + // on time, but we were able to return a result calculated by an alternative + // mode. + LATENCY_EXCEEDED = 2; +} + +// Actual routing mode used for returned fallback response. +enum FallbackRoutingMode { + // Not used. + FALLBACK_ROUTING_MODE_UNSPECIFIED = 0; + + // Indicates the "TRAFFIC_UNAWARE" routing mode was used to compute the + // response. + FALLBACK_TRAFFIC_UNAWARE = 1; + + // Indicates the "TRAFFIC_AWARE" routing mode was used to compute the + // response. + FALLBACK_TRAFFIC_AWARE = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/location.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/location.proto new file mode 100644 index 000000000000..45c08b808ac1 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/location.proto @@ -0,0 +1,43 @@ +// Copyright 2022 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.routing.v2; + +import "google/protobuf/wrappers.proto"; +import "google/type/latlng.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// 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. You can use this + // field only for `DRIVE` and `TWO_WHEELER` travel modes. + google.protobuf.Int32Value heading = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/maneuver.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/maneuver.proto new file mode 100644 index 000000000000..b87f8f97f55d --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/maneuver.proto @@ -0,0 +1,88 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "ManeuverProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify the navigation action to take for the current +// step (e.g., turn left, merge, straight, etc.). +enum Maneuver { + // Not used. + MANEUVER_UNSPECIFIED = 0; + + // Turn slightly to the left. + TURN_SLIGHT_LEFT = 1; + + // Turn sharply to the left. + TURN_SHARP_LEFT = 2; + + // Make a left u-turn. + UTURN_LEFT = 3; + + // Turn left. + TURN_LEFT = 4; + + // Turn slightly to the right. + TURN_SLIGHT_RIGHT = 5; + + // Turn sharply to the right. + TURN_SHARP_RIGHT = 6; + + // Make a right u-turn. + UTURN_RIGHT = 7; + + // Turn right. + TURN_RIGHT = 8; + + // Go straight. + STRAIGHT = 9; + + // Take the left ramp. + RAMP_LEFT = 10; + + // Take the right ramp. + RAMP_RIGHT = 11; + + // Merge into traffic. + MERGE = 12; + + // Take the left fork. + FORK_LEFT = 13; + + // Take the right fork. + FORK_RIGHT = 14; + + // Take the ferry. + FERRY = 15; + + // Take the train leading onto the ferry. + FERRY_TRAIN = 16; + + // Turn left at the roundabout. + ROUNDABOUT_LEFT = 17; + + // Turn right at the roundabout. + ROUNDABOUT_RIGHT = 18; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/navigation_instruction.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/navigation_instruction.proto new file mode 100644 index 000000000000..dfe017cf5922 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/navigation_instruction.proto @@ -0,0 +1,40 @@ +// Copyright 2022 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.routing.v2; + +import "google/maps/routing/v2/maneuver.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "NavigationInstructionProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates navigation instructions for a +// [RouteLegStep][google.maps.routing.v2.RouteLegStep] +message NavigationInstruction { + // Encapsulates the navigation instructions for the current step (e.g., turn + // left, merge, straight, etc.). This field determines which icon to display. + Maneuver maneuver = 1; + + // Instructions for navigating this step. + string instructions = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/polyline.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/polyline.proto new file mode 100644 index 000000000000..19f6b2679473 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/polyline.proto @@ -0,0 +1,74 @@ +// Copyright 2022 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.routing.v2; + +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "PolylineProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates an encoded polyline. +message Polyline { + // Encapsulates the type of polyline. Defaults to encoded_polyline. + oneof polyline_type { + // The string encoding of the polyline using the [polyline encoding + // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) + string encoded_polyline = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) + google.protobuf.Struct geo_json_linestring = 2; + } +} + +// A set of values that specify the quality of the polyline. +enum PolylineQuality { + // No polyline quality preference specified. Defaults to `OVERVIEW`. + POLYLINE_QUALITY_UNSPECIFIED = 0; + + // Specifies a high-quality polyline - which is composed using more points + // than `OVERVIEW`, at the cost of increased response size. Use this value + // when you need more precision. + HIGH_QUALITY = 1; + + // Specifies an overview polyline - which is composed using a small number of + // points. Use this value when displaying an overview of the route. Using this + // option has a lower request latency compared to using the + // `HIGH_QUALITY` option. + OVERVIEW = 2; +} + +// Specifies the preferred type of polyline to be returned. +enum PolylineEncoding { + // No polyline type preference specified. Defaults to `ENCODED_POLYLINE`. + POLYLINE_ENCODING_UNSPECIFIED = 0; + + // Specifies a polyline encoded using the [polyline encoding + // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm). + ENCODED_POLYLINE = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) + GEO_JSON_LINESTRING = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route.proto new file mode 100644 index 000000000000..f78b22c7d694 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route.proto @@ -0,0 +1,223 @@ +// Copyright 2022 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.routing.v2; + +import "google/geo/type/viewport.proto"; +import "google/maps/routing/v2/location.proto"; +import "google/maps/routing/v2/navigation_instruction.proto"; +import "google/maps/routing/v2/polyline.proto"; +import "google/maps/routing/v2/route_label.proto"; +import "google/maps/routing/v2/speed_reading_interval.proto"; +import "google/maps/routing/v2/toll_info.proto"; +import "google/protobuf/duration.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a route, which consists of a series of connected road segments +// that join beginning, ending, and intermediate waypoints. +message Route { + // Labels for the `Route` that are useful to identify specific properties + // of the route to compare against others. + repeated RouteLabel route_labels = 13; + + // A collection of legs (path segments between waypoints) that make-up the + // route. Each leg corresponds to the trip between two non-`via` Waypoints. + // For example, a route with no intermediate waypoints has only one leg. A + // route that includes one non-`via` intermediate waypoint has two legs. A + // route that includes one `via` intermediate waypoint has one leg. The order + // of the legs matches the order of Waypoints from `origin` to `intermediates` + // to `destination`. + repeated RouteLeg legs = 1; + + // The travel distance of the route, in meters. + int32 distance_meters = 2; + + // The length of time needed to navigate the route. If you set the + // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If you set the `routing_preference` to either + // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated + // taking traffic conditions into account. + google.protobuf.Duration duration = 3; + + // The duration of traveling through the route without taking traffic + // conditions into consideration. + google.protobuf.Duration static_duration = 4; + + // The overall route polyline. This polyline will be the combined polyline of + // all `legs`. + Polyline polyline = 5; + + // A description of the route. + string description = 6; + + // An array of warnings to show when displaying the route. + repeated string warnings = 7; + + // The viewport bounding box of the polyline. + google.geo.type.Viewport viewport = 8; + + // Additional information about the route. + RouteTravelAdvisory travel_advisory = 9; + + // Web-safe base64 encoded route token that can be passed to NavigationSDK, + // which allows the Navigation SDK to reconstruct the route during navigation, + // and in the event of rerouting honor the original intention when Routes + // ComputeRoutes is called. Customers should treat this token as an + // opaque blob. + string route_token = 12; +} + +// Encapsulates the additional information that the user should be informed +// about, such as possible traffic zone restriction etc. +message RouteTravelAdvisory { + // Encapsulates information about tolls on the Route. + // This field is only populated if we expect there are tolls on the Route. + // If this field is set but the estimated_price subfield is not populated, + // we expect that road contains tolls but we do not know an estimated price. + // If this field is not set, then we expect there is no toll on the Route. + TollInfo toll_info = 2; + + // Speed reading intervals detailing traffic density. Applicable in case of + // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // The intervals cover the entire polyline of the route without overlap. + // The start point of a specified interval is the same as the end point of the + // preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 3; + + // The fuel consumption prediction in microliters. + int64 fuel_consumption_microliters = 5; +} + +// Encapsulates the additional information that the user should be informed +// about, such as possible traffic zone restriction etc. on a route leg. +message RouteLegTravelAdvisory { + // Encapsulates information about tolls on the specific RouteLeg. + // This field is only populated if we expect there are tolls on the RouteLeg. + // If this field is set but the estimated_price subfield is not populated, + // we expect that road contains tolls but we do not know an estimated price. + // If this field does not exist, then there is no toll on the RouteLeg. + TollInfo toll_info = 1; + + // Speed reading intervals detailing traffic density. Applicable in case of + // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // The intervals cover the entire polyline of the RouteLg without overlap. + // The start point of a specified interval is the same as the end point of the + // preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 2; +} + +// Encapsulates the additional information that the user should be informed +// about, such as possible traffic zone restriction on a leg step. +message RouteLegStepTravelAdvisory { + // Speed reading intervals detailing traffic density. Applicable in case of + // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // The intervals cover the entire polyline of the RouteLegStep without + // overlap. The start point of a specified interval is the same as the end + // point of the preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 1; +} + +// Encapsulates a segment between non-`via` waypoints. +message RouteLeg { + // The travel distance of the route leg, in meters. + int32 distance_meters = 1; + + // The length of time needed to navigate the leg. If the `route_preference` + // is set to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic + // conditions into account. + google.protobuf.Duration duration = 2; + + // The duration of traveling through the leg, calculated without taking + // traffic conditions into consideration. + google.protobuf.Duration static_duration = 3; + + // The overall polyline for this leg. This includes that each `step`'s + // polyline. + Polyline polyline = 4; + + // The start location of this leg. This might be different from the provided + // `origin`. For example, when the provided `origin` is not near a road, this + // is a point on the road. + Location start_location = 5; + + // The end location of this leg. This might be different from the provided + // `destination`. For example, when the provided `destination` is not near a + // road, this is a point on the road. + Location end_location = 6; + + // An array of steps denoting segments within this leg. Each step represents + // one navigation instruction. + repeated RouteLegStep steps = 7; + + // Encapsulates the additional information that the user should be informed + // about, such as possible traffic zone restriction etc. on a route leg. + RouteLegTravelAdvisory travel_advisory = 8; +} + +// Encapsulates a segment of a `RouteLeg`. A step corresponds to a single +// navigation instruction. Route legs are made up of steps. +message RouteLegStep { + // The travel distance of this step, in meters. In some circumstances, this + // field might not have a value. + int32 distance_meters = 1; + + // The duration of travel through this step without taking traffic conditions + // into consideration. In some circumstances, this field might not have a + // value. + google.protobuf.Duration static_duration = 2; + + // The polyline associated with this step. + Polyline polyline = 3; + + // The start location of this step. + Location start_location = 4; + + // The end location of this step. + Location end_location = 5; + + // Navigation instructions. + NavigationInstruction navigation_instruction = 6; + + // Encapsulates the additional information that the user should be informed + // about, such as possible traffic zone restriction on a leg step. + RouteLegStepTravelAdvisory travel_advisory = 7; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_label.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_label.proto new file mode 100644 index 000000000000..f0c9188a5459 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_label.proto @@ -0,0 +1,46 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteLabelProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Labels for the `Route` that are useful to identify specific properties +// of the route to compare against others. +enum RouteLabel { + // Default - not used. + ROUTE_LABEL_UNSPECIFIED = 0; + + // The default "best" route returned for the route computation. + DEFAULT_ROUTE = 1; + + // An alternative to the default "best" route. Routes like this will be + // returned when `ComputeRoutesRequest.compute_alternative_routes` is + // specified. + DEFAULT_ROUTE_ALTERNATE = 2; + + // Fuel efficient route. Routes labeled with this value are determined to be + // optimized for Eco parameters such as fuel consumption. + FUEL_EFFICIENT = 3; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_modifiers.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_modifiers.proto new file mode 100644 index 000000000000..01fcdad3eb66 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_modifiers.proto @@ -0,0 +1,64 @@ +// Copyright 2022 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.routing.v2; + +import "google/maps/routing/v2/toll_passes.proto"; +import "google/maps/routing/v2/vehicle_info.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteModifiersProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a set of optional conditions to satisfy when calculating the +// routes. +message RouteModifiers { + // Specifies whether to avoid toll roads where reasonable. Preference will be + // given to routes not containing toll roads. Applies only to the `DRIVE` and + // `TWO_WHEELER` travel modes. + bool avoid_tolls = 1; + + // Specifies whether to avoid highways where reasonable. Preference will be + // given to routes not containing highways. Applies only to the `DRIVE` and + // `TWO_WHEELER` travel modes. + bool avoid_highways = 2; + + // Specifies whether to avoid ferries where reasonable. Preference will be + // given to routes not containing travel by ferries. + // Applies only to the `DRIVE` and`TWO_WHEELER` travel modes. + bool avoid_ferries = 3; + + // Specifies whether to avoid navigating indoors where reasonable. Preference + // will be given to routes not containing indoor navigation. + // Applies only to the `WALK` travel mode. + bool avoid_indoor = 4; + + // Specifies the vehicle information. + VehicleInfo vehicle_info = 5; + + // Encapsulates information about toll passes. + // If toll passes are provided, the API tries to return the pass price. If + // toll passes are not provided, the API treats the toll pass as unknown and + // tries to return the cash price. + // Applies only to the DRIVE and TWO_WHEELER travel modes. + repeated TollPass toll_passes = 6; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_travel_mode.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_travel_mode.proto new file mode 100644 index 000000000000..adc091e166fd --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/route_travel_mode.proto @@ -0,0 +1,46 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteTravelModeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values used to specify the mode of travel. +enum RouteTravelMode { + // No travel mode specified. Defaults to `DRIVE`. + TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel by passenger car. + DRIVE = 1; + + // Travel by bicycle. + BICYCLE = 2; + + // Travel by walking. + WALK = 3; + + // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this + // differs from the `BICYCLE` travel mode which covers human-powered mode. + TWO_WHEELER = 4; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/routes_service.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/routes_service.proto new file mode 100644 index 000000000000..7eb2229d5b3d --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/routes_service.proto @@ -0,0 +1,329 @@ +// Copyright 2022 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.routing.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/maps/routing/v2/fallback_info.proto"; +import "google/maps/routing/v2/polyline.proto"; +import "google/maps/routing/v2/route.proto"; +import "google/maps/routing/v2/route_modifiers.proto"; +import "google/maps/routing/v2/route_travel_mode.proto"; +import "google/maps/routing/v2/routing_preference.proto"; +import "google/maps/routing/v2/units.proto"; +import "google/maps/routing/v2/waypoint.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RoutesServiceProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// The Routes API. +service Routes { + option (google.api.default_host) = "routes.googleapis.com"; + + // Returns the primary route along with optional alternate routes, given a set + // of terminal and intermediate waypoints. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using URL parameter + // `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` + // (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters). The value + // is a comma separated list of field paths. See detailed documentation about + // [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of Route-level duration, distance, and polyline (an example + // production setup): + // `X-Goog-FieldMask: + // routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` + // + // Google discourage the use of the wildcard (`*`) response field mask, or + // specifying the field mask at the top level (`routes`), because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need + // in your production job ensures stable latency performance. We might add + // more response fields in the future, and those new fields might require + // extra computation time. If you select all fields, or if you select all + // fields at the top level, then you might experience performance degradation + // because any new field we add will be automatically included in the + // response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRoutes(ComputeRoutesRequest) returns (ComputeRoutesResponse) { + option (google.api.http) = { + post: "/directions/v2:computeRoutes" + body: "*" + }; + } + + // Takes in a list of origins and destinations and returns a stream containing + // route information for each combination of origin and destination. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using the URL + // parameter `$fields` or `fields`, or by using the HTTP/gRPC header + // `X-Goog-FieldMask` (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters). The value + // is a comma separated list of field paths. See this detailed documentation + // about [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of route durations, distances, element status, condition, and + // element indices (an example production setup): + // `X-Goog-FieldMask: + // originIndex,destinationIndex,status,condition,distanceMeters,duration` + // + // It is critical that you include `status` in your field mask as otherwise + // all messages will appear to be OK. Google discourages the use of the + // wildcard (`*`) response field mask, because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need in your production job ensures + // stable latency performance. We might add more response fields in the + // future, and those new fields might require extra computation time. If you + // select all fields, or if you select all fields at the top level, then you + // might experience performance degradation because any new field we add will + // be automatically included in the response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) { + option (google.api.http) = { + post: "/distanceMatrix/v2:computeRouteMatrix" + body: "*" + }; + } +} + +// ComputeRoutes request message. +message ComputeRoutesRequest { + // A supported reference route on the ComputeRoutesRequest. + enum ReferenceRoute { + // Not used. Requests containing this value fail. + REFERENCE_ROUTE_UNSPECIFIED = 0; + + // Fuel efficient route. Routes labeled with this value are determined to be + // optimized for parameters such as fuel consumption. + FUEL_EFFICIENT = 1; + } + + // Required. Origin waypoint. + Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Destination waypoint. + Waypoint destination = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A set of waypoints along the route (excluding terminal points), + // for either stopping at or passing by. Up to 25 intermediate waypoints are + // supported. + repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the mode of transportation. + RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the route. The server + // attempts to use the selected routing preference to compute the route. If + // the routing preference results in an error or an extra long latency, then + // an error is returned. In the future, we might implement a fallback + // mechanism to use a different option when the preferred option does not give + // a valid result. You can specify this option only when the `travel_mode` is + // `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies your preference for the quality of the polyline. + PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the preferred encoding for the polyline. + PolylineEncoding polyline_encoding = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The departure time. If you don't set this value, then this value + // defaults to the time that you made the request. If you set this value to a + // time that has already occurred, then the request fails. + google.protobuf.Timestamp departure_time = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether to calculate alternate routes in addition to the route. + bool compute_alternative_routes = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of conditions to satisfy that affect the way routes are + // calculated. + RouteModifiers route_modifiers = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See + // [Language Support](https://developers.google.com/maps/faq#languagesupport) + // for the list of supported languages. When you don't provide this value, the + // display language is inferred from the location of the route request. + string language_code = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the units of measure for the display fields. This + // includes the `instruction` field in `NavigationInstruction`. The units of + // measure used for the route, leg, step distance, and duration are not + // affected by this value. If you don't provide this value, then the display + // units are inferred from the location of the request. + Units units = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies what reference routes to calculate as part of the request in + // addition to the default route. + // A reference route is a route with a different route calculation objective + // than the default route. For example an FUEL_EFFICIENT reference route + // calculation takes into account various parameters that would generate an + // optimal fuel efficient route. + repeated ReferenceRoute requested_reference_routes = 14 [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeRoutes the response message. +message ComputeRoutesResponse { + // Contains an array of computed routes (up to three) when you specify + // compute_alternatives_routes, and contains just one route when you don't. + // When this array contains multiple entries, the first one is the most + // recommended route. If the array is empty, then it means no route could be + // found. + repeated Route routes = 1; + + // In some cases when the server is not able to compute the route results with + // all of the input preferences, it may fallback to using a different way of + // computation. When fallback mode is used, this field contains detailed info + // about the fallback response. Otherwise this field is unset. + FallbackInfo fallback_info = 2; +} + +// ComputeRouteMatrix request message +message ComputeRouteMatrixRequest { + // Required. Array of origins, which determines the rows of the response matrix. + // Several size restrictions apply to the cardinality of origins and + // destinations: + // + // * The number of elements (origins × destinations) must be no greater than + // 625 in any case. + // * The number of elements (origins × destinations) must be no greater than + // 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + // * The number of waypoints (origins + destinations) specified as `place_id` + // must be no greater than 50. + repeated RouteMatrixOrigin origins = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Array of destinations, which determines the columns of the response matrix. + repeated RouteMatrixDestination destinations = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies the mode of transportation. + RouteTravelMode travel_mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the route. The server attempts to use the selected + // routing preference to compute the route. If the routing preference results + // in an error or an extra long latency, an error is returned. In the future, + // we might implement a fallback mechanism to use a different option when the + // preferred option does not give a valid result. You can specify this option + // only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the + // request fails. + RoutingPreference routing_preference = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The departure time. If you don't set this value, this defaults to the time + // that you made the request. If you set this value to a time that has already + // occurred, the request fails. + google.protobuf.Timestamp departure_time = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A single origin for ComputeRouteMatrixRequest +message RouteMatrixOrigin { + // Required. Origin waypoint + Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Modifiers for every route that takes this as the origin + RouteModifiers route_modifiers = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A single destination for ComputeRouteMatrixRequest +message RouteMatrixDestination { + // Required. Destination waypoint + Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Encapsulates route information computed for an origin/destination pair in the +// ComputeRouteMatrix API. This proto can be streamed to the client. +message RouteMatrixElement { + // Zero-based index of the origin in the request. + optional int32 origin_index = 1; + + // Zero-based index of the destination in the request. + optional int32 destination_index = 2; + + // Error status code for this element. + google.rpc.Status status = 3; + + // Indicates whether the route was found or not. Independent of status. + RouteMatrixElementCondition condition = 9; + + // The travel distance of the route, in meters. + int32 distance_meters = 4; + + // The length of time needed to navigate the route. If you set the + // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If you set the `routing_preference` to either + // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated + // taking traffic conditions into account. + google.protobuf.Duration duration = 5; + + // The duration of traveling through the route without taking traffic + // conditions into consideration. + google.protobuf.Duration static_duration = 6; + + // Additional information about the route. For example: restriction + // information and toll information + RouteTravelAdvisory travel_advisory = 7; + + // In some cases when the server is not able to compute the route with the + // given preferences for this particular origin/destination pair, it may + // fall back to using a different mode of computation. When fallback mode is + // used, this field contains detailed information about the fallback response. + // Otherwise this field is unset. + FallbackInfo fallback_info = 8; +} + +// The condition of the route being returned. +enum RouteMatrixElementCondition { + // Only used when the `status` of the element is not OK. + ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; + + // A route was found, and the corresponding information was filled out for the + // element. + ROUTE_EXISTS = 1; + + // No route could be found. Fields containing route information, such as + // `distance_meters` or `duration`, will not be filled out in the element. + ROUTE_NOT_FOUND = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/routing_preference.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/routing_preference.proto new file mode 100644 index 000000000000..0b9108f1fec7 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/routing_preference.proto @@ -0,0 +1,55 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RoutingPreferenceProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify factors to take into consideration when +// calculating the route. +enum RoutingPreference { + // No routing preference specified. Default to `TRAFFIC_UNAWARE`. + ROUTING_PREFERENCE_UNSPECIFIED = 0; + + // Computes routes without taking live traffic conditions into consideration. + // Suitable when traffic conditions don't matter or are not applicable. + // Using this value produces the lowest latency. + // Note: For `RouteTravelMode` DRIVE and TWO_WHEELER choice of route and + // duration are based on road network and average time-independent traffic + // conditions. Results for a given request may vary over time due to changes + // in the road network, updated average traffic conditions, and the + // distributed nature of the service. Results may also vary between + // nearly-equivalent routes at any time or frequency. + TRAFFIC_UNAWARE = 1; + + // Calculates routes taking live traffic conditions into consideration. + // In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to + // significantly reduce latency. + TRAFFIC_AWARE = 2; + + // Calculates the routes taking live traffic conditions into consideration, + // without applying most performance optimizations. Using this value produces + // the highest latency. + TRAFFIC_AWARE_OPTIMAL = 3; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/speed_reading_interval.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/speed_reading_interval.proto new file mode 100644 index 000000000000..6f43f7cc0b8a --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/speed_reading_interval.proto @@ -0,0 +1,57 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "SpeedReadingIntervalProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Traffic density indicator on a contiguous segment of a polyline or path. +// Given a path with points P_0, P_1, ... , P_N (zero-based index), the +// SpeedReadingInterval defines an interval and describes its traffic using the +// following categories. +message SpeedReadingInterval { + // The classification of polyline speed based on traffic data. + enum Speed { + // Default value. This value is unused. + SPEED_UNSPECIFIED = 0; + + // Normal speed, no slowdown is detected. + NORMAL = 1; + + // Slowdown detected, but no traffic jam formed. + SLOW = 2; + + // Traffic jam detected. + TRAFFIC_JAM = 3; + } + + // The starting index of this interval in the polyline. + optional int32 start_polyline_point_index = 1; + + // The ending index of this interval in the polyline. + optional int32 end_polyline_point_index = 2; + + // Traffic speed in this interval. + Speed speed = 3; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/toll_info.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/toll_info.proto new file mode 100644 index 000000000000..b98a0cbc2b97 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/toll_info.proto @@ -0,0 +1,40 @@ +// Copyright 2022 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.routing.v2; + +import "google/type/money.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "TollInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates toll information on a `Route` or on a `RouteLeg`. +message TollInfo { + // The monetary amount of tolls for the corresponding Route or RouteLeg. + // This list contains a money amount for each currency that is expected + // to be charged by the toll stations. Typically this list will contain only + // one item for routes with tolls in one currency. For international trips, + // this list may contain multiple items to reflect tolls in different + // currencies. + repeated google.type.Money estimated_price = 1; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/toll_passes.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/toll_passes.proto new file mode 100644 index 000000000000..c46259bdf367 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/toll_passes.proto @@ -0,0 +1,321 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "TollPassesProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// List of toll passes around the world that we support. +enum TollPass { + // Not used. If this value is used, then the request fails. + TOLL_PASS_UNSPECIFIED = 0; + + // Sydney toll pass. See additional details at https://www.myetoll.com.au. + AU_ETOLL_TAG = 82; + + // Sydney toll pass. See additional details at https://www.tollpay.com.au. + AU_EWAY_TAG = 83; + + // Australia-wide toll pass. + // See additional details at https://www.linkt.com.au/. + AU_LINKT = 2; + + // Argentina toll pass. See additional details at https://telepase.com.ar + AR_TELEPASE = 3; + + // Brazil toll pass. See additional details at https://www.autoexpreso.com + BR_AUTO_EXPRESO = 81; + + // Brazil toll pass. See additional details at https://conectcar.com. + BR_CONECTCAR = 7; + + // Brazil toll pass. See additional details at https://movemais.com. + BR_MOVE_MAIS = 8; + + // Brazil toll pass. See additional details at https://pasorapido.gob.do/ + BR_PASSA_RAPIDO = 88; + + // Brazil toll pass. See additional details at https://www.semparar.com.br. + BR_SEM_PARAR = 9; + + // Brazil toll pass. See additional details at https://taggy.com.br. + BR_TAGGY = 10; + + // Brazil toll pass. See additional details at + // https://veloe.com.br/site/onde-usar. + BR_VELOE = 11; + + // Canada to United States border crossing. + CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84; + + // Canada to United States border crossing. + CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85; + + // Ontario, Canada to Michigan, United States border crossing. + CA_US_BLUE_WATER_EDGE_PASS = 18; + + // Ontario, Canada to Michigan, United States border crossing. + CA_US_CONNEXION = 19; + + // Canada to United States border crossing. + CA_US_NEXUS_CARD = 20; + + // Indonesia. + // E-card provided by multiple banks used to pay for tolls. All e-cards + // via banks are charged the same so only one enum value is needed. E.g. + // - Bank Mandiri https://www.bankmandiri.co.id/e-money + // - BCA https://www.bca.co.id/flazz + // - BNI https://www.bni.co.id/id-id/ebanking/tapcash + ID_E_TOLL = 16; + + // India. + IN_FASTAG = 78; + + // India, HP state plate exemption. + IN_LOCAL_HP_PLATE_EXEMPT = 79; + + // Mexico toll pass. + // https://iave.capufe.gob.mx/#/ + MX_IAVE = 90; + + // Mexico + // https://www.pase.com.mx + MX_PASE = 91; + + // Mexico + // https://operadoravial.com/quick-pass/ + MX_QUICKPASS = 93; + + // http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf + MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89; + + // Mexico + MX_TAG_IAVE = 12; + + // Mexico toll pass company. One of many operating in Mexico City. See + // additional details at https://www.televia.com.mx. + MX_TAG_TELEVIA = 13; + + // Mexico toll pass company. One of many operating in Mexico City. + // https://www.televia.com.mx + MX_TELEVIA = 92; + + // Mexico toll pass. See additional details at + // https://www.viapass.com.mx/viapass/web_home.aspx. + MX_VIAPASS = 14; + + // AL, USA. + US_AL_FREEDOM_PASS = 21; + + // AK, USA. + US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22; + + // CA, USA. + US_CA_FASTRAK = 4; + + // Indicates driver has any FasTrak pass in addition to the DMV issued Clean + // Air Vehicle (CAV) sticker. + // https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml + US_CA_FASTRAK_CAV_STICKER = 86; + + // CO, USA. + US_CO_EXPRESSTOLL = 23; + + // CO, USA. + US_CO_GO_PASS = 24; + + // DE, USA. + US_DE_EZPASSDE = 25; + + // FL, USA. + US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65; + + // FL, USA. + US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66; + + // FL, USA. + US_FL_EPASS = 67; + + // FL, USA. + US_FL_GIBA_TOLL_PASS = 68; + + // FL, USA. + US_FL_LEEWAY = 69; + + // FL, USA. + US_FL_SUNPASS = 70; + + // FL, USA. + US_FL_SUNPASS_PRO = 71; + + // IL, USA. + US_IL_EZPASSIL = 73; + + // IL, USA. + US_IL_IPASS = 72; + + // IN, USA. + US_IN_EZPASSIN = 26; + + // KS, USA. + US_KS_BESTPASS_HORIZON = 27; + + // KS, USA. + US_KS_KTAG = 28; + + // KS, USA. + US_KS_NATIONALPASS = 29; + + // KS, USA. + US_KS_PREPASS_ELITEPASS = 30; + + // KY, USA. + US_KY_RIVERLINK = 31; + + // LA, USA. + US_LA_GEAUXPASS = 32; + + // LA, USA. + US_LA_TOLL_TAG = 33; + + // MA, USA. + US_MA_EZPASSMA = 6; + + // MD, USA. + US_MD_EZPASSMD = 34; + + // ME, USA. + US_ME_EZPASSME = 35; + + // MI, USA. + US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36; + + // MI, USA. + US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37; + + // MI, USA. + US_MI_IQ_PROX_CARD = 38; + + // MI, USA. + US_MI_MACKINAC_BRIDGE_MAC_PASS = 39; + + // MI, USA. + US_MI_NEXPRESS_TOLL = 40; + + // MN, USA. + US_MN_EZPASSMN = 41; + + // NC, USA. + US_NC_EZPASSNC = 42; + + // NC, USA. + US_NC_PEACH_PASS = 87; + + // NC, USA. + US_NC_QUICK_PASS = 43; + + // NH, USA. + US_NH_EZPASSNH = 80; + + // NJ, USA. + US_NJ_DOWNBEACH_EXPRESS_PASS = 75; + + // NJ, USA. + US_NJ_EZPASSNJ = 74; + + // NY, USA. + US_NY_EXPRESSPASS = 76; + + // NY, USA. + US_NY_EZPASSNY = 77; + + // OH, USA. + US_OH_EZPASSOH = 44; + + // PA, USA. + US_PA_EZPASSPA = 45; + + // RI, USA. + US_RI_EZPASSRI = 46; + + // SC, USA. + US_SC_PALPASS = 47; + + // TX, USA. + US_TX_BANCPASS = 48; + + // TX, USA. + US_TX_DEL_RIO_PASS = 49; + + // TX, USA. + US_TX_EFAST_PASS = 50; + + // TX, USA. + US_TX_EAGLE_PASS_EXPRESS_CARD = 51; + + // TX, USA. + US_TX_EPTOLL = 52; + + // TX, USA. + US_TX_EZ_CROSS = 53; + + // TX, USA. + US_TX_EZTAG = 54; + + // TX, USA. + US_TX_LAREDO_TRADE_TAG = 55; + + // TX, USA. + US_TX_PLUSPASS = 56; + + // TX, USA. + US_TX_TOLLTAG = 57; + + // TX, USA. + US_TX_TXTAG = 58; + + // TX, USA. + US_TX_XPRESS_CARD = 59; + + // UT, USA. + US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60; + + // VA, USA. + US_VA_EZPASSVA = 61; + + // WA, USA. + US_WA_BREEZEBY = 17; + + // WA, USA. + US_WA_GOOD_TO_GO = 1; + + // WV, USA. + US_WV_EZPASSWV = 62; + + // WV, USA. + US_WV_MEMORIAL_BRIDGE_TICKETS = 63; + + // WV, USA. + US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/units.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/units.proto new file mode 100644 index 000000000000..32424046a0cf --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/units.proto @@ -0,0 +1,40 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "UnitsProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify the unit of measure used in the display. +enum Units { + // Units of measure not specified. Defaults to the unit of measure inferred + // from the request. + UNITS_UNSPECIFIED = 0; + + // Metric units of measure. + METRIC = 1; + + // Imperial (English) units of measure. + IMPERIAL = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/vehicle_emission_type.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/vehicle_emission_type.proto new file mode 100644 index 000000000000..b5889bbb0bfa --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/vehicle_emission_type.proto @@ -0,0 +1,46 @@ +// Copyright 2022 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.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "VehicleEmissionTypeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values describing the vehicle's emission type. +// Applies only to the DRIVE travel mode. +enum VehicleEmissionType { + // No emission type specified. Default to GASOLINE. + VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0; + + // Gasoline/petrol fueled vehicle. + GASOLINE = 1; + + // Electricity powered vehicle. + ELECTRIC = 2; + + // Hybrid fuel (such as gasoline + electric) vehicle. + HYBRID = 3; + + // Diesel fueled vehicle. + DIESEL = 4; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/vehicle_info.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/vehicle_info.proto new file mode 100644 index 000000000000..1393fbde9e57 --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/vehicle_info.proto @@ -0,0 +1,37 @@ +// Copyright 2022 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.routing.v2; + +import "google/maps/routing/v2/vehicle_emission_type.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "VehicleInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates the vehicle information, such as the license plate last +// character. +message VehicleInfo { + // Describes the vehicle's emission type. + // Applies only to the DRIVE travel mode. + VehicleEmissionType emission_type = 2; +} diff --git a/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/waypoint.proto b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/waypoint.proto new file mode 100644 index 000000000000..a97b043c1f0f --- /dev/null +++ b/java-maps-routiting/proto-google-maps-routes-v2/src/main/proto/google/maps/routing/v2/waypoint.proto @@ -0,0 +1,71 @@ +// Copyright 2022 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.routing.v2; + +import "google/maps/routing/v2/location.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "WaypointProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a waypoint. Waypoints mark both the beginning and end of a +// route, and include intermediate stops along the route. +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; + } + + // Marks this waypoint as a milestone rather a stopping point. For + // each non-via waypoint in the request, the response appends an entry to the + // `legs` array to provide the details for stopovers on that leg of the + // trip. Set this value to true when you want the route to pass through this + // waypoint without stopping over. Via waypoints don't cause an entry to be + // added to the `legs` array, but they do route the journey through the + // waypoint. You can only set this value on waypoints that are intermediates. + // The request fails if you set this field on terminal waypoints. + // If `ComputeRoutesRequest.optimize_waypoint_order` + // is set to true then this field cannot be set to + // true; otherwise, the request fails. + bool via = 3; + + // Indicates that the waypoint is meant for vehicles to stop at, where the + // intention is to either pickup or drop-off. When you set this value, the + // calculated route won't include non-`via` waypoints on roads that are + // unsuitable for pickup and drop-off. This option works only for `DRIVE` and + // `TWO_WHEELER` travel modes, and when the `location_type` is `location`. + bool vehicle_stopover = 4; + + // 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 works only for 'DRIVE' and 'TWO_WHEELER' + // travel modes. + bool side_of_road = 5; +} diff --git a/java-maps-routiting/versions.txt b/java-maps-routiting/versions.txt new file mode 100644 index 000000000000..8b5c24cae4be --- /dev/null +++ b/java-maps-routiting/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-maps-routes:0.0.0:0.0.1-SNAPSHOT +proto-google-maps-routes-v2:0.0.0:0.0.1-SNAPSHOT +grpc-google-maps-routes-v2:0.0.0:0.0.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 550526b46beb..8f22a4bfb68a 100644 --- a/pom.xml +++ b/pom.xml @@ -99,6 +99,7 @@ java-language java-life-sciences java-managed-identities + java-maps-routiting java-mediatranslation java-memcache java-monitoring-dashboards diff --git a/release-please-config.json b/release-please-config.json index a93ad7fb46c5..922708473cf1 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -262,6 +262,9 @@ "java-managed-identities": { "component": "google-cloud-managed-identities" }, + "java-maps-routiting": { + "component": "google-maps-routes" + }, "java-mediatranslation": { "component": "google-cloud-mediatranslation" },