// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/spanner/v1/query_plan.proto

package com.google.spanner.v1;

/**
 * <pre>
 * Node information for nodes appearing in a [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
 * </pre>
 *
 * Protobuf type {@code google.spanner.v1.PlanNode}
 */
public  final class PlanNode extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.spanner.v1.PlanNode)
    PlanNodeOrBuilder {
private static final long serialVersionUID = 0L;
  // Use PlanNode.newBuilder() to construct.
  private PlanNode(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private PlanNode() {
    index_ = 0;
    kind_ = 0;
    displayName_ = "";
    childLinks_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private PlanNode(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 8: {

            index_ = input.readInt32();
            break;
          }
          case 16: {
            int rawValue = input.readEnum();

            kind_ = rawValue;
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            displayName_ = s;
            break;
          }
          case 34: {
            if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
              childLinks_ = new java.util.ArrayList<com.google.spanner.v1.PlanNode.ChildLink>();
              mutable_bitField0_ |= 0x00000008;
            }
            childLinks_.add(
                input.readMessage(com.google.spanner.v1.PlanNode.ChildLink.parser(), extensionRegistry));
            break;
          }
          case 42: {
            com.google.spanner.v1.PlanNode.ShortRepresentation.Builder subBuilder = null;
            if (shortRepresentation_ != null) {
              subBuilder = shortRepresentation_.toBuilder();
            }
            shortRepresentation_ = input.readMessage(com.google.spanner.v1.PlanNode.ShortRepresentation.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(shortRepresentation_);
              shortRepresentation_ = subBuilder.buildPartial();
            }

            break;
          }
          case 50: {
            com.google.protobuf.Struct.Builder subBuilder = null;
            if (metadata_ != null) {
              subBuilder = metadata_.toBuilder();
            }
            metadata_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(metadata_);
              metadata_ = subBuilder.buildPartial();
            }

            break;
          }
          case 58: {
            com.google.protobuf.Struct.Builder subBuilder = null;
            if (executionStats_ != null) {
              subBuilder = executionStats_.toBuilder();
            }
            executionStats_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(executionStats_);
              executionStats_ = subBuilder.buildPartial();
            }

            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
        childLinks_ = java.util.Collections.unmodifiableList(childLinks_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.spanner.v1.PlanNode.class, com.google.spanner.v1.PlanNode.Builder.class);
  }

  /**
   * <pre>
   * The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between the two different kinds of
   * nodes that can appear in a query plan.
   * </pre>
   *
   * Protobuf enum {@code google.spanner.v1.PlanNode.Kind}
   */
  public enum Kind
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * Not specified.
     * </pre>
     *
     * <code>KIND_UNSPECIFIED = 0;</code>
     */
    KIND_UNSPECIFIED(0),
    /**
     * <pre>
     * Denotes a Relational operator node in the expression tree. Relational
     * operators represent iterative processing of rows during query execution.
     * For example, a `TableScan` operation that reads rows from a table.
     * </pre>
     *
     * <code>RELATIONAL = 1;</code>
     */
    RELATIONAL(1),
    /**
     * <pre>
     * Denotes a Scalar node in the expression tree. Scalar nodes represent
     * non-iterable entities in the query plan. For example, constants or
     * arithmetic operators appearing inside predicate expressions or references
     * to column names.
     * </pre>
     *
     * <code>SCALAR = 2;</code>
     */
    SCALAR(2),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Not specified.
     * </pre>
     *
     * <code>KIND_UNSPECIFIED = 0;</code>
     */
    public static final int KIND_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * Denotes a Relational operator node in the expression tree. Relational
     * operators represent iterative processing of rows during query execution.
     * For example, a `TableScan` operation that reads rows from a table.
     * </pre>
     *
     * <code>RELATIONAL = 1;</code>
     */
    public static final int RELATIONAL_VALUE = 1;
    /**
     * <pre>
     * Denotes a Scalar node in the expression tree. Scalar nodes represent
     * non-iterable entities in the query plan. For example, constants or
     * arithmetic operators appearing inside predicate expressions or references
     * to column names.
     * </pre>
     *
     * <code>SCALAR = 2;</code>
     */
    public static final int SCALAR_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;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static Kind valueOf(int value) {
      return forNumber(value);
    }

    public static Kind forNumber(int value) {
      switch (value) {
        case 0: return KIND_UNSPECIFIED;
        case 1: return RELATIONAL;
        case 2: return SCALAR;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Kind>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        Kind> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Kind>() {
            public Kind findValueByNumber(int number) {
              return Kind.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      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.spanner.v1.PlanNode.getDescriptor().getEnumTypes().get(0);
    }

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

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

    // @@protoc_insertion_point(enum_scope:google.spanner.v1.PlanNode.Kind)
  }

  public interface ChildLinkOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.spanner.v1.PlanNode.ChildLink)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The node to which the link points.
     * </pre>
     *
     * <code>int32 child_index = 1;</code>
     */
    int getChildIndex();

    /**
     * <pre>
     * The type of the link. For example, in Hash Joins this could be used to
     * distinguish between the build child and the probe child, or in the case
     * of the child being an output variable, to represent the tag associated
     * with the output variable.
     * </pre>
     *
     * <code>string type = 2;</code>
     */
    java.lang.String getType();
    /**
     * <pre>
     * The type of the link. For example, in Hash Joins this could be used to
     * distinguish between the build child and the probe child, or in the case
     * of the child being an output variable, to represent the tag associated
     * with the output variable.
     * </pre>
     *
     * <code>string type = 2;</code>
     */
    com.google.protobuf.ByteString
        getTypeBytes();

    /**
     * <pre>
     * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
     * to an output variable of the parent node. The field carries the name of
     * the output variable.
     * For example, a `TableScan` operator that reads rows from a table will
     * have child links to the `SCALAR` nodes representing the output variables
     * created for each column that is read by the operator. The corresponding
     * `variable` fields will be set to the variable names assigned to the
     * columns.
     * </pre>
     *
     * <code>string variable = 3;</code>
     */
    java.lang.String getVariable();
    /**
     * <pre>
     * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
     * to an output variable of the parent node. The field carries the name of
     * the output variable.
     * For example, a `TableScan` operator that reads rows from a table will
     * have child links to the `SCALAR` nodes representing the output variables
     * created for each column that is read by the operator. The corresponding
     * `variable` fields will be set to the variable names assigned to the
     * columns.
     * </pre>
     *
     * <code>string variable = 3;</code>
     */
    com.google.protobuf.ByteString
        getVariableBytes();
  }
  /**
   * <pre>
   * Metadata associated with a parent-child relationship appearing in a
   * [PlanNode][google.spanner.v1.PlanNode].
   * </pre>
   *
   * Protobuf type {@code google.spanner.v1.PlanNode.ChildLink}
   */
  public  static final class ChildLink extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:google.spanner.v1.PlanNode.ChildLink)
      ChildLinkOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use ChildLink.newBuilder() to construct.
    private ChildLink(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ChildLink() {
      childIndex_ = 0;
      type_ = "";
      variable_ = "";
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private ChildLink(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownFieldProto3(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {

              childIndex_ = input.readInt32();
              break;
            }
            case 18: {
              java.lang.String s = input.readStringRequireUtf8();

              type_ = s;
              break;
            }
            case 26: {
              java.lang.String s = input.readStringRequireUtf8();

              variable_ = s;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ChildLink_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ChildLink_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.spanner.v1.PlanNode.ChildLink.class, com.google.spanner.v1.PlanNode.ChildLink.Builder.class);
    }

    public static final int CHILD_INDEX_FIELD_NUMBER = 1;
    private int childIndex_;
    /**
     * <pre>
     * The node to which the link points.
     * </pre>
     *
     * <code>int32 child_index = 1;</code>
     */
    public int getChildIndex() {
      return childIndex_;
    }

    public static final int TYPE_FIELD_NUMBER = 2;
    private volatile java.lang.Object type_;
    /**
     * <pre>
     * The type of the link. For example, in Hash Joins this could be used to
     * distinguish between the build child and the probe child, or in the case
     * of the child being an output variable, to represent the tag associated
     * with the output variable.
     * </pre>
     *
     * <code>string type = 2;</code>
     */
    public java.lang.String getType() {
      java.lang.Object ref = type_;
      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();
        type_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The type of the link. For example, in Hash Joins this could be used to
     * distinguish between the build child and the probe child, or in the case
     * of the child being an output variable, to represent the tag associated
     * with the output variable.
     * </pre>
     *
     * <code>string type = 2;</code>
     */
    public com.google.protobuf.ByteString
        getTypeBytes() {
      java.lang.Object ref = type_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        type_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int VARIABLE_FIELD_NUMBER = 3;
    private volatile java.lang.Object variable_;
    /**
     * <pre>
     * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
     * to an output variable of the parent node. The field carries the name of
     * the output variable.
     * For example, a `TableScan` operator that reads rows from a table will
     * have child links to the `SCALAR` nodes representing the output variables
     * created for each column that is read by the operator. The corresponding
     * `variable` fields will be set to the variable names assigned to the
     * columns.
     * </pre>
     *
     * <code>string variable = 3;</code>
     */
    public java.lang.String getVariable() {
      java.lang.Object ref = variable_;
      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();
        variable_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
     * to an output variable of the parent node. The field carries the name of
     * the output variable.
     * For example, a `TableScan` operator that reads rows from a table will
     * have child links to the `SCALAR` nodes representing the output variables
     * created for each column that is read by the operator. The corresponding
     * `variable` fields will be set to the variable names assigned to the
     * columns.
     * </pre>
     *
     * <code>string variable = 3;</code>
     */
    public com.google.protobuf.ByteString
        getVariableBytes() {
      java.lang.Object ref = variable_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        variable_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (childIndex_ != 0) {
        output.writeInt32(1, childIndex_);
      }
      if (!getTypeBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_);
      }
      if (!getVariableBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, variable_);
      }
      unknownFields.writeTo(output);
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (childIndex_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, childIndex_);
      }
      if (!getTypeBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_);
      }
      if (!getVariableBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, variable_);
      }
      size += unknownFields.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.spanner.v1.PlanNode.ChildLink)) {
        return super.equals(obj);
      }
      com.google.spanner.v1.PlanNode.ChildLink other = (com.google.spanner.v1.PlanNode.ChildLink) obj;

      boolean result = true;
      result = result && (getChildIndex()
          == other.getChildIndex());
      result = result && getType()
          .equals(other.getType());
      result = result && getVariable()
          .equals(other.getVariable());
      result = result && unknownFields.equals(other.unknownFields);
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + CHILD_INDEX_FIELD_NUMBER;
      hash = (53 * hash) + getChildIndex();
      hash = (37 * hash) + TYPE_FIELD_NUMBER;
      hash = (53 * hash) + getType().hashCode();
      hash = (37 * hash) + VARIABLE_FIELD_NUMBER;
      hash = (53 * hash) + getVariable().hashCode();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.spanner.v1.PlanNode.ChildLink parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink 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.spanner.v1.PlanNode.ChildLink parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink 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.spanner.v1.PlanNode.ChildLink parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink 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.spanner.v1.PlanNode.ChildLink parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static com.google.spanner.v1.PlanNode.ChildLink parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.google.spanner.v1.PlanNode.ChildLink prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    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>
     * Metadata associated with a parent-child relationship appearing in a
     * [PlanNode][google.spanner.v1.PlanNode].
     * </pre>
     *
     * Protobuf type {@code google.spanner.v1.PlanNode.ChildLink}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:google.spanner.v1.PlanNode.ChildLink)
        com.google.spanner.v1.PlanNode.ChildLinkOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ChildLink_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ChildLink_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.spanner.v1.PlanNode.ChildLink.class, com.google.spanner.v1.PlanNode.ChildLink.Builder.class);
      }

      // Construct using com.google.spanner.v1.PlanNode.ChildLink.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        childIndex_ = 0;

        type_ = "";

        variable_ = "";

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ChildLink_descriptor;
      }

      public com.google.spanner.v1.PlanNode.ChildLink getDefaultInstanceForType() {
        return com.google.spanner.v1.PlanNode.ChildLink.getDefaultInstance();
      }

      public com.google.spanner.v1.PlanNode.ChildLink build() {
        com.google.spanner.v1.PlanNode.ChildLink result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public com.google.spanner.v1.PlanNode.ChildLink buildPartial() {
        com.google.spanner.v1.PlanNode.ChildLink result = new com.google.spanner.v1.PlanNode.ChildLink(this);
        result.childIndex_ = childIndex_;
        result.type_ = type_;
        result.variable_ = variable_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, java.lang.Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.spanner.v1.PlanNode.ChildLink) {
          return mergeFrom((com.google.spanner.v1.PlanNode.ChildLink)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.spanner.v1.PlanNode.ChildLink other) {
        if (other == com.google.spanner.v1.PlanNode.ChildLink.getDefaultInstance()) return this;
        if (other.getChildIndex() != 0) {
          setChildIndex(other.getChildIndex());
        }
        if (!other.getType().isEmpty()) {
          type_ = other.type_;
          onChanged();
        }
        if (!other.getVariable().isEmpty()) {
          variable_ = other.variable_;
          onChanged();
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.spanner.v1.PlanNode.ChildLink parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.spanner.v1.PlanNode.ChildLink) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int childIndex_ ;
      /**
       * <pre>
       * The node to which the link points.
       * </pre>
       *
       * <code>int32 child_index = 1;</code>
       */
      public int getChildIndex() {
        return childIndex_;
      }
      /**
       * <pre>
       * The node to which the link points.
       * </pre>
       *
       * <code>int32 child_index = 1;</code>
       */
      public Builder setChildIndex(int value) {
        
        childIndex_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The node to which the link points.
       * </pre>
       *
       * <code>int32 child_index = 1;</code>
       */
      public Builder clearChildIndex() {
        
        childIndex_ = 0;
        onChanged();
        return this;
      }

      private java.lang.Object type_ = "";
      /**
       * <pre>
       * The type of the link. For example, in Hash Joins this could be used to
       * distinguish between the build child and the probe child, or in the case
       * of the child being an output variable, to represent the tag associated
       * with the output variable.
       * </pre>
       *
       * <code>string type = 2;</code>
       */
      public java.lang.String getType() {
        java.lang.Object ref = type_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          type_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The type of the link. For example, in Hash Joins this could be used to
       * distinguish between the build child and the probe child, or in the case
       * of the child being an output variable, to represent the tag associated
       * with the output variable.
       * </pre>
       *
       * <code>string type = 2;</code>
       */
      public com.google.protobuf.ByteString
          getTypeBytes() {
        java.lang.Object ref = type_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          type_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The type of the link. For example, in Hash Joins this could be used to
       * distinguish between the build child and the probe child, or in the case
       * of the child being an output variable, to represent the tag associated
       * with the output variable.
       * </pre>
       *
       * <code>string type = 2;</code>
       */
      public Builder setType(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        type_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The type of the link. For example, in Hash Joins this could be used to
       * distinguish between the build child and the probe child, or in the case
       * of the child being an output variable, to represent the tag associated
       * with the output variable.
       * </pre>
       *
       * <code>string type = 2;</code>
       */
      public Builder clearType() {
        
        type_ = getDefaultInstance().getType();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The type of the link. For example, in Hash Joins this could be used to
       * distinguish between the build child and the probe child, or in the case
       * of the child being an output variable, to represent the tag associated
       * with the output variable.
       * </pre>
       *
       * <code>string type = 2;</code>
       */
      public Builder setTypeBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        type_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object variable_ = "";
      /**
       * <pre>
       * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
       * to an output variable of the parent node. The field carries the name of
       * the output variable.
       * For example, a `TableScan` operator that reads rows from a table will
       * have child links to the `SCALAR` nodes representing the output variables
       * created for each column that is read by the operator. The corresponding
       * `variable` fields will be set to the variable names assigned to the
       * columns.
       * </pre>
       *
       * <code>string variable = 3;</code>
       */
      public java.lang.String getVariable() {
        java.lang.Object ref = variable_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          variable_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
       * to an output variable of the parent node. The field carries the name of
       * the output variable.
       * For example, a `TableScan` operator that reads rows from a table will
       * have child links to the `SCALAR` nodes representing the output variables
       * created for each column that is read by the operator. The corresponding
       * `variable` fields will be set to the variable names assigned to the
       * columns.
       * </pre>
       *
       * <code>string variable = 3;</code>
       */
      public com.google.protobuf.ByteString
          getVariableBytes() {
        java.lang.Object ref = variable_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          variable_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
       * to an output variable of the parent node. The field carries the name of
       * the output variable.
       * For example, a `TableScan` operator that reads rows from a table will
       * have child links to the `SCALAR` nodes representing the output variables
       * created for each column that is read by the operator. The corresponding
       * `variable` fields will be set to the variable names assigned to the
       * columns.
       * </pre>
       *
       * <code>string variable = 3;</code>
       */
      public Builder setVariable(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        variable_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
       * to an output variable of the parent node. The field carries the name of
       * the output variable.
       * For example, a `TableScan` operator that reads rows from a table will
       * have child links to the `SCALAR` nodes representing the output variables
       * created for each column that is read by the operator. The corresponding
       * `variable` fields will be set to the variable names assigned to the
       * columns.
       * </pre>
       *
       * <code>string variable = 3;</code>
       */
      public Builder clearVariable() {
        
        variable_ = getDefaultInstance().getVariable();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
       * to an output variable of the parent node. The field carries the name of
       * the output variable.
       * For example, a `TableScan` operator that reads rows from a table will
       * have child links to the `SCALAR` nodes representing the output variables
       * created for each column that is read by the operator. The corresponding
       * `variable` fields will be set to the variable names assigned to the
       * columns.
       * </pre>
       *
       * <code>string variable = 3;</code>
       */
      public Builder setVariableBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        variable_ = value;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFieldsProto3(unknownFields);
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:google.spanner.v1.PlanNode.ChildLink)
    }

    // @@protoc_insertion_point(class_scope:google.spanner.v1.PlanNode.ChildLink)
    private static final com.google.spanner.v1.PlanNode.ChildLink DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.google.spanner.v1.PlanNode.ChildLink();
    }

    public static com.google.spanner.v1.PlanNode.ChildLink getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ChildLink>
        PARSER = new com.google.protobuf.AbstractParser<ChildLink>() {
      public ChildLink parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new ChildLink(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ChildLink> parser() {
      return PARSER;
    }

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

    public com.google.spanner.v1.PlanNode.ChildLink getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ShortRepresentationOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.spanner.v1.PlanNode.ShortRepresentation)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * A string representation of the expression subtree rooted at this node.
     * </pre>
     *
     * <code>string description = 1;</code>
     */
    java.lang.String getDescription();
    /**
     * <pre>
     * A string representation of the expression subtree rooted at this node.
     * </pre>
     *
     * <code>string description = 1;</code>
     */
    com.google.protobuf.ByteString
        getDescriptionBytes();

    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */
    int getSubqueriesCount();
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */
    boolean containsSubqueries(
        java.lang.String key);
    /**
     * Use {@link #getSubqueriesMap()} instead.
     */
    @java.lang.Deprecated
    java.util.Map<java.lang.String, java.lang.Integer>
    getSubqueries();
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */
    java.util.Map<java.lang.String, java.lang.Integer>
    getSubqueriesMap();
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */

    int getSubqueriesOrDefault(
        java.lang.String key,
        int defaultValue);
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */

    int getSubqueriesOrThrow(
        java.lang.String key);
  }
  /**
   * <pre>
   * Condensed representation of a node and its subtree. Only present for
   * `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode].
   * </pre>
   *
   * Protobuf type {@code google.spanner.v1.PlanNode.ShortRepresentation}
   */
  public  static final class ShortRepresentation extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:google.spanner.v1.PlanNode.ShortRepresentation)
      ShortRepresentationOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use ShortRepresentation.newBuilder() to construct.
    private ShortRepresentation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ShortRepresentation() {
      description_ = "";
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private ShortRepresentation(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownFieldProto3(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();

              description_ = s;
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                subqueries_ = com.google.protobuf.MapField.newMapField(
                    SubqueriesDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000002;
              }
              com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer>
              subqueries__ = input.readMessage(
                  SubqueriesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
              subqueries_.getMutableMap().put(
                  subqueries__.getKey(), subqueries__.getValue());
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ShortRepresentation_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 2:
          return internalGetSubqueries();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ShortRepresentation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.spanner.v1.PlanNode.ShortRepresentation.class, com.google.spanner.v1.PlanNode.ShortRepresentation.Builder.class);
    }

    private int bitField0_;
    public static final int DESCRIPTION_FIELD_NUMBER = 1;
    private volatile java.lang.Object description_;
    /**
     * <pre>
     * A string representation of the expression subtree rooted at this node.
     * </pre>
     *
     * <code>string description = 1;</code>
     */
    public java.lang.String getDescription() {
      java.lang.Object ref = description_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        description_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * A string representation of the expression subtree rooted at this node.
     * </pre>
     *
     * <code>string description = 1;</code>
     */
    public com.google.protobuf.ByteString
        getDescriptionBytes() {
      java.lang.Object ref = description_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        description_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SUBQUERIES_FIELD_NUMBER = 2;
    private static final class SubqueriesDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<
          java.lang.String, java.lang.Integer> defaultEntry =
              com.google.protobuf.MapEntry
              .<java.lang.String, java.lang.Integer>newDefaultInstance(
                  com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ShortRepresentation_SubqueriesEntry_descriptor, 
                  com.google.protobuf.WireFormat.FieldType.STRING,
                  "",
                  com.google.protobuf.WireFormat.FieldType.INT32,
                  0);
    }
    private com.google.protobuf.MapField<
        java.lang.String, java.lang.Integer> subqueries_;
    private com.google.protobuf.MapField<java.lang.String, java.lang.Integer>
    internalGetSubqueries() {
      if (subqueries_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            SubqueriesDefaultEntryHolder.defaultEntry);
      }
      return subqueries_;
    }

    public int getSubqueriesCount() {
      return internalGetSubqueries().getMap().size();
    }
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */

    public boolean containsSubqueries(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetSubqueries().getMap().containsKey(key);
    }
    /**
     * Use {@link #getSubqueriesMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.Integer> getSubqueries() {
      return getSubqueriesMap();
    }
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */

    public java.util.Map<java.lang.String, java.lang.Integer> getSubqueriesMap() {
      return internalGetSubqueries().getMap();
    }
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */

    public int getSubqueriesOrDefault(
        java.lang.String key,
        int defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.Integer> map =
          internalGetSubqueries().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
     * where the `description` string of this node references a `SCALAR`
     * subquery contained in the expression subtree rooted at this node. The
     * referenced `SCALAR` subquery may not necessarily be a direct child of
     * this node.
     * </pre>
     *
     * <code>map&lt;string, int32&gt; subqueries = 2;</code>
     */

    public int getSubqueriesOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.Integer> map =
          internalGetSubqueries().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getDescriptionBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_);
      }
      com.google.protobuf.GeneratedMessageV3
        .serializeStringMapTo(
          output,
          internalGetSubqueries(),
          SubqueriesDefaultEntryHolder.defaultEntry,
          2);
      unknownFields.writeTo(output);
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getDescriptionBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_);
      }
      for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry
           : internalGetSubqueries().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.String, java.lang.Integer>
        subqueries__ = SubqueriesDefaultEntryHolder.defaultEntry.newBuilderForType()
            .setKey(entry.getKey())
            .setValue(entry.getValue())
            .build();
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(2, subqueries__);
      }
      size += unknownFields.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.spanner.v1.PlanNode.ShortRepresentation)) {
        return super.equals(obj);
      }
      com.google.spanner.v1.PlanNode.ShortRepresentation other = (com.google.spanner.v1.PlanNode.ShortRepresentation) obj;

      boolean result = true;
      result = result && getDescription()
          .equals(other.getDescription());
      result = result && internalGetSubqueries().equals(
          other.internalGetSubqueries());
      result = result && unknownFields.equals(other.unknownFields);
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
      hash = (53 * hash) + getDescription().hashCode();
      if (!internalGetSubqueries().getMap().isEmpty()) {
        hash = (37 * hash) + SUBQUERIES_FIELD_NUMBER;
        hash = (53 * hash) + internalGetSubqueries().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.spanner.v1.PlanNode.ShortRepresentation parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation 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.spanner.v1.PlanNode.ShortRepresentation parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation 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.spanner.v1.PlanNode.ShortRepresentation parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation 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.spanner.v1.PlanNode.ShortRepresentation parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static com.google.spanner.v1.PlanNode.ShortRepresentation parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.google.spanner.v1.PlanNode.ShortRepresentation prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    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>
     * Condensed representation of a node and its subtree. Only present for
     * `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode].
     * </pre>
     *
     * Protobuf type {@code google.spanner.v1.PlanNode.ShortRepresentation}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:google.spanner.v1.PlanNode.ShortRepresentation)
        com.google.spanner.v1.PlanNode.ShortRepresentationOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ShortRepresentation_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 2:
            return internalGetSubqueries();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(
          int number) {
        switch (number) {
          case 2:
            return internalGetMutableSubqueries();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ShortRepresentation_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.spanner.v1.PlanNode.ShortRepresentation.class, com.google.spanner.v1.PlanNode.ShortRepresentation.Builder.class);
      }

      // Construct using com.google.spanner.v1.PlanNode.ShortRepresentation.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        description_ = "";

        internalGetMutableSubqueries().clear();
        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_ShortRepresentation_descriptor;
      }

      public com.google.spanner.v1.PlanNode.ShortRepresentation getDefaultInstanceForType() {
        return com.google.spanner.v1.PlanNode.ShortRepresentation.getDefaultInstance();
      }

      public com.google.spanner.v1.PlanNode.ShortRepresentation build() {
        com.google.spanner.v1.PlanNode.ShortRepresentation result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public com.google.spanner.v1.PlanNode.ShortRepresentation buildPartial() {
        com.google.spanner.v1.PlanNode.ShortRepresentation result = new com.google.spanner.v1.PlanNode.ShortRepresentation(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        result.description_ = description_;
        result.subqueries_ = internalGetSubqueries();
        result.subqueries_.makeImmutable();
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, java.lang.Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          java.lang.Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.spanner.v1.PlanNode.ShortRepresentation) {
          return mergeFrom((com.google.spanner.v1.PlanNode.ShortRepresentation)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.spanner.v1.PlanNode.ShortRepresentation other) {
        if (other == com.google.spanner.v1.PlanNode.ShortRepresentation.getDefaultInstance()) return this;
        if (!other.getDescription().isEmpty()) {
          description_ = other.description_;
          onChanged();
        }
        internalGetMutableSubqueries().mergeFrom(
            other.internalGetSubqueries());
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.spanner.v1.PlanNode.ShortRepresentation parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.spanner.v1.PlanNode.ShortRepresentation) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private java.lang.Object description_ = "";
      /**
       * <pre>
       * A string representation of the expression subtree rooted at this node.
       * </pre>
       *
       * <code>string description = 1;</code>
       */
      public java.lang.String getDescription() {
        java.lang.Object ref = description_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          description_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * A string representation of the expression subtree rooted at this node.
       * </pre>
       *
       * <code>string description = 1;</code>
       */
      public com.google.protobuf.ByteString
          getDescriptionBytes() {
        java.lang.Object ref = description_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          description_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * A string representation of the expression subtree rooted at this node.
       * </pre>
       *
       * <code>string description = 1;</code>
       */
      public Builder setDescription(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        description_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * A string representation of the expression subtree rooted at this node.
       * </pre>
       *
       * <code>string description = 1;</code>
       */
      public Builder clearDescription() {
        
        description_ = getDefaultInstance().getDescription();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * A string representation of the expression subtree rooted at this node.
       * </pre>
       *
       * <code>string description = 1;</code>
       */
      public Builder setDescriptionBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        description_ = value;
        onChanged();
        return this;
      }

      private com.google.protobuf.MapField<
          java.lang.String, java.lang.Integer> subqueries_;
      private com.google.protobuf.MapField<java.lang.String, java.lang.Integer>
      internalGetSubqueries() {
        if (subqueries_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              SubqueriesDefaultEntryHolder.defaultEntry);
        }
        return subqueries_;
      }
      private com.google.protobuf.MapField<java.lang.String, java.lang.Integer>
      internalGetMutableSubqueries() {
        onChanged();;
        if (subqueries_ == null) {
          subqueries_ = com.google.protobuf.MapField.newMapField(
              SubqueriesDefaultEntryHolder.defaultEntry);
        }
        if (!subqueries_.isMutable()) {
          subqueries_ = subqueries_.copy();
        }
        return subqueries_;
      }

      public int getSubqueriesCount() {
        return internalGetSubqueries().getMap().size();
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */

      public boolean containsSubqueries(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        return internalGetSubqueries().getMap().containsKey(key);
      }
      /**
       * Use {@link #getSubqueriesMap()} instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, java.lang.Integer> getSubqueries() {
        return getSubqueriesMap();
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */

      public java.util.Map<java.lang.String, java.lang.Integer> getSubqueriesMap() {
        return internalGetSubqueries().getMap();
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */

      public int getSubqueriesOrDefault(
          java.lang.String key,
          int defaultValue) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, java.lang.Integer> map =
            internalGetSubqueries().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */

      public int getSubqueriesOrThrow(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, java.lang.Integer> map =
            internalGetSubqueries().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearSubqueries() {
        internalGetMutableSubqueries().getMutableMap()
            .clear();
        return this;
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */

      public Builder removeSubqueries(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        internalGetMutableSubqueries().getMutableMap()
            .remove(key);
        return this;
      }
      /**
       * Use alternate mutation accessors instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, java.lang.Integer>
      getMutableSubqueries() {
        return internalGetMutableSubqueries().getMutableMap();
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */
      public Builder putSubqueries(
          java.lang.String key,
          int value) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        
        internalGetMutableSubqueries().getMutableMap()
            .put(key, value);
        return this;
      }
      /**
       * <pre>
       * A mapping of (subquery variable name) -&gt; (subquery node id) for cases
       * where the `description` string of this node references a `SCALAR`
       * subquery contained in the expression subtree rooted at this node. The
       * referenced `SCALAR` subquery may not necessarily be a direct child of
       * this node.
       * </pre>
       *
       * <code>map&lt;string, int32&gt; subqueries = 2;</code>
       */

      public Builder putAllSubqueries(
          java.util.Map<java.lang.String, java.lang.Integer> values) {
        internalGetMutableSubqueries().getMutableMap()
            .putAll(values);
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFieldsProto3(unknownFields);
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:google.spanner.v1.PlanNode.ShortRepresentation)
    }

    // @@protoc_insertion_point(class_scope:google.spanner.v1.PlanNode.ShortRepresentation)
    private static final com.google.spanner.v1.PlanNode.ShortRepresentation DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.google.spanner.v1.PlanNode.ShortRepresentation();
    }

    public static com.google.spanner.v1.PlanNode.ShortRepresentation getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ShortRepresentation>
        PARSER = new com.google.protobuf.AbstractParser<ShortRepresentation>() {
      public ShortRepresentation parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new ShortRepresentation(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ShortRepresentation> parser() {
      return PARSER;
    }

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

    public com.google.spanner.v1.PlanNode.ShortRepresentation getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private int bitField0_;
  public static final int INDEX_FIELD_NUMBER = 1;
  private int index_;
  /**
   * <pre>
   * The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
   * </pre>
   *
   * <code>int32 index = 1;</code>
   */
  public int getIndex() {
    return index_;
  }

  public static final int KIND_FIELD_NUMBER = 2;
  private int kind_;
  /**
   * <pre>
   * Used to determine the type of node. May be needed for visualizing
   * different kinds of nodes differently. For example, If the node is a
   * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
   * which can be used to directly embed a description of the node in its
   * parent.
   * </pre>
   *
   * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
   */
  public int getKindValue() {
    return kind_;
  }
  /**
   * <pre>
   * Used to determine the type of node. May be needed for visualizing
   * different kinds of nodes differently. For example, If the node is a
   * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
   * which can be used to directly embed a description of the node in its
   * parent.
   * </pre>
   *
   * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
   */
  public com.google.spanner.v1.PlanNode.Kind getKind() {
    com.google.spanner.v1.PlanNode.Kind result = com.google.spanner.v1.PlanNode.Kind.valueOf(kind_);
    return result == null ? com.google.spanner.v1.PlanNode.Kind.UNRECOGNIZED : result;
  }

  public static final int DISPLAY_NAME_FIELD_NUMBER = 3;
  private volatile java.lang.Object displayName_;
  /**
   * <pre>
   * The display name for the node.
   * </pre>
   *
   * <code>string display_name = 3;</code>
   */
  public java.lang.String getDisplayName() {
    java.lang.Object ref = displayName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      displayName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The display name for the node.
   * </pre>
   *
   * <code>string display_name = 3;</code>
   */
  public com.google.protobuf.ByteString
      getDisplayNameBytes() {
    java.lang.Object ref = displayName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      displayName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CHILD_LINKS_FIELD_NUMBER = 4;
  private java.util.List<com.google.spanner.v1.PlanNode.ChildLink> childLinks_;
  /**
   * <pre>
   * List of child node `index`es and their relationship to this parent.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
   */
  public java.util.List<com.google.spanner.v1.PlanNode.ChildLink> getChildLinksList() {
    return childLinks_;
  }
  /**
   * <pre>
   * List of child node `index`es and their relationship to this parent.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
   */
  public java.util.List<? extends com.google.spanner.v1.PlanNode.ChildLinkOrBuilder> 
      getChildLinksOrBuilderList() {
    return childLinks_;
  }
  /**
   * <pre>
   * List of child node `index`es and their relationship to this parent.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
   */
  public int getChildLinksCount() {
    return childLinks_.size();
  }
  /**
   * <pre>
   * List of child node `index`es and their relationship to this parent.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
   */
  public com.google.spanner.v1.PlanNode.ChildLink getChildLinks(int index) {
    return childLinks_.get(index);
  }
  /**
   * <pre>
   * List of child node `index`es and their relationship to this parent.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
   */
  public com.google.spanner.v1.PlanNode.ChildLinkOrBuilder getChildLinksOrBuilder(
      int index) {
    return childLinks_.get(index);
  }

  public static final int SHORT_REPRESENTATION_FIELD_NUMBER = 5;
  private com.google.spanner.v1.PlanNode.ShortRepresentation shortRepresentation_;
  /**
   * <pre>
   * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
   * </pre>
   *
   * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
   */
  public boolean hasShortRepresentation() {
    return shortRepresentation_ != null;
  }
  /**
   * <pre>
   * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
   * </pre>
   *
   * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
   */
  public com.google.spanner.v1.PlanNode.ShortRepresentation getShortRepresentation() {
    return shortRepresentation_ == null ? com.google.spanner.v1.PlanNode.ShortRepresentation.getDefaultInstance() : shortRepresentation_;
  }
  /**
   * <pre>
   * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
   * </pre>
   *
   * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
   */
  public com.google.spanner.v1.PlanNode.ShortRepresentationOrBuilder getShortRepresentationOrBuilder() {
    return getShortRepresentation();
  }

  public static final int METADATA_FIELD_NUMBER = 6;
  private com.google.protobuf.Struct metadata_;
  /**
   * <pre>
   * Attributes relevant to the node contained in a group of key-value pairs.
   * For example, a Parameter Reference node could have the following
   * information in its metadata:
   *     {
   *       "parameter_reference": "param1",
   *       "parameter_type": "array"
   *     }
   * </pre>
   *
   * <code>.google.protobuf.Struct metadata = 6;</code>
   */
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   * <pre>
   * Attributes relevant to the node contained in a group of key-value pairs.
   * For example, a Parameter Reference node could have the following
   * information in its metadata:
   *     {
   *       "parameter_reference": "param1",
   *       "parameter_type": "array"
   *     }
   * </pre>
   *
   * <code>.google.protobuf.Struct metadata = 6;</code>
   */
  public com.google.protobuf.Struct getMetadata() {
    return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_;
  }
  /**
   * <pre>
   * Attributes relevant to the node contained in a group of key-value pairs.
   * For example, a Parameter Reference node could have the following
   * information in its metadata:
   *     {
   *       "parameter_reference": "param1",
   *       "parameter_type": "array"
   *     }
   * </pre>
   *
   * <code>.google.protobuf.Struct metadata = 6;</code>
   */
  public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() {
    return getMetadata();
  }

  public static final int EXECUTION_STATS_FIELD_NUMBER = 7;
  private com.google.protobuf.Struct executionStats_;
  /**
   * <pre>
   * The execution statistics associated with the node, contained in a group of
   * key-value pairs. Only present if the plan was returned as a result of a
   * profile query. For example, number of executions, number of rows/time per
   * execution etc.
   * </pre>
   *
   * <code>.google.protobuf.Struct execution_stats = 7;</code>
   */
  public boolean hasExecutionStats() {
    return executionStats_ != null;
  }
  /**
   * <pre>
   * The execution statistics associated with the node, contained in a group of
   * key-value pairs. Only present if the plan was returned as a result of a
   * profile query. For example, number of executions, number of rows/time per
   * execution etc.
   * </pre>
   *
   * <code>.google.protobuf.Struct execution_stats = 7;</code>
   */
  public com.google.protobuf.Struct getExecutionStats() {
    return executionStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : executionStats_;
  }
  /**
   * <pre>
   * The execution statistics associated with the node, contained in a group of
   * key-value pairs. Only present if the plan was returned as a result of a
   * profile query. For example, number of executions, number of rows/time per
   * execution etc.
   * </pre>
   *
   * <code>.google.protobuf.Struct execution_stats = 7;</code>
   */
  public com.google.protobuf.StructOrBuilder getExecutionStatsOrBuilder() {
    return getExecutionStats();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (index_ != 0) {
      output.writeInt32(1, index_);
    }
    if (kind_ != com.google.spanner.v1.PlanNode.Kind.KIND_UNSPECIFIED.getNumber()) {
      output.writeEnum(2, kind_);
    }
    if (!getDisplayNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_);
    }
    for (int i = 0; i < childLinks_.size(); i++) {
      output.writeMessage(4, childLinks_.get(i));
    }
    if (shortRepresentation_ != null) {
      output.writeMessage(5, getShortRepresentation());
    }
    if (metadata_ != null) {
      output.writeMessage(6, getMetadata());
    }
    if (executionStats_ != null) {
      output.writeMessage(7, getExecutionStats());
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (index_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, index_);
    }
    if (kind_ != com.google.spanner.v1.PlanNode.Kind.KIND_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(2, kind_);
    }
    if (!getDisplayNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_);
    }
    for (int i = 0; i < childLinks_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, childLinks_.get(i));
    }
    if (shortRepresentation_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getShortRepresentation());
    }
    if (metadata_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, getMetadata());
    }
    if (executionStats_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, getExecutionStats());
    }
    size += unknownFields.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.spanner.v1.PlanNode)) {
      return super.equals(obj);
    }
    com.google.spanner.v1.PlanNode other = (com.google.spanner.v1.PlanNode) obj;

    boolean result = true;
    result = result && (getIndex()
        == other.getIndex());
    result = result && kind_ == other.kind_;
    result = result && getDisplayName()
        .equals(other.getDisplayName());
    result = result && getChildLinksList()
        .equals(other.getChildLinksList());
    result = result && (hasShortRepresentation() == other.hasShortRepresentation());
    if (hasShortRepresentation()) {
      result = result && getShortRepresentation()
          .equals(other.getShortRepresentation());
    }
    result = result && (hasMetadata() == other.hasMetadata());
    if (hasMetadata()) {
      result = result && getMetadata()
          .equals(other.getMetadata());
    }
    result = result && (hasExecutionStats() == other.hasExecutionStats());
    if (hasExecutionStats()) {
      result = result && getExecutionStats()
          .equals(other.getExecutionStats());
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + INDEX_FIELD_NUMBER;
    hash = (53 * hash) + getIndex();
    hash = (37 * hash) + KIND_FIELD_NUMBER;
    hash = (53 * hash) + kind_;
    hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getDisplayName().hashCode();
    if (getChildLinksCount() > 0) {
      hash = (37 * hash) + CHILD_LINKS_FIELD_NUMBER;
      hash = (53 * hash) + getChildLinksList().hashCode();
    }
    if (hasShortRepresentation()) {
      hash = (37 * hash) + SHORT_REPRESENTATION_FIELD_NUMBER;
      hash = (53 * hash) + getShortRepresentation().hashCode();
    }
    if (hasMetadata()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getMetadata().hashCode();
    }
    if (hasExecutionStats()) {
      hash = (37 * hash) + EXECUTION_STATS_FIELD_NUMBER;
      hash = (53 * hash) + getExecutionStats().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.spanner.v1.PlanNode parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.spanner.v1.PlanNode parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.spanner.v1.PlanNode parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.spanner.v1.PlanNode 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.spanner.v1.PlanNode parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.spanner.v1.PlanNode parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.spanner.v1.PlanNode parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.spanner.v1.PlanNode 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.spanner.v1.PlanNode parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.spanner.v1.PlanNode 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.spanner.v1.PlanNode parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.spanner.v1.PlanNode parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.spanner.v1.PlanNode prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  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>
   * Node information for nodes appearing in a [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
   * </pre>
   *
   * Protobuf type {@code google.spanner.v1.PlanNode}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.spanner.v1.PlanNode)
      com.google.spanner.v1.PlanNodeOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.spanner.v1.PlanNode.class, com.google.spanner.v1.PlanNode.Builder.class);
    }

    // Construct using com.google.spanner.v1.PlanNode.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getChildLinksFieldBuilder();
      }
    }
    public Builder clear() {
      super.clear();
      index_ = 0;

      kind_ = 0;

      displayName_ = "";

      if (childLinksBuilder_ == null) {
        childLinks_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
      } else {
        childLinksBuilder_.clear();
      }
      if (shortRepresentationBuilder_ == null) {
        shortRepresentation_ = null;
      } else {
        shortRepresentation_ = null;
        shortRepresentationBuilder_ = null;
      }
      if (metadataBuilder_ == null) {
        metadata_ = null;
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }
      if (executionStatsBuilder_ == null) {
        executionStats_ = null;
      } else {
        executionStats_ = null;
        executionStatsBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.spanner.v1.QueryPlanProto.internal_static_google_spanner_v1_PlanNode_descriptor;
    }

    public com.google.spanner.v1.PlanNode getDefaultInstanceForType() {
      return com.google.spanner.v1.PlanNode.getDefaultInstance();
    }

    public com.google.spanner.v1.PlanNode build() {
      com.google.spanner.v1.PlanNode result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.spanner.v1.PlanNode buildPartial() {
      com.google.spanner.v1.PlanNode result = new com.google.spanner.v1.PlanNode(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.index_ = index_;
      result.kind_ = kind_;
      result.displayName_ = displayName_;
      if (childLinksBuilder_ == null) {
        if (((bitField0_ & 0x00000008) == 0x00000008)) {
          childLinks_ = java.util.Collections.unmodifiableList(childLinks_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.childLinks_ = childLinks_;
      } else {
        result.childLinks_ = childLinksBuilder_.build();
      }
      if (shortRepresentationBuilder_ == null) {
        result.shortRepresentation_ = shortRepresentation_;
      } else {
        result.shortRepresentation_ = shortRepresentationBuilder_.build();
      }
      if (metadataBuilder_ == null) {
        result.metadata_ = metadata_;
      } else {
        result.metadata_ = metadataBuilder_.build();
      }
      if (executionStatsBuilder_ == null) {
        result.executionStats_ = executionStats_;
      } else {
        result.executionStats_ = executionStatsBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.spanner.v1.PlanNode) {
        return mergeFrom((com.google.spanner.v1.PlanNode)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.spanner.v1.PlanNode other) {
      if (other == com.google.spanner.v1.PlanNode.getDefaultInstance()) return this;
      if (other.getIndex() != 0) {
        setIndex(other.getIndex());
      }
      if (other.kind_ != 0) {
        setKindValue(other.getKindValue());
      }
      if (!other.getDisplayName().isEmpty()) {
        displayName_ = other.displayName_;
        onChanged();
      }
      if (childLinksBuilder_ == null) {
        if (!other.childLinks_.isEmpty()) {
          if (childLinks_.isEmpty()) {
            childLinks_ = other.childLinks_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureChildLinksIsMutable();
            childLinks_.addAll(other.childLinks_);
          }
          onChanged();
        }
      } else {
        if (!other.childLinks_.isEmpty()) {
          if (childLinksBuilder_.isEmpty()) {
            childLinksBuilder_.dispose();
            childLinksBuilder_ = null;
            childLinks_ = other.childLinks_;
            bitField0_ = (bitField0_ & ~0x00000008);
            childLinksBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getChildLinksFieldBuilder() : null;
          } else {
            childLinksBuilder_.addAllMessages(other.childLinks_);
          }
        }
      }
      if (other.hasShortRepresentation()) {
        mergeShortRepresentation(other.getShortRepresentation());
      }
      if (other.hasMetadata()) {
        mergeMetadata(other.getMetadata());
      }
      if (other.hasExecutionStats()) {
        mergeExecutionStats(other.getExecutionStats());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.spanner.v1.PlanNode parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.spanner.v1.PlanNode) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private int index_ ;
    /**
     * <pre>
     * The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
     * </pre>
     *
     * <code>int32 index = 1;</code>
     */
    public int getIndex() {
      return index_;
    }
    /**
     * <pre>
     * The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
     * </pre>
     *
     * <code>int32 index = 1;</code>
     */
    public Builder setIndex(int value) {
      
      index_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
     * </pre>
     *
     * <code>int32 index = 1;</code>
     */
    public Builder clearIndex() {
      
      index_ = 0;
      onChanged();
      return this;
    }

    private int kind_ = 0;
    /**
     * <pre>
     * Used to determine the type of node. May be needed for visualizing
     * different kinds of nodes differently. For example, If the node is a
     * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
     * which can be used to directly embed a description of the node in its
     * parent.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
     */
    public int getKindValue() {
      return kind_;
    }
    /**
     * <pre>
     * Used to determine the type of node. May be needed for visualizing
     * different kinds of nodes differently. For example, If the node is a
     * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
     * which can be used to directly embed a description of the node in its
     * parent.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
     */
    public Builder setKindValue(int value) {
      kind_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Used to determine the type of node. May be needed for visualizing
     * different kinds of nodes differently. For example, If the node is a
     * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
     * which can be used to directly embed a description of the node in its
     * parent.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
     */
    public com.google.spanner.v1.PlanNode.Kind getKind() {
      com.google.spanner.v1.PlanNode.Kind result = com.google.spanner.v1.PlanNode.Kind.valueOf(kind_);
      return result == null ? com.google.spanner.v1.PlanNode.Kind.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Used to determine the type of node. May be needed for visualizing
     * different kinds of nodes differently. For example, If the node is a
     * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
     * which can be used to directly embed a description of the node in its
     * parent.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
     */
    public Builder setKind(com.google.spanner.v1.PlanNode.Kind value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      kind_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Used to determine the type of node. May be needed for visualizing
     * different kinds of nodes differently. For example, If the node is a
     * [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
     * which can be used to directly embed a description of the node in its
     * parent.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.Kind kind = 2;</code>
     */
    public Builder clearKind() {
      
      kind_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object displayName_ = "";
    /**
     * <pre>
     * The display name for the node.
     * </pre>
     *
     * <code>string display_name = 3;</code>
     */
    public java.lang.String getDisplayName() {
      java.lang.Object ref = displayName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        displayName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The display name for the node.
     * </pre>
     *
     * <code>string display_name = 3;</code>
     */
    public com.google.protobuf.ByteString
        getDisplayNameBytes() {
      java.lang.Object ref = displayName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        displayName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The display name for the node.
     * </pre>
     *
     * <code>string display_name = 3;</code>
     */
    public Builder setDisplayName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      displayName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The display name for the node.
     * </pre>
     *
     * <code>string display_name = 3;</code>
     */
    public Builder clearDisplayName() {
      
      displayName_ = getDefaultInstance().getDisplayName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The display name for the node.
     * </pre>
     *
     * <code>string display_name = 3;</code>
     */
    public Builder setDisplayNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      displayName_ = value;
      onChanged();
      return this;
    }

    private java.util.List<com.google.spanner.v1.PlanNode.ChildLink> childLinks_ =
      java.util.Collections.emptyList();
    private void ensureChildLinksIsMutable() {
      if (!((bitField0_ & 0x00000008) == 0x00000008)) {
        childLinks_ = new java.util.ArrayList<com.google.spanner.v1.PlanNode.ChildLink>(childLinks_);
        bitField0_ |= 0x00000008;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.spanner.v1.PlanNode.ChildLink, com.google.spanner.v1.PlanNode.ChildLink.Builder, com.google.spanner.v1.PlanNode.ChildLinkOrBuilder> childLinksBuilder_;

    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public java.util.List<com.google.spanner.v1.PlanNode.ChildLink> getChildLinksList() {
      if (childLinksBuilder_ == null) {
        return java.util.Collections.unmodifiableList(childLinks_);
      } else {
        return childLinksBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public int getChildLinksCount() {
      if (childLinksBuilder_ == null) {
        return childLinks_.size();
      } else {
        return childLinksBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public com.google.spanner.v1.PlanNode.ChildLink getChildLinks(int index) {
      if (childLinksBuilder_ == null) {
        return childLinks_.get(index);
      } else {
        return childLinksBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder setChildLinks(
        int index, com.google.spanner.v1.PlanNode.ChildLink value) {
      if (childLinksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureChildLinksIsMutable();
        childLinks_.set(index, value);
        onChanged();
      } else {
        childLinksBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder setChildLinks(
        int index, com.google.spanner.v1.PlanNode.ChildLink.Builder builderForValue) {
      if (childLinksBuilder_ == null) {
        ensureChildLinksIsMutable();
        childLinks_.set(index, builderForValue.build());
        onChanged();
      } else {
        childLinksBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder addChildLinks(com.google.spanner.v1.PlanNode.ChildLink value) {
      if (childLinksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureChildLinksIsMutable();
        childLinks_.add(value);
        onChanged();
      } else {
        childLinksBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder addChildLinks(
        int index, com.google.spanner.v1.PlanNode.ChildLink value) {
      if (childLinksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureChildLinksIsMutable();
        childLinks_.add(index, value);
        onChanged();
      } else {
        childLinksBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder addChildLinks(
        com.google.spanner.v1.PlanNode.ChildLink.Builder builderForValue) {
      if (childLinksBuilder_ == null) {
        ensureChildLinksIsMutable();
        childLinks_.add(builderForValue.build());
        onChanged();
      } else {
        childLinksBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder addChildLinks(
        int index, com.google.spanner.v1.PlanNode.ChildLink.Builder builderForValue) {
      if (childLinksBuilder_ == null) {
        ensureChildLinksIsMutable();
        childLinks_.add(index, builderForValue.build());
        onChanged();
      } else {
        childLinksBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder addAllChildLinks(
        java.lang.Iterable<? extends com.google.spanner.v1.PlanNode.ChildLink> values) {
      if (childLinksBuilder_ == null) {
        ensureChildLinksIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, childLinks_);
        onChanged();
      } else {
        childLinksBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder clearChildLinks() {
      if (childLinksBuilder_ == null) {
        childLinks_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
      } else {
        childLinksBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public Builder removeChildLinks(int index) {
      if (childLinksBuilder_ == null) {
        ensureChildLinksIsMutable();
        childLinks_.remove(index);
        onChanged();
      } else {
        childLinksBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public com.google.spanner.v1.PlanNode.ChildLink.Builder getChildLinksBuilder(
        int index) {
      return getChildLinksFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public com.google.spanner.v1.PlanNode.ChildLinkOrBuilder getChildLinksOrBuilder(
        int index) {
      if (childLinksBuilder_ == null) {
        return childLinks_.get(index);  } else {
        return childLinksBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public java.util.List<? extends com.google.spanner.v1.PlanNode.ChildLinkOrBuilder> 
         getChildLinksOrBuilderList() {
      if (childLinksBuilder_ != null) {
        return childLinksBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(childLinks_);
      }
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public com.google.spanner.v1.PlanNode.ChildLink.Builder addChildLinksBuilder() {
      return getChildLinksFieldBuilder().addBuilder(
          com.google.spanner.v1.PlanNode.ChildLink.getDefaultInstance());
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public com.google.spanner.v1.PlanNode.ChildLink.Builder addChildLinksBuilder(
        int index) {
      return getChildLinksFieldBuilder().addBuilder(
          index, com.google.spanner.v1.PlanNode.ChildLink.getDefaultInstance());
    }
    /**
     * <pre>
     * List of child node `index`es and their relationship to this parent.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.PlanNode.ChildLink child_links = 4;</code>
     */
    public java.util.List<com.google.spanner.v1.PlanNode.ChildLink.Builder> 
         getChildLinksBuilderList() {
      return getChildLinksFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.spanner.v1.PlanNode.ChildLink, com.google.spanner.v1.PlanNode.ChildLink.Builder, com.google.spanner.v1.PlanNode.ChildLinkOrBuilder> 
        getChildLinksFieldBuilder() {
      if (childLinksBuilder_ == null) {
        childLinksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.spanner.v1.PlanNode.ChildLink, com.google.spanner.v1.PlanNode.ChildLink.Builder, com.google.spanner.v1.PlanNode.ChildLinkOrBuilder>(
                childLinks_,
                ((bitField0_ & 0x00000008) == 0x00000008),
                getParentForChildren(),
                isClean());
        childLinks_ = null;
      }
      return childLinksBuilder_;
    }

    private com.google.spanner.v1.PlanNode.ShortRepresentation shortRepresentation_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.spanner.v1.PlanNode.ShortRepresentation, com.google.spanner.v1.PlanNode.ShortRepresentation.Builder, com.google.spanner.v1.PlanNode.ShortRepresentationOrBuilder> shortRepresentationBuilder_;
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public boolean hasShortRepresentation() {
      return shortRepresentationBuilder_ != null || shortRepresentation_ != null;
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public com.google.spanner.v1.PlanNode.ShortRepresentation getShortRepresentation() {
      if (shortRepresentationBuilder_ == null) {
        return shortRepresentation_ == null ? com.google.spanner.v1.PlanNode.ShortRepresentation.getDefaultInstance() : shortRepresentation_;
      } else {
        return shortRepresentationBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public Builder setShortRepresentation(com.google.spanner.v1.PlanNode.ShortRepresentation value) {
      if (shortRepresentationBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        shortRepresentation_ = value;
        onChanged();
      } else {
        shortRepresentationBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public Builder setShortRepresentation(
        com.google.spanner.v1.PlanNode.ShortRepresentation.Builder builderForValue) {
      if (shortRepresentationBuilder_ == null) {
        shortRepresentation_ = builderForValue.build();
        onChanged();
      } else {
        shortRepresentationBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public Builder mergeShortRepresentation(com.google.spanner.v1.PlanNode.ShortRepresentation value) {
      if (shortRepresentationBuilder_ == null) {
        if (shortRepresentation_ != null) {
          shortRepresentation_ =
            com.google.spanner.v1.PlanNode.ShortRepresentation.newBuilder(shortRepresentation_).mergeFrom(value).buildPartial();
        } else {
          shortRepresentation_ = value;
        }
        onChanged();
      } else {
        shortRepresentationBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public Builder clearShortRepresentation() {
      if (shortRepresentationBuilder_ == null) {
        shortRepresentation_ = null;
        onChanged();
      } else {
        shortRepresentation_ = null;
        shortRepresentationBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public com.google.spanner.v1.PlanNode.ShortRepresentation.Builder getShortRepresentationBuilder() {
      
      onChanged();
      return getShortRepresentationFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    public com.google.spanner.v1.PlanNode.ShortRepresentationOrBuilder getShortRepresentationOrBuilder() {
      if (shortRepresentationBuilder_ != null) {
        return shortRepresentationBuilder_.getMessageOrBuilder();
      } else {
        return shortRepresentation_ == null ?
            com.google.spanner.v1.PlanNode.ShortRepresentation.getDefaultInstance() : shortRepresentation_;
      }
    }
    /**
     * <pre>
     * Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
     * </pre>
     *
     * <code>.google.spanner.v1.PlanNode.ShortRepresentation short_representation = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.spanner.v1.PlanNode.ShortRepresentation, com.google.spanner.v1.PlanNode.ShortRepresentation.Builder, com.google.spanner.v1.PlanNode.ShortRepresentationOrBuilder> 
        getShortRepresentationFieldBuilder() {
      if (shortRepresentationBuilder_ == null) {
        shortRepresentationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.spanner.v1.PlanNode.ShortRepresentation, com.google.spanner.v1.PlanNode.ShortRepresentation.Builder, com.google.spanner.v1.PlanNode.ShortRepresentationOrBuilder>(
                getShortRepresentation(),
                getParentForChildren(),
                isClean());
        shortRepresentation_ = null;
      }
      return shortRepresentationBuilder_;
    }

    private com.google.protobuf.Struct metadata_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_;
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public boolean hasMetadata() {
      return metadataBuilder_ != null || metadata_ != null;
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public com.google.protobuf.Struct getMetadata() {
      if (metadataBuilder_ == null) {
        return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_;
      } else {
        return metadataBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public Builder setMetadata(com.google.protobuf.Struct value) {
      if (metadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        metadata_ = value;
        onChanged();
      } else {
        metadataBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public Builder setMetadata(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (metadataBuilder_ == null) {
        metadata_ = builderForValue.build();
        onChanged();
      } else {
        metadataBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public Builder mergeMetadata(com.google.protobuf.Struct value) {
      if (metadataBuilder_ == null) {
        if (metadata_ != null) {
          metadata_ =
            com.google.protobuf.Struct.newBuilder(metadata_).mergeFrom(value).buildPartial();
        } else {
          metadata_ = value;
        }
        onChanged();
      } else {
        metadataBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public Builder clearMetadata() {
      if (metadataBuilder_ == null) {
        metadata_ = null;
        onChanged();
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public com.google.protobuf.Struct.Builder getMetadataBuilder() {
      
      onChanged();
      return getMetadataFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() {
      if (metadataBuilder_ != null) {
        return metadataBuilder_.getMessageOrBuilder();
      } else {
        return metadata_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : metadata_;
      }
    }
    /**
     * <pre>
     * Attributes relevant to the node contained in a group of key-value pairs.
     * For example, a Parameter Reference node could have the following
     * information in its metadata:
     *     {
     *       "parameter_reference": "param1",
     *       "parameter_type": "array"
     *     }
     * </pre>
     *
     * <code>.google.protobuf.Struct metadata = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> 
        getMetadataFieldBuilder() {
      if (metadataBuilder_ == null) {
        metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getMetadata(),
                getParentForChildren(),
                isClean());
        metadata_ = null;
      }
      return metadataBuilder_;
    }

    private com.google.protobuf.Struct executionStats_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> executionStatsBuilder_;
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public boolean hasExecutionStats() {
      return executionStatsBuilder_ != null || executionStats_ != null;
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public com.google.protobuf.Struct getExecutionStats() {
      if (executionStatsBuilder_ == null) {
        return executionStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : executionStats_;
      } else {
        return executionStatsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public Builder setExecutionStats(com.google.protobuf.Struct value) {
      if (executionStatsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        executionStats_ = value;
        onChanged();
      } else {
        executionStatsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public Builder setExecutionStats(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (executionStatsBuilder_ == null) {
        executionStats_ = builderForValue.build();
        onChanged();
      } else {
        executionStatsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public Builder mergeExecutionStats(com.google.protobuf.Struct value) {
      if (executionStatsBuilder_ == null) {
        if (executionStats_ != null) {
          executionStats_ =
            com.google.protobuf.Struct.newBuilder(executionStats_).mergeFrom(value).buildPartial();
        } else {
          executionStats_ = value;
        }
        onChanged();
      } else {
        executionStatsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public Builder clearExecutionStats() {
      if (executionStatsBuilder_ == null) {
        executionStats_ = null;
        onChanged();
      } else {
        executionStats_ = null;
        executionStatsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public com.google.protobuf.Struct.Builder getExecutionStatsBuilder() {
      
      onChanged();
      return getExecutionStatsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    public com.google.protobuf.StructOrBuilder getExecutionStatsOrBuilder() {
      if (executionStatsBuilder_ != null) {
        return executionStatsBuilder_.getMessageOrBuilder();
      } else {
        return executionStats_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : executionStats_;
      }
    }
    /**
     * <pre>
     * The execution statistics associated with the node, contained in a group of
     * key-value pairs. Only present if the plan was returned as a result of a
     * profile query. For example, number of executions, number of rows/time per
     * execution etc.
     * </pre>
     *
     * <code>.google.protobuf.Struct execution_stats = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> 
        getExecutionStatsFieldBuilder() {
      if (executionStatsBuilder_ == null) {
        executionStatsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getExecutionStats(),
                getParentForChildren(),
                isClean());
        executionStats_ = null;
      }
      return executionStatsBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:google.spanner.v1.PlanNode)
  }

  // @@protoc_insertion_point(class_scope:google.spanner.v1.PlanNode)
  private static final com.google.spanner.v1.PlanNode DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.spanner.v1.PlanNode();
  }

  public static com.google.spanner.v1.PlanNode getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<PlanNode>
      PARSER = new com.google.protobuf.AbstractParser<PlanNode>() {
    public PlanNode parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new PlanNode(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<PlanNode> parser() {
    return PARSER;
  }

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

  public com.google.spanner.v1.PlanNode getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

