/*
 * 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;

/**
 *
 *
 * <pre>
 * Encapsulates route information computed for an origin/destination pair in the
 * ComputeRouteMatrix API. This proto can be streamed to the client.
 * </pre>
 *
 * 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_ = 0;
  /**
   *
   *
   * <pre>
   * Zero-based index of the origin in the request.
   * </pre>
   *
   * <code>optional int32 origin_index = 1;</code>
   *
   * @return Whether the originIndex field is set.
   */
  @java.lang.Override
  public boolean hasOriginIndex() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   *
   *
   * <pre>
   * Zero-based index of the origin in the request.
   * </pre>
   *
   * <code>optional int32 origin_index = 1;</code>
   *
   * @return The originIndex.
   */
  @java.lang.Override
  public int getOriginIndex() {
    return originIndex_;
  }

  public static final int DESTINATION_INDEX_FIELD_NUMBER = 2;
  private int destinationIndex_ = 0;
  /**
   *
   *
   * <pre>
   * Zero-based index of the destination in the request.
   * </pre>
   *
   * <code>optional int32 destination_index = 2;</code>
   *
   * @return Whether the destinationIndex field is set.
   */
  @java.lang.Override
  public boolean hasDestinationIndex() {
    return ((bitField0_ & 0x00000002) != 0);
  }
  /**
   *
   *
   * <pre>
   * Zero-based index of the destination in the request.
   * </pre>
   *
   * <code>optional int32 destination_index = 2;</code>
   *
   * @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_;
  /**
   *
   *
   * <pre>
   * Error status code for this element.
   * </pre>
   *
   * <code>.google.rpc.Status status = 3;</code>
   *
   * @return Whether the status field is set.
   */
  @java.lang.Override
  public boolean hasStatus() {
    return status_ != null;
  }
  /**
   *
   *
   * <pre>
   * Error status code for this element.
   * </pre>
   *
   * <code>.google.rpc.Status status = 3;</code>
   *
   * @return The status.
   */
  @java.lang.Override
  public com.google.rpc.Status getStatus() {
    return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
  }
  /**
   *
   *
   * <pre>
   * Error status code for this element.
   * </pre>
   *
   * <code>.google.rpc.Status status = 3;</code>
   */
  @java.lang.Override
  public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
    return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
  }

  public static final int CONDITION_FIELD_NUMBER = 9;
  private int condition_ = 0;
  /**
   *
   *
   * <pre>
   * Indicates whether the route was found or not. Independent of status.
   * </pre>
   *
   * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
   *
   * @return The enum numeric value on the wire for condition.
   */
  @java.lang.Override
  public int getConditionValue() {
    return condition_;
  }
  /**
   *
   *
   * <pre>
   * Indicates whether the route was found or not. Independent of status.
   * </pre>
   *
   * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
   *
   * @return The condition.
   */
  @java.lang.Override
  public com.google.maps.routing.v2.RouteMatrixElementCondition getCondition() {
    com.google.maps.routing.v2.RouteMatrixElementCondition result =
        com.google.maps.routing.v2.RouteMatrixElementCondition.forNumber(condition_);
    return result == null
        ? com.google.maps.routing.v2.RouteMatrixElementCondition.UNRECOGNIZED
        : result;
  }

  public static final int DISTANCE_METERS_FIELD_NUMBER = 4;
  private int distanceMeters_ = 0;
  /**
   *
   *
   * <pre>
   * The travel distance of the route, in meters.
   * </pre>
   *
   * <code>int32 distance_meters = 4;</code>
   *
   * @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_;
  /**
   *
   *
   * <pre>
   * The length of time needed to navigate the route. If you set the
   * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
   * </pre>
   *
   * <code>.google.protobuf.Duration duration = 5;</code>
   *
   * @return Whether the duration field is set.
   */
  @java.lang.Override
  public boolean hasDuration() {
    return duration_ != null;
  }
  /**
   *
   *
   * <pre>
   * The length of time needed to navigate the route. If you set the
   * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
   * </pre>
   *
   * <code>.google.protobuf.Duration duration = 5;</code>
   *
   * @return The duration.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getDuration() {
    return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
  }
  /**
   *
   *
   * <pre>
   * The length of time needed to navigate the route. If you set the
   * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
   * </pre>
   *
   * <code>.google.protobuf.Duration duration = 5;</code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() {
    return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
  }

  public static final int STATIC_DURATION_FIELD_NUMBER = 6;
  private com.google.protobuf.Duration staticDuration_;
  /**
   *
   *
   * <pre>
   * The duration of traveling through the route without taking traffic
   * conditions into consideration.
   * </pre>
   *
   * <code>.google.protobuf.Duration static_duration = 6;</code>
   *
   * @return Whether the staticDuration field is set.
   */
  @java.lang.Override
  public boolean hasStaticDuration() {
    return staticDuration_ != null;
  }
  /**
   *
   *
   * <pre>
   * The duration of traveling through the route without taking traffic
   * conditions into consideration.
   * </pre>
   *
   * <code>.google.protobuf.Duration static_duration = 6;</code>
   *
   * @return The staticDuration.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getStaticDuration() {
    return staticDuration_ == null
        ? com.google.protobuf.Duration.getDefaultInstance()
        : staticDuration_;
  }
  /**
   *
   *
   * <pre>
   * The duration of traveling through the route without taking traffic
   * conditions into consideration.
   * </pre>
   *
   * <code>.google.protobuf.Duration static_duration = 6;</code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() {
    return staticDuration_ == null
        ? com.google.protobuf.Duration.getDefaultInstance()
        : staticDuration_;
  }

  public static final int TRAVEL_ADVISORY_FIELD_NUMBER = 7;
  private com.google.maps.routing.v2.RouteTravelAdvisory travelAdvisory_;
  /**
   *
   *
   * <pre>
   * Additional information about the route. For example: restriction
   * information and toll information
   * </pre>
   *
   * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
   *
   * @return Whether the travelAdvisory field is set.
   */
  @java.lang.Override
  public boolean hasTravelAdvisory() {
    return travelAdvisory_ != null;
  }
  /**
   *
   *
   * <pre>
   * Additional information about the route. For example: restriction
   * information and toll information
   * </pre>
   *
   * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
   *
   * @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_;
  }
  /**
   *
   *
   * <pre>
   * Additional information about the route. For example: restriction
   * information and toll information
   * </pre>
   *
   * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
   */
  @java.lang.Override
  public com.google.maps.routing.v2.RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder() {
    return travelAdvisory_ == null
        ? com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance()
        : travelAdvisory_;
  }

  public static final int FALLBACK_INFO_FIELD_NUMBER = 8;
  private com.google.maps.routing.v2.FallbackInfo fallbackInfo_;
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
   *
   * @return Whether the fallbackInfo field is set.
   */
  @java.lang.Override
  public boolean hasFallbackInfo() {
    return fallbackInfo_ != null;
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
   *
   * @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_;
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
   */
  @java.lang.Override
  public com.google.maps.routing.v2.FallbackInfoOrBuilder getFallbackInfoOrBuilder() {
    return fallbackInfo_ == null
        ? com.google.maps.routing.v2.FallbackInfo.getDefaultInstance()
        : fallbackInfo_;
  }

  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;
  }
  /**
   *
   *
   * <pre>
   * Encapsulates route information computed for an origin/destination pair in the
   * ComputeRouteMatrix API. This proto can be streamed to the client.
   * </pre>
   *
   * Protobuf type {@code google.maps.routing.v2.RouteMatrixElement}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<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();
      bitField0_ = 0;
      originIndex_ = 0;
      destinationIndex_ = 0;
      status_ = null;
      if (statusBuilder_ != null) {
        statusBuilder_.dispose();
        statusBuilder_ = null;
      }
      condition_ = 0;
      distanceMeters_ = 0;
      duration_ = null;
      if (durationBuilder_ != null) {
        durationBuilder_.dispose();
        durationBuilder_ = null;
      }
      staticDuration_ = null;
      if (staticDurationBuilder_ != null) {
        staticDurationBuilder_.dispose();
        staticDurationBuilder_ = null;
      }
      travelAdvisory_ = null;
      if (travelAdvisoryBuilder_ != null) {
        travelAdvisoryBuilder_.dispose();
        travelAdvisoryBuilder_ = null;
      }
      fallbackInfo_ = null;
      if (fallbackInfoBuilder_ != null) {
        fallbackInfoBuilder_.dispose();
        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);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.maps.routing.v2.RouteMatrixElement result) {
      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 (((from_bitField0_ & 0x00000004) != 0)) {
        result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.condition_ = condition_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.distanceMeters_ = distanceMeters_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.staticDuration_ =
            staticDurationBuilder_ == null ? staticDuration_ : staticDurationBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.travelAdvisory_ =
            travelAdvisoryBuilder_ == null ? travelAdvisory_ : travelAdvisoryBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.fallbackInfo_ =
            fallbackInfoBuilder_ == null ? fallbackInfo_ : fallbackInfoBuilder_.build();
      }
      result.bitField0_ |= to_bitField0_;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.maps.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);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 32:
              {
                distanceMeters_ = input.readInt32();
                bitField0_ |= 0x00000010;
                break;
              } // case 32
            case 42:
              {
                input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000020;
                break;
              } // case 42
            case 50:
              {
                input.readMessage(getStaticDurationFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000040;
                break;
              } // case 50
            case 58:
              {
                input.readMessage(getTravelAdvisoryFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000080;
                break;
              } // case 58
            case 66:
              {
                input.readMessage(getFallbackInfoFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000100;
                break;
              } // case 66
            case 72:
              {
                condition_ = input.readEnum();
                bitField0_ |= 0x00000008;
                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_;
    /**
     *
     *
     * <pre>
     * Zero-based index of the origin in the request.
     * </pre>
     *
     * <code>optional int32 origin_index = 1;</code>
     *
     * @return Whether the originIndex field is set.
     */
    @java.lang.Override
    public boolean hasOriginIndex() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * Zero-based index of the origin in the request.
     * </pre>
     *
     * <code>optional int32 origin_index = 1;</code>
     *
     * @return The originIndex.
     */
    @java.lang.Override
    public int getOriginIndex() {
      return originIndex_;
    }
    /**
     *
     *
     * <pre>
     * Zero-based index of the origin in the request.
     * </pre>
     *
     * <code>optional int32 origin_index = 1;</code>
     *
     * @param value The originIndex to set.
     * @return This builder for chaining.
     */
    public Builder setOriginIndex(int value) {

      originIndex_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Zero-based index of the origin in the request.
     * </pre>
     *
     * <code>optional int32 origin_index = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOriginIndex() {
      bitField0_ = (bitField0_ & ~0x00000001);
      originIndex_ = 0;
      onChanged();
      return this;
    }

    private int destinationIndex_;
    /**
     *
     *
     * <pre>
     * Zero-based index of the destination in the request.
     * </pre>
     *
     * <code>optional int32 destination_index = 2;</code>
     *
     * @return Whether the destinationIndex field is set.
     */
    @java.lang.Override
    public boolean hasDestinationIndex() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * Zero-based index of the destination in the request.
     * </pre>
     *
     * <code>optional int32 destination_index = 2;</code>
     *
     * @return The destinationIndex.
     */
    @java.lang.Override
    public int getDestinationIndex() {
      return destinationIndex_;
    }
    /**
     *
     *
     * <pre>
     * Zero-based index of the destination in the request.
     * </pre>
     *
     * <code>optional int32 destination_index = 2;</code>
     *
     * @param value The destinationIndex to set.
     * @return This builder for chaining.
     */
    public Builder setDestinationIndex(int value) {

      destinationIndex_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Zero-based index of the destination in the request.
     * </pre>
     *
     * <code>optional int32 destination_index = 2;</code>
     *
     * @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_;
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     *
     * @return Whether the status field is set.
     */
    public boolean hasStatus() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     *
     * @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();
      }
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    public Builder setStatus(com.google.rpc.Status value) {
      if (statusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        status_ = value;
      } else {
        statusBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    public Builder setStatus(com.google.rpc.Status.Builder builderForValue) {
      if (statusBuilder_ == null) {
        status_ = builderForValue.build();
      } else {
        statusBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    public Builder mergeStatus(com.google.rpc.Status value) {
      if (statusBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && status_ != null
            && status_ != com.google.rpc.Status.getDefaultInstance()) {
          getStatusBuilder().mergeFrom(value);
        } else {
          status_ = value;
        }
      } else {
        statusBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    public Builder clearStatus() {
      bitField0_ = (bitField0_ & ~0x00000004);
      status_ = null;
      if (statusBuilder_ != null) {
        statusBuilder_.dispose();
        statusBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    public com.google.rpc.Status.Builder getStatusBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getStatusFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
      if (statusBuilder_ != null) {
        return statusBuilder_.getMessageOrBuilder();
      } else {
        return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
      }
    }
    /**
     *
     *
     * <pre>
     * Error status code for this element.
     * </pre>
     *
     * <code>.google.rpc.Status status = 3;</code>
     */
    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;
    /**
     *
     *
     * <pre>
     * Indicates whether the route was found or not. Independent of status.
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
     *
     * @return The enum numeric value on the wire for condition.
     */
    @java.lang.Override
    public int getConditionValue() {
      return condition_;
    }
    /**
     *
     *
     * <pre>
     * Indicates whether the route was found or not. Independent of status.
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
     *
     * @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;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates whether the route was found or not. Independent of status.
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
     *
     * @return The condition.
     */
    @java.lang.Override
    public com.google.maps.routing.v2.RouteMatrixElementCondition getCondition() {
      com.google.maps.routing.v2.RouteMatrixElementCondition result =
          com.google.maps.routing.v2.RouteMatrixElementCondition.forNumber(condition_);
      return result == null
          ? com.google.maps.routing.v2.RouteMatrixElementCondition.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Indicates whether the route was found or not. Independent of status.
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
     *
     * @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();
      }
      bitField0_ |= 0x00000008;
      condition_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates whether the route was found or not. Independent of status.
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteMatrixElementCondition condition = 9;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCondition() {
      bitField0_ = (bitField0_ & ~0x00000008);
      condition_ = 0;
      onChanged();
      return this;
    }

    private int distanceMeters_;
    /**
     *
     *
     * <pre>
     * The travel distance of the route, in meters.
     * </pre>
     *
     * <code>int32 distance_meters = 4;</code>
     *
     * @return The distanceMeters.
     */
    @java.lang.Override
    public int getDistanceMeters() {
      return distanceMeters_;
    }
    /**
     *
     *
     * <pre>
     * The travel distance of the route, in meters.
     * </pre>
     *
     * <code>int32 distance_meters = 4;</code>
     *
     * @param value The distanceMeters to set.
     * @return This builder for chaining.
     */
    public Builder setDistanceMeters(int value) {

      distanceMeters_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The travel distance of the route, in meters.
     * </pre>
     *
     * <code>int32 distance_meters = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDistanceMeters() {
      bitField0_ = (bitField0_ & ~0x00000010);
      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_;
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     *
     * @return Whether the duration field is set.
     */
    public boolean hasDuration() {
      return ((bitField0_ & 0x00000020) != 0);
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     *
     * @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();
      }
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    public Builder setDuration(com.google.protobuf.Duration value) {
      if (durationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        duration_ = value;
      } else {
        durationBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) {
      if (durationBuilder_ == null) {
        duration_ = builderForValue.build();
      } else {
        durationBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    public Builder mergeDuration(com.google.protobuf.Duration value) {
      if (durationBuilder_ == null) {
        if (((bitField0_ & 0x00000020) != 0)
            && duration_ != null
            && duration_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getDurationBuilder().mergeFrom(value);
        } else {
          duration_ = value;
        }
      } else {
        durationBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    public Builder clearDuration() {
      bitField0_ = (bitField0_ & ~0x00000020);
      duration_ = null;
      if (durationBuilder_ != null) {
        durationBuilder_.dispose();
        durationBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    public com.google.protobuf.Duration.Builder getDurationBuilder() {
      bitField0_ |= 0x00000020;
      onChanged();
      return getDurationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() {
      if (durationBuilder_ != null) {
        return durationBuilder_.getMessageOrBuilder();
      } else {
        return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_;
      }
    }
    /**
     *
     *
     * <pre>
     * The length of time needed to navigate the route. If you set the
     * [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.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.
     * </pre>
     *
     * <code>.google.protobuf.Duration duration = 5;</code>
     */
    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_;
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     *
     * @return Whether the staticDuration field is set.
     */
    public boolean hasStaticDuration() {
      return ((bitField0_ & 0x00000040) != 0);
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     *
     * @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();
      }
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    public Builder setStaticDuration(com.google.protobuf.Duration value) {
      if (staticDurationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        staticDuration_ = value;
      } else {
        staticDurationBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    public Builder setStaticDuration(com.google.protobuf.Duration.Builder builderForValue) {
      if (staticDurationBuilder_ == null) {
        staticDuration_ = builderForValue.build();
      } else {
        staticDurationBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    public Builder mergeStaticDuration(com.google.protobuf.Duration value) {
      if (staticDurationBuilder_ == null) {
        if (((bitField0_ & 0x00000040) != 0)
            && staticDuration_ != null
            && staticDuration_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getStaticDurationBuilder().mergeFrom(value);
        } else {
          staticDuration_ = value;
        }
      } else {
        staticDurationBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    public Builder clearStaticDuration() {
      bitField0_ = (bitField0_ & ~0x00000040);
      staticDuration_ = null;
      if (staticDurationBuilder_ != null) {
        staticDurationBuilder_.dispose();
        staticDurationBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    public com.google.protobuf.Duration.Builder getStaticDurationBuilder() {
      bitField0_ |= 0x00000040;
      onChanged();
      return getStaticDurationFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder() {
      if (staticDurationBuilder_ != null) {
        return staticDurationBuilder_.getMessageOrBuilder();
      } else {
        return staticDuration_ == null
            ? com.google.protobuf.Duration.getDefaultInstance()
            : staticDuration_;
      }
    }
    /**
     *
     *
     * <pre>
     * The duration of traveling through the route without taking traffic
     * conditions into consideration.
     * </pre>
     *
     * <code>.google.protobuf.Duration static_duration = 6;</code>
     */
    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_;
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     *
     * @return Whether the travelAdvisory field is set.
     */
    public boolean hasTravelAdvisory() {
      return ((bitField0_ & 0x00000080) != 0);
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     *
     * @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();
      }
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    public Builder setTravelAdvisory(com.google.maps.routing.v2.RouteTravelAdvisory value) {
      if (travelAdvisoryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        travelAdvisory_ = value;
      } else {
        travelAdvisoryBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    public Builder setTravelAdvisory(
        com.google.maps.routing.v2.RouteTravelAdvisory.Builder builderForValue) {
      if (travelAdvisoryBuilder_ == null) {
        travelAdvisory_ = builderForValue.build();
      } else {
        travelAdvisoryBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    public Builder mergeTravelAdvisory(com.google.maps.routing.v2.RouteTravelAdvisory value) {
      if (travelAdvisoryBuilder_ == null) {
        if (((bitField0_ & 0x00000080) != 0)
            && travelAdvisory_ != null
            && travelAdvisory_
                != com.google.maps.routing.v2.RouteTravelAdvisory.getDefaultInstance()) {
          getTravelAdvisoryBuilder().mergeFrom(value);
        } else {
          travelAdvisory_ = value;
        }
      } else {
        travelAdvisoryBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    public Builder clearTravelAdvisory() {
      bitField0_ = (bitField0_ & ~0x00000080);
      travelAdvisory_ = null;
      if (travelAdvisoryBuilder_ != null) {
        travelAdvisoryBuilder_.dispose();
        travelAdvisoryBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    public com.google.maps.routing.v2.RouteTravelAdvisory.Builder getTravelAdvisoryBuilder() {
      bitField0_ |= 0x00000080;
      onChanged();
      return getTravelAdvisoryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    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_;
      }
    }
    /**
     *
     *
     * <pre>
     * Additional information about the route. For example: restriction
     * information and toll information
     * </pre>
     *
     * <code>.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;</code>
     */
    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_;
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     *
     * @return Whether the fallbackInfo field is set.
     */
    public boolean hasFallbackInfo() {
      return ((bitField0_ & 0x00000100) != 0);
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     *
     * @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();
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    public Builder setFallbackInfo(com.google.maps.routing.v2.FallbackInfo value) {
      if (fallbackInfoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        fallbackInfo_ = value;
      } else {
        fallbackInfoBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    public Builder setFallbackInfo(
        com.google.maps.routing.v2.FallbackInfo.Builder builderForValue) {
      if (fallbackInfoBuilder_ == null) {
        fallbackInfo_ = builderForValue.build();
      } else {
        fallbackInfoBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    public Builder mergeFallbackInfo(com.google.maps.routing.v2.FallbackInfo value) {
      if (fallbackInfoBuilder_ == null) {
        if (((bitField0_ & 0x00000100) != 0)
            && fallbackInfo_ != null
            && fallbackInfo_ != com.google.maps.routing.v2.FallbackInfo.getDefaultInstance()) {
          getFallbackInfoBuilder().mergeFrom(value);
        } else {
          fallbackInfo_ = value;
        }
      } else {
        fallbackInfoBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    public Builder clearFallbackInfo() {
      bitField0_ = (bitField0_ & ~0x00000100);
      fallbackInfo_ = null;
      if (fallbackInfoBuilder_ != null) {
        fallbackInfoBuilder_.dispose();
        fallbackInfoBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    public com.google.maps.routing.v2.FallbackInfo.Builder getFallbackInfoBuilder() {
      bitField0_ |= 0x00000100;
      onChanged();
      return getFallbackInfoFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    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_;
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>.google.maps.routing.v2.FallbackInfo fallback_info = 8;</code>
     */
    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<RouteMatrixElement> PARSER =
      new com.google.protobuf.AbstractParser<RouteMatrixElement>() {
        @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<RouteMatrixElement> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<RouteMatrixElement> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.maps.routing.v2.RouteMatrixElement getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
