<gh_stars>100-1000
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/kernels/boosted_trees/boosted_trees.proto

package org.tensorflow.framework;

/**
 * Protobuf type {@code tensorflow.boosted_trees.TreeMetadata}
 */
public  final class TreeMetadata extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.boosted_trees.TreeMetadata)
    TreeMetadataOrBuilder {
  // Use TreeMetadata.newBuilder() to construct.
  private TreeMetadata(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private TreeMetadata() {
    numLayersGrown_ = 0;
    isFinalized_ = false;
    postPrunedNodesMeta_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private TreeMetadata(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    int mutable_bitField0_ = 0;
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!input.skipField(tag)) {
              done = true;
            }
            break;
          }
          case 16: {

            numLayersGrown_ = input.readInt32();
            break;
          }
          case 24: {

            isFinalized_ = input.readBool();
            break;
          }
          case 34: {
            if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
              postPrunedNodesMeta_ = new java.util.ArrayList<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate>();
              mutable_bitField0_ |= 0x00000004;
            }
            postPrunedNodesMeta_.add(
                input.readMessage(org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.parser(), extensionRegistry));
            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_ & 0x00000004) == 0x00000004)) {
        postPrunedNodesMeta_ = java.util.Collections.unmodifiableList(postPrunedNodesMeta_);
      }
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.framework.TreeMetadata.class, org.tensorflow.framework.TreeMetadata.Builder.class);
  }

  public interface PostPruneNodeUpdateOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <code>int32 new_node_id = 1;</code>
     */
    int getNewNodeId();

    /**
     * <code>float logit_change = 2;</code>
     */
    float getLogitChange();
  }
  /**
   * Protobuf type {@code tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate}
   */
  public  static final class PostPruneNodeUpdate extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate)
      PostPruneNodeUpdateOrBuilder {
    // Use PostPruneNodeUpdate.newBuilder() to construct.
    private PostPruneNodeUpdate(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private PostPruneNodeUpdate() {
      newNodeId_ = 0;
      logitChange_ = 0F;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private PostPruneNodeUpdate(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 8: {

              newNodeId_ = input.readInt32();
              break;
            }
            case 21: {

              logitChange_ = input.readFloat();
              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 {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_PostPruneNodeUpdate_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_PostPruneNodeUpdate_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.class, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder.class);
    }

    public static final int NEW_NODE_ID_FIELD_NUMBER = 1;
    private int newNodeId_;
    /**
     * <code>int32 new_node_id = 1;</code>
     */
    public int getNewNodeId() {
      return newNodeId_;
    }

    public static final int LOGIT_CHANGE_FIELD_NUMBER = 2;
    private float logitChange_;
    /**
     * <code>float logit_change = 2;</code>
     */
    public float getLogitChange() {
      return logitChange_;
    }

    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 (newNodeId_ != 0) {
        output.writeInt32(1, newNodeId_);
      }
      if (logitChange_ != 0F) {
        output.writeFloat(2, logitChange_);
      }
    }

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

      size = 0;
      if (newNodeId_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, newNodeId_);
      }
      if (logitChange_ != 0F) {
        size += com.google.protobuf.CodedOutputStream
          .computeFloatSize(2, logitChange_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate)) {
        return super.equals(obj);
      }
      org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate other = (org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate) obj;

      boolean result = true;
      result = result && (getNewNodeId()
          == other.getNewNodeId());
      result = result && (
          java.lang.Float.floatToIntBits(getLogitChange())
          == java.lang.Float.floatToIntBits(
              other.getLogitChange()));
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + NEW_NODE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getNewNodeId();
      hash = (37 * hash) + LOGIT_CHANGE_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(
          getLogitChange());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate 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 org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate 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 org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate 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(org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate 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;
    }
    /**
     * Protobuf type {@code tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate)
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_PostPruneNodeUpdate_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_PostPruneNodeUpdate_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.class, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder.class);
      }

      // Construct using org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.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();
        newNodeId_ = 0;

        logitChange_ = 0F;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_PostPruneNodeUpdate_descriptor;
      }

      public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate getDefaultInstanceForType() {
        return org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.getDefaultInstance();
      }

      public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate build() {
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate buildPartial() {
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate result = new org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate(this);
        result.newNodeId_ = newNodeId_;
        result.logitChange_ = logitChange_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          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, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate) {
          return mergeFrom((org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate other) {
        if (other == org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.getDefaultInstance()) return this;
        if (other.getNewNodeId() != 0) {
          setNewNodeId(other.getNewNodeId());
        }
        if (other.getLogitChange() != 0F) {
          setLogitChange(other.getLogitChange());
        }
        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 {
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int newNodeId_ ;
      /**
       * <code>int32 new_node_id = 1;</code>
       */
      public int getNewNodeId() {
        return newNodeId_;
      }
      /**
       * <code>int32 new_node_id = 1;</code>
       */
      public Builder setNewNodeId(int value) {
        
        newNodeId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>int32 new_node_id = 1;</code>
       */
      public Builder clearNewNodeId() {
        
        newNodeId_ = 0;
        onChanged();
        return this;
      }

      private float logitChange_ ;
      /**
       * <code>float logit_change = 2;</code>
       */
      public float getLogitChange() {
        return logitChange_;
      }
      /**
       * <code>float logit_change = 2;</code>
       */
      public Builder setLogitChange(float value) {
        
        logitChange_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>float logit_change = 2;</code>
       */
      public Builder clearLogitChange() {
        
        logitChange_ = 0F;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

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


      // @@protoc_insertion_point(builder_scope:tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate)
    private static final org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate();
    }

    public static org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private int bitField0_;
  public static final int NUM_LAYERS_GROWN_FIELD_NUMBER = 2;
  private int numLayersGrown_;
  /**
   * <pre>
   * Number of layers grown for this tree.
   * </pre>
   *
   * <code>int32 num_layers_grown = 2;</code>
   */
  public int getNumLayersGrown() {
    return numLayersGrown_;
  }

  public static final int IS_FINALIZED_FIELD_NUMBER = 3;
  private boolean isFinalized_;
  /**
   * <pre>
   * Whether the tree is finalized in that no more layers can be grown.
   * </pre>
   *
   * <code>bool is_finalized = 3;</code>
   */
  public boolean getIsFinalized() {
    return isFinalized_;
  }

  public static final int POST_PRUNED_NODES_META_FIELD_NUMBER = 4;
  private java.util.List<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate> postPrunedNodesMeta_;
  /**
   * <pre>
   * If tree was finalized and post pruning happened, it is possible that cache
   * still refers to some nodes that were deleted or that the node ids changed
   * (e.g. node id 5 became node id 2 due to pruning of the other branch).
   * The mapping below allows us to understand where the old ids now map to and
   * how the values should be adjusted due to post-pruning.
   * The size of the list should be equal to the number of nodes in the tree
   * before post-pruning happened.
   * If the node was pruned, it will have new_node_id equal to the id of a node
   * that this node was collapsed into. For a node that didn't get pruned, it is
   * possible that its id still changed, so new_node_id will have the
   * corresponding id in the pruned tree.
   * If post-pruning didn't happen, or it did and it had no effect (e.g. no
   * nodes got pruned), this list will be empty.
   * </pre>
   *
   * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
   */
  public java.util.List<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate> getPostPrunedNodesMetaList() {
    return postPrunedNodesMeta_;
  }
  /**
   * <pre>
   * If tree was finalized and post pruning happened, it is possible that cache
   * still refers to some nodes that were deleted or that the node ids changed
   * (e.g. node id 5 became node id 2 due to pruning of the other branch).
   * The mapping below allows us to understand where the old ids now map to and
   * how the values should be adjusted due to post-pruning.
   * The size of the list should be equal to the number of nodes in the tree
   * before post-pruning happened.
   * If the node was pruned, it will have new_node_id equal to the id of a node
   * that this node was collapsed into. For a node that didn't get pruned, it is
   * possible that its id still changed, so new_node_id will have the
   * corresponding id in the pruned tree.
   * If post-pruning didn't happen, or it did and it had no effect (e.g. no
   * nodes got pruned), this list will be empty.
   * </pre>
   *
   * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
   */
  public java.util.List<? extends org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder> 
      getPostPrunedNodesMetaOrBuilderList() {
    return postPrunedNodesMeta_;
  }
  /**
   * <pre>
   * If tree was finalized and post pruning happened, it is possible that cache
   * still refers to some nodes that were deleted or that the node ids changed
   * (e.g. node id 5 became node id 2 due to pruning of the other branch).
   * The mapping below allows us to understand where the old ids now map to and
   * how the values should be adjusted due to post-pruning.
   * The size of the list should be equal to the number of nodes in the tree
   * before post-pruning happened.
   * If the node was pruned, it will have new_node_id equal to the id of a node
   * that this node was collapsed into. For a node that didn't get pruned, it is
   * possible that its id still changed, so new_node_id will have the
   * corresponding id in the pruned tree.
   * If post-pruning didn't happen, or it did and it had no effect (e.g. no
   * nodes got pruned), this list will be empty.
   * </pre>
   *
   * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
   */
  public int getPostPrunedNodesMetaCount() {
    return postPrunedNodesMeta_.size();
  }
  /**
   * <pre>
   * If tree was finalized and post pruning happened, it is possible that cache
   * still refers to some nodes that were deleted or that the node ids changed
   * (e.g. node id 5 became node id 2 due to pruning of the other branch).
   * The mapping below allows us to understand where the old ids now map to and
   * how the values should be adjusted due to post-pruning.
   * The size of the list should be equal to the number of nodes in the tree
   * before post-pruning happened.
   * If the node was pruned, it will have new_node_id equal to the id of a node
   * that this node was collapsed into. For a node that didn't get pruned, it is
   * possible that its id still changed, so new_node_id will have the
   * corresponding id in the pruned tree.
   * If post-pruning didn't happen, or it did and it had no effect (e.g. no
   * nodes got pruned), this list will be empty.
   * </pre>
   *
   * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
   */
  public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate getPostPrunedNodesMeta(int index) {
    return postPrunedNodesMeta_.get(index);
  }
  /**
   * <pre>
   * If tree was finalized and post pruning happened, it is possible that cache
   * still refers to some nodes that were deleted or that the node ids changed
   * (e.g. node id 5 became node id 2 due to pruning of the other branch).
   * The mapping below allows us to understand where the old ids now map to and
   * how the values should be adjusted due to post-pruning.
   * The size of the list should be equal to the number of nodes in the tree
   * before post-pruning happened.
   * If the node was pruned, it will have new_node_id equal to the id of a node
   * that this node was collapsed into. For a node that didn't get pruned, it is
   * possible that its id still changed, so new_node_id will have the
   * corresponding id in the pruned tree.
   * If post-pruning didn't happen, or it did and it had no effect (e.g. no
   * nodes got pruned), this list will be empty.
   * </pre>
   *
   * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
   */
  public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder getPostPrunedNodesMetaOrBuilder(
      int index) {
    return postPrunedNodesMeta_.get(index);
  }

  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 (numLayersGrown_ != 0) {
      output.writeInt32(2, numLayersGrown_);
    }
    if (isFinalized_ != false) {
      output.writeBool(3, isFinalized_);
    }
    for (int i = 0; i < postPrunedNodesMeta_.size(); i++) {
      output.writeMessage(4, postPrunedNodesMeta_.get(i));
    }
  }

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

    size = 0;
    if (numLayersGrown_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, numLayersGrown_);
    }
    if (isFinalized_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(3, isFinalized_);
    }
    for (int i = 0; i < postPrunedNodesMeta_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, postPrunedNodesMeta_.get(i));
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tensorflow.framework.TreeMetadata)) {
      return super.equals(obj);
    }
    org.tensorflow.framework.TreeMetadata other = (org.tensorflow.framework.TreeMetadata) obj;

    boolean result = true;
    result = result && (getNumLayersGrown()
        == other.getNumLayersGrown());
    result = result && (getIsFinalized()
        == other.getIsFinalized());
    result = result && getPostPrunedNodesMetaList()
        .equals(other.getPostPrunedNodesMetaList());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NUM_LAYERS_GROWN_FIELD_NUMBER;
    hash = (53 * hash) + getNumLayersGrown();
    hash = (37 * hash) + IS_FINALIZED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getIsFinalized());
    if (getPostPrunedNodesMetaCount() > 0) {
      hash = (37 * hash) + POST_PRUNED_NODES_META_FIELD_NUMBER;
      hash = (53 * hash) + getPostPrunedNodesMetaList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.framework.TreeMetadata parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.framework.TreeMetadata parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.framework.TreeMetadata parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.framework.TreeMetadata parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.framework.TreeMetadata parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.framework.TreeMetadata 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 org.tensorflow.framework.TreeMetadata parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.framework.TreeMetadata 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 org.tensorflow.framework.TreeMetadata parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.framework.TreeMetadata 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(org.tensorflow.framework.TreeMetadata 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;
  }
  /**
   * Protobuf type {@code tensorflow.boosted_trees.TreeMetadata}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.boosted_trees.TreeMetadata)
      org.tensorflow.framework.TreeMetadataOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.framework.TreeMetadata.class, org.tensorflow.framework.TreeMetadata.Builder.class);
    }

    // Construct using org.tensorflow.framework.TreeMetadata.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

      isFinalized_ = false;

      if (postPrunedNodesMetaBuilder_ == null) {
        postPrunedNodesMeta_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
      } else {
        postPrunedNodesMetaBuilder_.clear();
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.framework.BoostedTreesProtos.internal_static_tensorflow_boosted_trees_TreeMetadata_descriptor;
    }

    public org.tensorflow.framework.TreeMetadata getDefaultInstanceForType() {
      return org.tensorflow.framework.TreeMetadata.getDefaultInstance();
    }

    public org.tensorflow.framework.TreeMetadata build() {
      org.tensorflow.framework.TreeMetadata result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public org.tensorflow.framework.TreeMetadata buildPartial() {
      org.tensorflow.framework.TreeMetadata result = new org.tensorflow.framework.TreeMetadata(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.numLayersGrown_ = numLayersGrown_;
      result.isFinalized_ = isFinalized_;
      if (postPrunedNodesMetaBuilder_ == null) {
        if (((bitField0_ & 0x00000004) == 0x00000004)) {
          postPrunedNodesMeta_ = java.util.Collections.unmodifiableList(postPrunedNodesMeta_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.postPrunedNodesMeta_ = postPrunedNodesMeta_;
      } else {
        result.postPrunedNodesMeta_ = postPrunedNodesMetaBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        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, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.framework.TreeMetadata) {
        return mergeFrom((org.tensorflow.framework.TreeMetadata)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.framework.TreeMetadata other) {
      if (other == org.tensorflow.framework.TreeMetadata.getDefaultInstance()) return this;
      if (other.getNumLayersGrown() != 0) {
        setNumLayersGrown(other.getNumLayersGrown());
      }
      if (other.getIsFinalized() != false) {
        setIsFinalized(other.getIsFinalized());
      }
      if (postPrunedNodesMetaBuilder_ == null) {
        if (!other.postPrunedNodesMeta_.isEmpty()) {
          if (postPrunedNodesMeta_.isEmpty()) {
            postPrunedNodesMeta_ = other.postPrunedNodesMeta_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensurePostPrunedNodesMetaIsMutable();
            postPrunedNodesMeta_.addAll(other.postPrunedNodesMeta_);
          }
          onChanged();
        }
      } else {
        if (!other.postPrunedNodesMeta_.isEmpty()) {
          if (postPrunedNodesMetaBuilder_.isEmpty()) {
            postPrunedNodesMetaBuilder_.dispose();
            postPrunedNodesMetaBuilder_ = null;
            postPrunedNodesMeta_ = other.postPrunedNodesMeta_;
            bitField0_ = (bitField0_ & ~0x00000004);
            postPrunedNodesMetaBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getPostPrunedNodesMetaFieldBuilder() : null;
          } else {
            postPrunedNodesMetaBuilder_.addAllMessages(other.postPrunedNodesMeta_);
          }
        }
      }
      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 {
      org.tensorflow.framework.TreeMetadata parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.framework.TreeMetadata) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private int numLayersGrown_ ;
    /**
     * <pre>
     * Number of layers grown for this tree.
     * </pre>
     *
     * <code>int32 num_layers_grown = 2;</code>
     */
    public int getNumLayersGrown() {
      return numLayersGrown_;
    }
    /**
     * <pre>
     * Number of layers grown for this tree.
     * </pre>
     *
     * <code>int32 num_layers_grown = 2;</code>
     */
    public Builder setNumLayersGrown(int value) {
      
      numLayersGrown_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Number of layers grown for this tree.
     * </pre>
     *
     * <code>int32 num_layers_grown = 2;</code>
     */
    public Builder clearNumLayersGrown() {
      
      numLayersGrown_ = 0;
      onChanged();
      return this;
    }

    private boolean isFinalized_ ;
    /**
     * <pre>
     * Whether the tree is finalized in that no more layers can be grown.
     * </pre>
     *
     * <code>bool is_finalized = 3;</code>
     */
    public boolean getIsFinalized() {
      return isFinalized_;
    }
    /**
     * <pre>
     * Whether the tree is finalized in that no more layers can be grown.
     * </pre>
     *
     * <code>bool is_finalized = 3;</code>
     */
    public Builder setIsFinalized(boolean value) {
      
      isFinalized_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Whether the tree is finalized in that no more layers can be grown.
     * </pre>
     *
     * <code>bool is_finalized = 3;</code>
     */
    public Builder clearIsFinalized() {
      
      isFinalized_ = false;
      onChanged();
      return this;
    }

    private java.util.List<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate> postPrunedNodesMeta_ =
      java.util.Collections.emptyList();
    private void ensurePostPrunedNodesMetaIsMutable() {
      if (!((bitField0_ & 0x00000004) == 0x00000004)) {
        postPrunedNodesMeta_ = new java.util.ArrayList<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate>(postPrunedNodesMeta_);
        bitField0_ |= 0x00000004;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder> postPrunedNodesMetaBuilder_;

    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public java.util.List<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate> getPostPrunedNodesMetaList() {
      if (postPrunedNodesMetaBuilder_ == null) {
        return java.util.Collections.unmodifiableList(postPrunedNodesMeta_);
      } else {
        return postPrunedNodesMetaBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public int getPostPrunedNodesMetaCount() {
      if (postPrunedNodesMetaBuilder_ == null) {
        return postPrunedNodesMeta_.size();
      } else {
        return postPrunedNodesMetaBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate getPostPrunedNodesMeta(int index) {
      if (postPrunedNodesMetaBuilder_ == null) {
        return postPrunedNodesMeta_.get(index);
      } else {
        return postPrunedNodesMetaBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder setPostPrunedNodesMeta(
        int index, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate value) {
      if (postPrunedNodesMetaBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.set(index, value);
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder setPostPrunedNodesMeta(
        int index, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder builderForValue) {
      if (postPrunedNodesMetaBuilder_ == null) {
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.set(index, builderForValue.build());
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder addPostPrunedNodesMeta(org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate value) {
      if (postPrunedNodesMetaBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.add(value);
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder addPostPrunedNodesMeta(
        int index, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate value) {
      if (postPrunedNodesMetaBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.add(index, value);
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder addPostPrunedNodesMeta(
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder builderForValue) {
      if (postPrunedNodesMetaBuilder_ == null) {
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.add(builderForValue.build());
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder addPostPrunedNodesMeta(
        int index, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder builderForValue) {
      if (postPrunedNodesMetaBuilder_ == null) {
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.add(index, builderForValue.build());
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder addAllPostPrunedNodesMeta(
        java.lang.Iterable<? extends org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate> values) {
      if (postPrunedNodesMetaBuilder_ == null) {
        ensurePostPrunedNodesMetaIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, postPrunedNodesMeta_);
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder clearPostPrunedNodesMeta() {
      if (postPrunedNodesMetaBuilder_ == null) {
        postPrunedNodesMeta_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public Builder removePostPrunedNodesMeta(int index) {
      if (postPrunedNodesMetaBuilder_ == null) {
        ensurePostPrunedNodesMetaIsMutable();
        postPrunedNodesMeta_.remove(index);
        onChanged();
      } else {
        postPrunedNodesMetaBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder getPostPrunedNodesMetaBuilder(
        int index) {
      return getPostPrunedNodesMetaFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder getPostPrunedNodesMetaOrBuilder(
        int index) {
      if (postPrunedNodesMetaBuilder_ == null) {
        return postPrunedNodesMeta_.get(index);  } else {
        return postPrunedNodesMetaBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public java.util.List<? extends org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder> 
         getPostPrunedNodesMetaOrBuilderList() {
      if (postPrunedNodesMetaBuilder_ != null) {
        return postPrunedNodesMetaBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(postPrunedNodesMeta_);
      }
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder addPostPrunedNodesMetaBuilder() {
      return getPostPrunedNodesMetaFieldBuilder().addBuilder(
          org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.getDefaultInstance());
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder addPostPrunedNodesMetaBuilder(
        int index) {
      return getPostPrunedNodesMetaFieldBuilder().addBuilder(
          index, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.getDefaultInstance());
    }
    /**
     * <pre>
     * If tree was finalized and post pruning happened, it is possible that cache
     * still refers to some nodes that were deleted or that the node ids changed
     * (e.g. node id 5 became node id 2 due to pruning of the other branch).
     * The mapping below allows us to understand where the old ids now map to and
     * how the values should be adjusted due to post-pruning.
     * The size of the list should be equal to the number of nodes in the tree
     * before post-pruning happened.
     * If the node was pruned, it will have new_node_id equal to the id of a node
     * that this node was collapsed into. For a node that didn't get pruned, it is
     * possible that its id still changed, so new_node_id will have the
     * corresponding id in the pruned tree.
     * If post-pruning didn't happen, or it did and it had no effect (e.g. no
     * nodes got pruned), this list will be empty.
     * </pre>
     *
     * <code>repeated .tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4;</code>
     */
    public java.util.List<org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder> 
         getPostPrunedNodesMetaBuilderList() {
      return getPostPrunedNodesMetaFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder> 
        getPostPrunedNodesMetaFieldBuilder() {
      if (postPrunedNodesMetaBuilder_ == null) {
        postPrunedNodesMetaBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdate.Builder, org.tensorflow.framework.TreeMetadata.PostPruneNodeUpdateOrBuilder>(
                postPrunedNodesMeta_,
                ((bitField0_ & 0x00000004) == 0x00000004),
                getParentForChildren(),
                isClean());
        postPrunedNodesMeta_ = null;
      }
      return postPrunedNodesMetaBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

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


    // @@protoc_insertion_point(builder_scope:tensorflow.boosted_trees.TreeMetadata)
  }

  // @@protoc_insertion_point(class_scope:tensorflow.boosted_trees.TreeMetadata)
  private static final org.tensorflow.framework.TreeMetadata DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.framework.TreeMetadata();
  }

  public static org.tensorflow.framework.TreeMetadata getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public org.tensorflow.framework.TreeMetadata getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

