/*
 * Copyright 2023 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/cloud/vmwareengine/v1/vmwareengine_resources.proto

package com.google.cloud.vmwareengine.v1;

/**
 *
 *
 * <pre>
 * Exchanged network peering route.
 * </pre>
 *
 * Protobuf type {@code google.cloud.vmwareengine.v1.PeeringRoute}
 */
public final class PeeringRoute extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.vmwareengine.v1.PeeringRoute)
    PeeringRouteOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use PeeringRoute.newBuilder() to construct.
  private PeeringRoute(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private PeeringRoute() {
    destRange_ = "";
    type_ = 0;
    nextHopRegion_ = "";
    direction_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new PeeringRoute();
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.vmwareengine.v1.VmwareengineResourcesProto
        .internal_static_google_cloud_vmwareengine_v1_PeeringRoute_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.vmwareengine.v1.VmwareengineResourcesProto
        .internal_static_google_cloud_vmwareengine_v1_PeeringRoute_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.vmwareengine.v1.PeeringRoute.class,
            com.google.cloud.vmwareengine.v1.PeeringRoute.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * The type of the peering route.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.vmwareengine.v1.PeeringRoute.Type}
   */
  public enum Type implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Unspecified peering route type. This is the default value.
     * </pre>
     *
     * <code>TYPE_UNSPECIFIED = 0;</code>
     */
    TYPE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * Dynamic routes in the peer network.
     * </pre>
     *
     * <code>DYNAMIC_PEERING_ROUTE = 1;</code>
     */
    DYNAMIC_PEERING_ROUTE(1),
    /**
     *
     *
     * <pre>
     * Static routes in the peer network.
     * </pre>
     *
     * <code>STATIC_PEERING_ROUTE = 2;</code>
     */
    STATIC_PEERING_ROUTE(2),
    /**
     *
     *
     * <pre>
     * Created, updated, and removed automatically by Google Cloud when subnets
     * are created, modified, or deleted in the peer network.
     * </pre>
     *
     * <code>SUBNET_PEERING_ROUTE = 3;</code>
     */
    SUBNET_PEERING_ROUTE(3),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Unspecified peering route type. This is the default value.
     * </pre>
     *
     * <code>TYPE_UNSPECIFIED = 0;</code>
     */
    public static final int TYPE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * Dynamic routes in the peer network.
     * </pre>
     *
     * <code>DYNAMIC_PEERING_ROUTE = 1;</code>
     */
    public static final int DYNAMIC_PEERING_ROUTE_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Static routes in the peer network.
     * </pre>
     *
     * <code>STATIC_PEERING_ROUTE = 2;</code>
     */
    public static final int STATIC_PEERING_ROUTE_VALUE = 2;
    /**
     *
     *
     * <pre>
     * Created, updated, and removed automatically by Google Cloud when subnets
     * are created, modified, or deleted in the peer network.
     * </pre>
     *
     * <code>SUBNET_PEERING_ROUTE = 3;</code>
     */
    public static final int SUBNET_PEERING_ROUTE_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 Type 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 Type forNumber(int value) {
      switch (value) {
        case 0:
          return TYPE_UNSPECIFIED;
        case 1:
          return DYNAMIC_PEERING_ROUTE;
        case 2:
          return STATIC_PEERING_ROUTE;
        case 3:
          return SUBNET_PEERING_ROUTE;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Type> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<Type> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<Type>() {
          public Type findValueByNumber(int number) {
            return Type.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.cloud.vmwareengine.v1.PeeringRoute.getDescriptor().getEnumTypes().get(0);
    }

    private static final Type[] VALUES = values();

    public static Type 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 Type(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.vmwareengine.v1.PeeringRoute.Type)
  }

  /**
   *
   *
   * <pre>
   * The direction of the exchanged routes.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.vmwareengine.v1.PeeringRoute.Direction}
   */
  public enum Direction implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Unspecified exchanged routes direction. This is default.
     * </pre>
     *
     * <code>DIRECTION_UNSPECIFIED = 0;</code>
     */
    DIRECTION_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * Routes imported from the peer network.
     * </pre>
     *
     * <code>INCOMING = 1;</code>
     */
    INCOMING(1),
    /**
     *
     *
     * <pre>
     * Routes exported to the peer network.
     * </pre>
     *
     * <code>OUTGOING = 2;</code>
     */
    OUTGOING(2),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Unspecified exchanged routes direction. This is default.
     * </pre>
     *
     * <code>DIRECTION_UNSPECIFIED = 0;</code>
     */
    public static final int DIRECTION_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * Routes imported from the peer network.
     * </pre>
     *
     * <code>INCOMING = 1;</code>
     */
    public static final int INCOMING_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Routes exported to the peer network.
     * </pre>
     *
     * <code>OUTGOING = 2;</code>
     */
    public static final int OUTGOING_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 Direction 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 Direction forNumber(int value) {
      switch (value) {
        case 0:
          return DIRECTION_UNSPECIFIED;
        case 1:
          return INCOMING;
        case 2:
          return OUTGOING;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Direction> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<Direction> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<Direction>() {
          public Direction findValueByNumber(int number) {
            return Direction.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.cloud.vmwareengine.v1.PeeringRoute.getDescriptor().getEnumTypes().get(1);
    }

    private static final Direction[] VALUES = values();

    public static Direction 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 Direction(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.vmwareengine.v1.PeeringRoute.Direction)
  }

  public static final int DEST_RANGE_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object destRange_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Destination range of the peering route in CIDR notation.
   * </pre>
   *
   * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The destRange.
   */
  @java.lang.Override
  public java.lang.String getDestRange() {
    java.lang.Object ref = destRange_;
    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();
      destRange_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Destination range of the peering route in CIDR notation.
   * </pre>
   *
   * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for destRange.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDestRangeBytes() {
    java.lang.Object ref = destRange_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      destRange_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TYPE_FIELD_NUMBER = 2;
  private int type_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. Type of the route in the peer VPC network.
   * </pre>
   *
   * <code>
   * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The enum numeric value on the wire for type.
   */
  @java.lang.Override
  public int getTypeValue() {
    return type_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Type of the route in the peer VPC network.
   * </pre>
   *
   * <code>
   * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The type.
   */
  @java.lang.Override
  public com.google.cloud.vmwareengine.v1.PeeringRoute.Type getType() {
    com.google.cloud.vmwareengine.v1.PeeringRoute.Type result =
        com.google.cloud.vmwareengine.v1.PeeringRoute.Type.forNumber(type_);
    return result == null
        ? com.google.cloud.vmwareengine.v1.PeeringRoute.Type.UNRECOGNIZED
        : result;
  }

  public static final int NEXT_HOP_REGION_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object nextHopRegion_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Region containing the next hop of the peering route. This
   * field only applies to dynamic routes in the peer VPC network.
   * </pre>
   *
   * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The nextHopRegion.
   */
  @java.lang.Override
  public java.lang.String getNextHopRegion() {
    java.lang.Object ref = nextHopRegion_;
    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();
      nextHopRegion_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Region containing the next hop of the peering route. This
   * field only applies to dynamic routes in the peer VPC network.
   * </pre>
   *
   * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for nextHopRegion.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNextHopRegionBytes() {
    java.lang.Object ref = nextHopRegion_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      nextHopRegion_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PRIORITY_FIELD_NUMBER = 4;
  private long priority_ = 0L;
  /**
   *
   *
   * <pre>
   * Output only. The priority of the peering route.
   * </pre>
   *
   * <code>int64 priority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The priority.
   */
  @java.lang.Override
  public long getPriority() {
    return priority_;
  }

  public static final int IMPORTED_FIELD_NUMBER = 5;
  private boolean imported_ = false;
  /**
   *
   *
   * <pre>
   * Output only. True if the peering route has been imported from a peered
   * VPC network; false otherwise. The import happens if the field
   * `NetworkPeering.importCustomRoutes` is true for this network,
   * `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
   * the import does not result in a route conflict.
   * </pre>
   *
   * <code>bool imported = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The imported.
   */
  @java.lang.Override
  public boolean getImported() {
    return imported_;
  }

  public static final int DIRECTION_FIELD_NUMBER = 6;
  private int direction_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. Direction of the routes exchanged with the peer network, from
   * the VMware Engine network perspective:
   *
   * * Routes of direction `INCOMING` are imported from the peer network.
   * * Routes of direction `OUTGOING` are exported from the intranet VPC network
   * of the VMware Engine network.
   * </pre>
   *
   * <code>
   * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The enum numeric value on the wire for direction.
   */
  @java.lang.Override
  public int getDirectionValue() {
    return direction_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Direction of the routes exchanged with the peer network, from
   * the VMware Engine network perspective:
   *
   * * Routes of direction `INCOMING` are imported from the peer network.
   * * Routes of direction `OUTGOING` are exported from the intranet VPC network
   * of the VMware Engine network.
   * </pre>
   *
   * <code>
   * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The direction.
   */
  @java.lang.Override
  public com.google.cloud.vmwareengine.v1.PeeringRoute.Direction getDirection() {
    com.google.cloud.vmwareengine.v1.PeeringRoute.Direction result =
        com.google.cloud.vmwareengine.v1.PeeringRoute.Direction.forNumber(direction_);
    return result == null
        ? com.google.cloud.vmwareengine.v1.PeeringRoute.Direction.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destRange_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destRange_);
    }
    if (type_ != com.google.cloud.vmwareengine.v1.PeeringRoute.Type.TYPE_UNSPECIFIED.getNumber()) {
      output.writeEnum(2, type_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextHopRegion_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextHopRegion_);
    }
    if (priority_ != 0L) {
      output.writeInt64(4, priority_);
    }
    if (imported_ != false) {
      output.writeBool(5, imported_);
    }
    if (direction_
        != com.google.cloud.vmwareengine.v1.PeeringRoute.Direction.DIRECTION_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(6, direction_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destRange_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destRange_);
    }
    if (type_ != com.google.cloud.vmwareengine.v1.PeeringRoute.Type.TYPE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextHopRegion_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextHopRegion_);
    }
    if (priority_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, priority_);
    }
    if (imported_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, imported_);
    }
    if (direction_
        != com.google.cloud.vmwareengine.v1.PeeringRoute.Direction.DIRECTION_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, direction_);
    }
    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.cloud.vmwareengine.v1.PeeringRoute)) {
      return super.equals(obj);
    }
    com.google.cloud.vmwareengine.v1.PeeringRoute other =
        (com.google.cloud.vmwareengine.v1.PeeringRoute) obj;

    if (!getDestRange().equals(other.getDestRange())) return false;
    if (type_ != other.type_) return false;
    if (!getNextHopRegion().equals(other.getNextHopRegion())) return false;
    if (getPriority() != other.getPriority()) return false;
    if (getImported() != other.getImported()) return false;
    if (direction_ != other.direction_) 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) + DEST_RANGE_FIELD_NUMBER;
    hash = (53 * hash) + getDestRange().hashCode();
    hash = (37 * hash) + TYPE_FIELD_NUMBER;
    hash = (53 * hash) + type_;
    hash = (37 * hash) + NEXT_HOP_REGION_FIELD_NUMBER;
    hash = (53 * hash) + getNextHopRegion().hashCode();
    hash = (37 * hash) + PRIORITY_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPriority());
    hash = (37 * hash) + IMPORTED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getImported());
    hash = (37 * hash) + DIRECTION_FIELD_NUMBER;
    hash = (53 * hash) + direction_;
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute 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.cloud.vmwareengine.v1.PeeringRoute parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute 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.cloud.vmwareengine.v1.PeeringRoute parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute 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.cloud.vmwareengine.v1.PeeringRoute parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute 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.cloud.vmwareengine.v1.PeeringRoute 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>
   * Exchanged network peering route.
   * </pre>
   *
   * Protobuf type {@code google.cloud.vmwareengine.v1.PeeringRoute}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.vmwareengine.v1.PeeringRoute)
      com.google.cloud.vmwareengine.v1.PeeringRouteOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.vmwareengine.v1.VmwareengineResourcesProto
          .internal_static_google_cloud_vmwareengine_v1_PeeringRoute_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.vmwareengine.v1.VmwareengineResourcesProto
          .internal_static_google_cloud_vmwareengine_v1_PeeringRoute_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.vmwareengine.v1.PeeringRoute.class,
              com.google.cloud.vmwareengine.v1.PeeringRoute.Builder.class);
    }

    // Construct using com.google.cloud.vmwareengine.v1.PeeringRoute.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      destRange_ = "";
      type_ = 0;
      nextHopRegion_ = "";
      priority_ = 0L;
      imported_ = false;
      direction_ = 0;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.vmwareengine.v1.VmwareengineResourcesProto
          .internal_static_google_cloud_vmwareengine_v1_PeeringRoute_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.vmwareengine.v1.PeeringRoute getDefaultInstanceForType() {
      return com.google.cloud.vmwareengine.v1.PeeringRoute.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.vmwareengine.v1.PeeringRoute build() {
      com.google.cloud.vmwareengine.v1.PeeringRoute result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.vmwareengine.v1.PeeringRoute buildPartial() {
      com.google.cloud.vmwareengine.v1.PeeringRoute result =
          new com.google.cloud.vmwareengine.v1.PeeringRoute(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.cloud.vmwareengine.v1.PeeringRoute result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.destRange_ = destRange_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.type_ = type_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.nextHopRegion_ = nextHopRegion_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.priority_ = priority_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.imported_ = imported_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.direction_ = direction_;
      }
    }

    @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.cloud.vmwareengine.v1.PeeringRoute) {
        return mergeFrom((com.google.cloud.vmwareengine.v1.PeeringRoute) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.vmwareengine.v1.PeeringRoute other) {
      if (other == com.google.cloud.vmwareengine.v1.PeeringRoute.getDefaultInstance()) return this;
      if (!other.getDestRange().isEmpty()) {
        destRange_ = other.destRange_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.type_ != 0) {
        setTypeValue(other.getTypeValue());
      }
      if (!other.getNextHopRegion().isEmpty()) {
        nextHopRegion_ = other.nextHopRegion_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.getPriority() != 0L) {
        setPriority(other.getPriority());
      }
      if (other.getImported() != false) {
        setImported(other.getImported());
      }
      if (other.direction_ != 0) {
        setDirectionValue(other.getDirectionValue());
      }
      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:
              {
                destRange_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 16:
              {
                type_ = input.readEnum();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
            case 26:
              {
                nextHopRegion_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 32:
              {
                priority_ = input.readInt64();
                bitField0_ |= 0x00000008;
                break;
              } // case 32
            case 40:
              {
                imported_ = input.readBool();
                bitField0_ |= 0x00000010;
                break;
              } // case 40
            case 48:
              {
                direction_ = input.readEnum();
                bitField0_ |= 0x00000020;
                break;
              } // case 48
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object destRange_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Destination range of the peering route in CIDR notation.
     * </pre>
     *
     * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The destRange.
     */
    public java.lang.String getDestRange() {
      java.lang.Object ref = destRange_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        destRange_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Destination range of the peering route in CIDR notation.
     * </pre>
     *
     * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for destRange.
     */
    public com.google.protobuf.ByteString getDestRangeBytes() {
      java.lang.Object ref = destRange_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        destRange_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Destination range of the peering route in CIDR notation.
     * </pre>
     *
     * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The destRange to set.
     * @return This builder for chaining.
     */
    public Builder setDestRange(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      destRange_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Destination range of the peering route in CIDR notation.
     * </pre>
     *
     * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDestRange() {
      destRange_ = getDefaultInstance().getDestRange();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Destination range of the peering route in CIDR notation.
     * </pre>
     *
     * <code>string dest_range = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for destRange to set.
     * @return This builder for chaining.
     */
    public Builder setDestRangeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      destRange_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private int type_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. Type of the route in the peer VPC network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The enum numeric value on the wire for type.
     */
    @java.lang.Override
    public int getTypeValue() {
      return type_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Type of the route in the peer VPC network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The enum numeric value on the wire for type to set.
     * @return This builder for chaining.
     */
    public Builder setTypeValue(int value) {
      type_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Type of the route in the peer VPC network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The type.
     */
    @java.lang.Override
    public com.google.cloud.vmwareengine.v1.PeeringRoute.Type getType() {
      com.google.cloud.vmwareengine.v1.PeeringRoute.Type result =
          com.google.cloud.vmwareengine.v1.PeeringRoute.Type.forNumber(type_);
      return result == null
          ? com.google.cloud.vmwareengine.v1.PeeringRoute.Type.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Output only. Type of the route in the peer VPC network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The type to set.
     * @return This builder for chaining.
     */
    public Builder setType(com.google.cloud.vmwareengine.v1.PeeringRoute.Type value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000002;
      type_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Type of the route in the peer VPC network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Type type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearType() {
      bitField0_ = (bitField0_ & ~0x00000002);
      type_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object nextHopRegion_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Region containing the next hop of the peering route. This
     * field only applies to dynamic routes in the peer VPC network.
     * </pre>
     *
     * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The nextHopRegion.
     */
    public java.lang.String getNextHopRegion() {
      java.lang.Object ref = nextHopRegion_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        nextHopRegion_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Region containing the next hop of the peering route. This
     * field only applies to dynamic routes in the peer VPC network.
     * </pre>
     *
     * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for nextHopRegion.
     */
    public com.google.protobuf.ByteString getNextHopRegionBytes() {
      java.lang.Object ref = nextHopRegion_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        nextHopRegion_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Region containing the next hop of the peering route. This
     * field only applies to dynamic routes in the peer VPC network.
     * </pre>
     *
     * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The nextHopRegion to set.
     * @return This builder for chaining.
     */
    public Builder setNextHopRegion(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      nextHopRegion_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Region containing the next hop of the peering route. This
     * field only applies to dynamic routes in the peer VPC network.
     * </pre>
     *
     * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNextHopRegion() {
      nextHopRegion_ = getDefaultInstance().getNextHopRegion();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Region containing the next hop of the peering route. This
     * field only applies to dynamic routes in the peer VPC network.
     * </pre>
     *
     * <code>string next_hop_region = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for nextHopRegion to set.
     * @return This builder for chaining.
     */
    public Builder setNextHopRegionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      nextHopRegion_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private long priority_;
    /**
     *
     *
     * <pre>
     * Output only. The priority of the peering route.
     * </pre>
     *
     * <code>int64 priority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The priority.
     */
    @java.lang.Override
    public long getPriority() {
      return priority_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The priority of the peering route.
     * </pre>
     *
     * <code>int64 priority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The priority to set.
     * @return This builder for chaining.
     */
    public Builder setPriority(long value) {

      priority_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The priority of the peering route.
     * </pre>
     *
     * <code>int64 priority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPriority() {
      bitField0_ = (bitField0_ & ~0x00000008);
      priority_ = 0L;
      onChanged();
      return this;
    }

    private boolean imported_;
    /**
     *
     *
     * <pre>
     * Output only. True if the peering route has been imported from a peered
     * VPC network; false otherwise. The import happens if the field
     * `NetworkPeering.importCustomRoutes` is true for this network,
     * `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
     * the import does not result in a route conflict.
     * </pre>
     *
     * <code>bool imported = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The imported.
     */
    @java.lang.Override
    public boolean getImported() {
      return imported_;
    }
    /**
     *
     *
     * <pre>
     * Output only. True if the peering route has been imported from a peered
     * VPC network; false otherwise. The import happens if the field
     * `NetworkPeering.importCustomRoutes` is true for this network,
     * `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
     * the import does not result in a route conflict.
     * </pre>
     *
     * <code>bool imported = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The imported to set.
     * @return This builder for chaining.
     */
    public Builder setImported(boolean value) {

      imported_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. True if the peering route has been imported from a peered
     * VPC network; false otherwise. The import happens if the field
     * `NetworkPeering.importCustomRoutes` is true for this network,
     * `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
     * the import does not result in a route conflict.
     * </pre>
     *
     * <code>bool imported = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearImported() {
      bitField0_ = (bitField0_ & ~0x00000010);
      imported_ = false;
      onChanged();
      return this;
    }

    private int direction_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. Direction of the routes exchanged with the peer network, from
     * the VMware Engine network perspective:
     *
     * * Routes of direction `INCOMING` are imported from the peer network.
     * * Routes of direction `OUTGOING` are exported from the intranet VPC network
     * of the VMware Engine network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The enum numeric value on the wire for direction.
     */
    @java.lang.Override
    public int getDirectionValue() {
      return direction_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Direction of the routes exchanged with the peer network, from
     * the VMware Engine network perspective:
     *
     * * Routes of direction `INCOMING` are imported from the peer network.
     * * Routes of direction `OUTGOING` are exported from the intranet VPC network
     * of the VMware Engine network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The enum numeric value on the wire for direction to set.
     * @return This builder for chaining.
     */
    public Builder setDirectionValue(int value) {
      direction_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Direction of the routes exchanged with the peer network, from
     * the VMware Engine network perspective:
     *
     * * Routes of direction `INCOMING` are imported from the peer network.
     * * Routes of direction `OUTGOING` are exported from the intranet VPC network
     * of the VMware Engine network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The direction.
     */
    @java.lang.Override
    public com.google.cloud.vmwareengine.v1.PeeringRoute.Direction getDirection() {
      com.google.cloud.vmwareengine.v1.PeeringRoute.Direction result =
          com.google.cloud.vmwareengine.v1.PeeringRoute.Direction.forNumber(direction_);
      return result == null
          ? com.google.cloud.vmwareengine.v1.PeeringRoute.Direction.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Output only. Direction of the routes exchanged with the peer network, from
     * the VMware Engine network perspective:
     *
     * * Routes of direction `INCOMING` are imported from the peer network.
     * * Routes of direction `OUTGOING` are exported from the intranet VPC network
     * of the VMware Engine network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The direction to set.
     * @return This builder for chaining.
     */
    public Builder setDirection(com.google.cloud.vmwareengine.v1.PeeringRoute.Direction value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000020;
      direction_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Direction of the routes exchanged with the peer network, from
     * the VMware Engine network perspective:
     *
     * * Routes of direction `INCOMING` are imported from the peer network.
     * * Routes of direction `OUTGOING` are exported from the intranet VPC network
     * of the VMware Engine network.
     * </pre>
     *
     * <code>
     * .google.cloud.vmwareengine.v1.PeeringRoute.Direction direction = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDirection() {
      bitField0_ = (bitField0_ & ~0x00000020);
      direction_ = 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.cloud.vmwareengine.v1.PeeringRoute)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.vmwareengine.v1.PeeringRoute)
  private static final com.google.cloud.vmwareengine.v1.PeeringRoute DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.vmwareengine.v1.PeeringRoute();
  }

  public static com.google.cloud.vmwareengine.v1.PeeringRoute getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<PeeringRoute> PARSER =
      new com.google.protobuf.AbstractParser<PeeringRoute>() {
        @java.lang.Override
        public PeeringRoute 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<PeeringRoute> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.cloud.vmwareengine.v1.PeeringRoute getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
