// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/protobuf/saved_object_graph.proto

package org.tensorflow.proto.framework;

/**
 * Protobuf type {@code tensorflow.SavedObjectGraph}
 */
public  final class SavedObjectGraph extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.SavedObjectGraph)
    SavedObjectGraphOrBuilder {
private static final long serialVersionUID = 0L;
  // Use SavedObjectGraph.newBuilder() to construct.
  private SavedObjectGraph(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private SavedObjectGraph() {
    nodes_ = java.util.Collections.emptyList();
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private SavedObjectGraph(
      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;
          case 10: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              nodes_ = new java.util.ArrayList<org.tensorflow.proto.framework.SavedObject>();
              mutable_bitField0_ |= 0x00000001;
            }
            nodes_.add(
                input.readMessage(org.tensorflow.proto.framework.SavedObject.parser(), extensionRegistry));
            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              concreteFunctions_ = com.google.protobuf.MapField.newMapField(
                  ConcreteFunctionsDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000002;
            }
            com.google.protobuf.MapEntry<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>
            concreteFunctions__ = input.readMessage(
                ConcreteFunctionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            concreteFunctions_.getMutableMap().put(
                concreteFunctions__.getKey(), concreteFunctions__.getValue());
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            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_ & 0x00000001) != 0)) {
        nodes_ = java.util.Collections.unmodifiableList(nodes_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 2:
        return internalGetConcreteFunctions();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.framework.SavedObjectGraph.class, org.tensorflow.proto.framework.SavedObjectGraph.Builder.class);
  }

  public static final int NODES_FIELD_NUMBER = 1;
  private java.util.List<org.tensorflow.proto.framework.SavedObject> nodes_;
  /**
   * <pre>
   * Flattened list of objects in the object graph.
   * The position of the object in this list indicates its id.
   * Nodes[0] is considered the root node.
   * </pre>
   *
   * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
   */
  public java.util.List<org.tensorflow.proto.framework.SavedObject> getNodesList() {
    return nodes_;
  }
  /**
   * <pre>
   * Flattened list of objects in the object graph.
   * The position of the object in this list indicates its id.
   * Nodes[0] is considered the root node.
   * </pre>
   *
   * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.framework.SavedObjectOrBuilder> 
      getNodesOrBuilderList() {
    return nodes_;
  }
  /**
   * <pre>
   * Flattened list of objects in the object graph.
   * The position of the object in this list indicates its id.
   * Nodes[0] is considered the root node.
   * </pre>
   *
   * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
   */
  public int getNodesCount() {
    return nodes_.size();
  }
  /**
   * <pre>
   * Flattened list of objects in the object graph.
   * The position of the object in this list indicates its id.
   * Nodes[0] is considered the root node.
   * </pre>
   *
   * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
   */
  public org.tensorflow.proto.framework.SavedObject getNodes(int index) {
    return nodes_.get(index);
  }
  /**
   * <pre>
   * Flattened list of objects in the object graph.
   * The position of the object in this list indicates its id.
   * Nodes[0] is considered the root node.
   * </pre>
   *
   * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
   */
  public org.tensorflow.proto.framework.SavedObjectOrBuilder getNodesOrBuilder(
      int index) {
    return nodes_.get(index);
  }

  public static final int CONCRETE_FUNCTIONS_FIELD_NUMBER = 2;
  private static final class ConcreteFunctionsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>newDefaultInstance(
                org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.MESSAGE,
                org.tensorflow.proto.framework.SavedConcreteFunction.getDefaultInstance());
  }
  private com.google.protobuf.MapField<
      java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> concreteFunctions_;
  private com.google.protobuf.MapField<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>
  internalGetConcreteFunctions() {
    if (concreteFunctions_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          ConcreteFunctionsDefaultEntryHolder.defaultEntry);
    }
    return concreteFunctions_;
  }

  public int getConcreteFunctionsCount() {
    return internalGetConcreteFunctions().getMap().size();
  }
  /**
   * <pre>
   * Information about captures and output structures in concrete functions.
   * Referenced from SavedBareConcreteFunction and SavedFunction.
   * </pre>
   *
   * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
   */

  public boolean containsConcreteFunctions(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetConcreteFunctions().getMap().containsKey(key);
  }
  /**
   * Use {@link #getConcreteFunctionsMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> getConcreteFunctions() {
    return getConcreteFunctionsMap();
  }
  /**
   * <pre>
   * Information about captures and output structures in concrete functions.
   * Referenced from SavedBareConcreteFunction and SavedFunction.
   * </pre>
   *
   * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
   */

  public java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> getConcreteFunctionsMap() {
    return internalGetConcreteFunctions().getMap();
  }
  /**
   * <pre>
   * Information about captures and output structures in concrete functions.
   * Referenced from SavedBareConcreteFunction and SavedFunction.
   * </pre>
   *
   * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
   */

  public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrDefault(
      java.lang.String key,
      org.tensorflow.proto.framework.SavedConcreteFunction defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> map =
        internalGetConcreteFunctions().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * Information about captures and output structures in concrete functions.
   * Referenced from SavedBareConcreteFunction and SavedFunction.
   * </pre>
   *
   * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
   */

  public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrThrow(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> map =
        internalGetConcreteFunctions().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    for (int i = 0; i < nodes_.size(); i++) {
      output.writeMessage(1, nodes_.get(i));
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetConcreteFunctions(),
        ConcreteFunctionsDefaultEntryHolder.defaultEntry,
        2);
    unknownFields.writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < nodes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, nodes_.get(i));
    }
    for (java.util.Map.Entry<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> entry
         : internalGetConcreteFunctions().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>
      concreteFunctions__ = ConcreteFunctionsDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, concreteFunctions__);
    }
    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 org.tensorflow.proto.framework.SavedObjectGraph)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.framework.SavedObjectGraph other = (org.tensorflow.proto.framework.SavedObjectGraph) obj;

    if (!getNodesList()
        .equals(other.getNodesList())) return false;
    if (!internalGetConcreteFunctions().equals(
        other.internalGetConcreteFunctions())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getNodesCount() > 0) {
      hash = (37 * hash) + NODES_FIELD_NUMBER;
      hash = (53 * hash) + getNodesList().hashCode();
    }
    if (!internalGetConcreteFunctions().getMap().isEmpty()) {
      hash = (37 * hash) + CONCRETE_FUNCTIONS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetConcreteFunctions().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.proto.framework.SavedObjectGraph prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code tensorflow.SavedObjectGraph}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.SavedObjectGraph)
      org.tensorflow.proto.framework.SavedObjectGraphOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 2:
          return internalGetConcreteFunctions();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 2:
          return internalGetMutableConcreteFunctions();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.framework.SavedObjectGraph.class, org.tensorflow.proto.framework.SavedObjectGraph.Builder.class);
    }

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getNodesFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (nodesBuilder_ == null) {
        nodes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        nodesBuilder_.clear();
      }
      internalGetMutableConcreteFunctions().clear();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_descriptor;
    }

    @java.lang.Override
    public org.tensorflow.proto.framework.SavedObjectGraph getDefaultInstanceForType() {
      return org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance();
    }

    @java.lang.Override
    public org.tensorflow.proto.framework.SavedObjectGraph build() {
      org.tensorflow.proto.framework.SavedObjectGraph result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tensorflow.proto.framework.SavedObjectGraph buildPartial() {
      org.tensorflow.proto.framework.SavedObjectGraph result = new org.tensorflow.proto.framework.SavedObjectGraph(this);
      int from_bitField0_ = bitField0_;
      if (nodesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          nodes_ = java.util.Collections.unmodifiableList(nodes_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.nodes_ = nodes_;
      } else {
        result.nodes_ = nodesBuilder_.build();
      }
      result.concreteFunctions_ = internalGetConcreteFunctions();
      result.concreteFunctions_.makeImmutable();
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.proto.framework.SavedObjectGraph) {
        return mergeFrom((org.tensorflow.proto.framework.SavedObjectGraph)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.framework.SavedObjectGraph other) {
      if (other == org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance()) return this;
      if (nodesBuilder_ == null) {
        if (!other.nodes_.isEmpty()) {
          if (nodes_.isEmpty()) {
            nodes_ = other.nodes_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureNodesIsMutable();
            nodes_.addAll(other.nodes_);
          }
          onChanged();
        }
      } else {
        if (!other.nodes_.isEmpty()) {
          if (nodesBuilder_.isEmpty()) {
            nodesBuilder_.dispose();
            nodesBuilder_ = null;
            nodes_ = other.nodes_;
            bitField0_ = (bitField0_ & ~0x00000001);
            nodesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getNodesFieldBuilder() : null;
          } else {
            nodesBuilder_.addAllMessages(other.nodes_);
          }
        }
      }
      internalGetMutableConcreteFunctions().mergeFrom(
          other.internalGetConcreteFunctions());
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tensorflow.proto.framework.SavedObjectGraph parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.framework.SavedObjectGraph) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.util.List<org.tensorflow.proto.framework.SavedObject> nodes_ =
      java.util.Collections.emptyList();
    private void ensureNodesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        nodes_ = new java.util.ArrayList<org.tensorflow.proto.framework.SavedObject>(nodes_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.SavedObject, org.tensorflow.proto.framework.SavedObject.Builder, org.tensorflow.proto.framework.SavedObjectOrBuilder> nodesBuilder_;

    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.SavedObject> getNodesList() {
      if (nodesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(nodes_);
      } else {
        return nodesBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public int getNodesCount() {
      if (nodesBuilder_ == null) {
        return nodes_.size();
      } else {
        return nodesBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public org.tensorflow.proto.framework.SavedObject getNodes(int index) {
      if (nodesBuilder_ == null) {
        return nodes_.get(index);
      } else {
        return nodesBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder setNodes(
        int index, org.tensorflow.proto.framework.SavedObject value) {
      if (nodesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNodesIsMutable();
        nodes_.set(index, value);
        onChanged();
      } else {
        nodesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder setNodes(
        int index, org.tensorflow.proto.framework.SavedObject.Builder builderForValue) {
      if (nodesBuilder_ == null) {
        ensureNodesIsMutable();
        nodes_.set(index, builderForValue.build());
        onChanged();
      } else {
        nodesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder addNodes(org.tensorflow.proto.framework.SavedObject value) {
      if (nodesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNodesIsMutable();
        nodes_.add(value);
        onChanged();
      } else {
        nodesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder addNodes(
        int index, org.tensorflow.proto.framework.SavedObject value) {
      if (nodesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNodesIsMutable();
        nodes_.add(index, value);
        onChanged();
      } else {
        nodesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder addNodes(
        org.tensorflow.proto.framework.SavedObject.Builder builderForValue) {
      if (nodesBuilder_ == null) {
        ensureNodesIsMutable();
        nodes_.add(builderForValue.build());
        onChanged();
      } else {
        nodesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder addNodes(
        int index, org.tensorflow.proto.framework.SavedObject.Builder builderForValue) {
      if (nodesBuilder_ == null) {
        ensureNodesIsMutable();
        nodes_.add(index, builderForValue.build());
        onChanged();
      } else {
        nodesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder addAllNodes(
        java.lang.Iterable<? extends org.tensorflow.proto.framework.SavedObject> values) {
      if (nodesBuilder_ == null) {
        ensureNodesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, nodes_);
        onChanged();
      } else {
        nodesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder clearNodes() {
      if (nodesBuilder_ == null) {
        nodes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        nodesBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public Builder removeNodes(int index) {
      if (nodesBuilder_ == null) {
        ensureNodesIsMutable();
        nodes_.remove(index);
        onChanged();
      } else {
        nodesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public org.tensorflow.proto.framework.SavedObject.Builder getNodesBuilder(
        int index) {
      return getNodesFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public org.tensorflow.proto.framework.SavedObjectOrBuilder getNodesOrBuilder(
        int index) {
      if (nodesBuilder_ == null) {
        return nodes_.get(index);  } else {
        return nodesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.framework.SavedObjectOrBuilder> 
         getNodesOrBuilderList() {
      if (nodesBuilder_ != null) {
        return nodesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(nodes_);
      }
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public org.tensorflow.proto.framework.SavedObject.Builder addNodesBuilder() {
      return getNodesFieldBuilder().addBuilder(
          org.tensorflow.proto.framework.SavedObject.getDefaultInstance());
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public org.tensorflow.proto.framework.SavedObject.Builder addNodesBuilder(
        int index) {
      return getNodesFieldBuilder().addBuilder(
          index, org.tensorflow.proto.framework.SavedObject.getDefaultInstance());
    }
    /**
     * <pre>
     * Flattened list of objects in the object graph.
     * The position of the object in this list indicates its id.
     * Nodes[0] is considered the root node.
     * </pre>
     *
     * <code>repeated .tensorflow.SavedObject nodes = 1;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.SavedObject.Builder> 
         getNodesBuilderList() {
      return getNodesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.SavedObject, org.tensorflow.proto.framework.SavedObject.Builder, org.tensorflow.proto.framework.SavedObjectOrBuilder> 
        getNodesFieldBuilder() {
      if (nodesBuilder_ == null) {
        nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.framework.SavedObject, org.tensorflow.proto.framework.SavedObject.Builder, org.tensorflow.proto.framework.SavedObjectOrBuilder>(
                nodes_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        nodes_ = null;
      }
      return nodesBuilder_;
    }

    private com.google.protobuf.MapField<
        java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> concreteFunctions_;
    private com.google.protobuf.MapField<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>
    internalGetConcreteFunctions() {
      if (concreteFunctions_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ConcreteFunctionsDefaultEntryHolder.defaultEntry);
      }
      return concreteFunctions_;
    }
    private com.google.protobuf.MapField<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>
    internalGetMutableConcreteFunctions() {
      onChanged();;
      if (concreteFunctions_ == null) {
        concreteFunctions_ = com.google.protobuf.MapField.newMapField(
            ConcreteFunctionsDefaultEntryHolder.defaultEntry);
      }
      if (!concreteFunctions_.isMutable()) {
        concreteFunctions_ = concreteFunctions_.copy();
      }
      return concreteFunctions_;
    }

    public int getConcreteFunctionsCount() {
      return internalGetConcreteFunctions().getMap().size();
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */

    public boolean containsConcreteFunctions(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetConcreteFunctions().getMap().containsKey(key);
    }
    /**
     * Use {@link #getConcreteFunctionsMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> getConcreteFunctions() {
      return getConcreteFunctionsMap();
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */

    public java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> getConcreteFunctionsMap() {
      return internalGetConcreteFunctions().getMap();
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */

    public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrDefault(
        java.lang.String key,
        org.tensorflow.proto.framework.SavedConcreteFunction defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> map =
          internalGetConcreteFunctions().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */

    public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> map =
          internalGetConcreteFunctions().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearConcreteFunctions() {
      internalGetMutableConcreteFunctions().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */

    public Builder removeConcreteFunctions(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableConcreteFunctions().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction>
    getMutableConcreteFunctions() {
      return internalGetMutableConcreteFunctions().getMutableMap();
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */
    public Builder putConcreteFunctions(
        java.lang.String key,
        org.tensorflow.proto.framework.SavedConcreteFunction value) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableConcreteFunctions().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * Information about captures and output structures in concrete functions.
     * Referenced from SavedBareConcreteFunction and SavedFunction.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.SavedConcreteFunction&gt; concrete_functions = 2;</code>
     */

    public Builder putAllConcreteFunctions(
        java.util.Map<java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> values) {
      internalGetMutableConcreteFunctions().getMutableMap()
          .putAll(values);
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:tensorflow.SavedObjectGraph)
  }

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

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

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

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

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

  @java.lang.Override
  public org.tensorflow.proto.framework.SavedObjectGraph getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

