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

package org.tensorflow.proto.profiler;

/**
 * <pre>
 * An XPlane is a container of parallel timelines (XLines), generated by a
 * profiling source or by post-processing one or more XPlanes.
 * Next ID: 7
 * </pre>
 *
 * Protobuf type {@code tensorflow.profiler.XPlane}
 */
public  final class XPlane extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.profiler.XPlane)
    XPlaneOrBuilder {
private static final long serialVersionUID = 0L;
  // Use XPlane.newBuilder() to construct.
  private XPlane(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private XPlane() {
    name_ = "";
    lines_ = java.util.Collections.emptyList();
    stats_ = java.util.Collections.emptyList();
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private XPlane(
      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 8: {

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

            name_ = s;
            break;
          }
          case 26: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              lines_ = new java.util.ArrayList<org.tensorflow.proto.profiler.XLine>();
              mutable_bitField0_ |= 0x00000001;
            }
            lines_.add(
                input.readMessage(org.tensorflow.proto.profiler.XLine.parser(), extensionRegistry));
            break;
          }
          case 34: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              eventMetadata_ = com.google.protobuf.MapField.newMapField(
                  EventMetadataDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000002;
            }
            com.google.protobuf.MapEntry<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>
            eventMetadata__ = input.readMessage(
                EventMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            eventMetadata_.getMutableMap().put(
                eventMetadata__.getKey(), eventMetadata__.getValue());
            break;
          }
          case 42: {
            if (!((mutable_bitField0_ & 0x00000004) != 0)) {
              statMetadata_ = com.google.protobuf.MapField.newMapField(
                  StatMetadataDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000004;
            }
            com.google.protobuf.MapEntry<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>
            statMetadata__ = input.readMessage(
                StatMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            statMetadata_.getMutableMap().put(
                statMetadata__.getKey(), statMetadata__.getValue());
            break;
          }
          case 50: {
            if (!((mutable_bitField0_ & 0x00000008) != 0)) {
              stats_ = new java.util.ArrayList<org.tensorflow.proto.profiler.XStat>();
              mutable_bitField0_ |= 0x00000008;
            }
            stats_.add(
                input.readMessage(org.tensorflow.proto.profiler.XStat.parser(), extensionRegistry));
            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)) {
        lines_ = java.util.Collections.unmodifiableList(lines_);
      }
      if (((mutable_bitField0_ & 0x00000008) != 0)) {
        stats_ = java.util.Collections.unmodifiableList(stats_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 4:
        return internalGetEventMetadata();
      case 5:
        return internalGetStatMetadata();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.profiler.XPlane.class, org.tensorflow.proto.profiler.XPlane.Builder.class);
  }

  public static final int ID_FIELD_NUMBER = 1;
  private long id_;
  /**
   * <code>int64 id = 1;</code>
   */
  public long getId() {
    return id_;
  }

  public static final int NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object name_;
  /**
   * <pre>
   * Name of this line.
   * </pre>
   *
   * <code>string name = 2;</code>
   */
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Name of this line.
   * </pre>
   *
   * <code>string name = 2;</code>
   */
  public com.google.protobuf.ByteString
      getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LINES_FIELD_NUMBER = 3;
  private java.util.List<org.tensorflow.proto.profiler.XLine> lines_;
  /**
   * <pre>
   * Parallel timelines grouped in this plane. XLines with the same id
   * are effectively the same timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
   */
  public java.util.List<org.tensorflow.proto.profiler.XLine> getLinesList() {
    return lines_;
  }
  /**
   * <pre>
   * Parallel timelines grouped in this plane. XLines with the same id
   * are effectively the same timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.profiler.XLineOrBuilder> 
      getLinesOrBuilderList() {
    return lines_;
  }
  /**
   * <pre>
   * Parallel timelines grouped in this plane. XLines with the same id
   * are effectively the same timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
   */
  public int getLinesCount() {
    return lines_.size();
  }
  /**
   * <pre>
   * Parallel timelines grouped in this plane. XLines with the same id
   * are effectively the same timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
   */
  public org.tensorflow.proto.profiler.XLine getLines(int index) {
    return lines_.get(index);
  }
  /**
   * <pre>
   * Parallel timelines grouped in this plane. XLines with the same id
   * are effectively the same timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
   */
  public org.tensorflow.proto.profiler.XLineOrBuilder getLinesOrBuilder(
      int index) {
    return lines_.get(index);
  }

  public static final int EVENT_METADATA_FIELD_NUMBER = 4;
  private static final class EventMetadataDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>newDefaultInstance(
                org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.INT64,
                0L,
                com.google.protobuf.WireFormat.FieldType.MESSAGE,
                org.tensorflow.proto.profiler.XEventMetadata.getDefaultInstance());
  }
  private com.google.protobuf.MapField<
      java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> eventMetadata_;
  private com.google.protobuf.MapField<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>
  internalGetEventMetadata() {
    if (eventMetadata_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          EventMetadataDefaultEntryHolder.defaultEntry);
    }
    return eventMetadata_;
  }

  public int getEventMetadataCount() {
    return internalGetEventMetadata().getMap().size();
  }
  /**
   * <pre>
   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
   * should be used for events that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
   */

  public boolean containsEventMetadata(
      long key) {
    
    return internalGetEventMetadata().getMap().containsKey(key);
  }
  /**
   * Use {@link #getEventMetadataMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> getEventMetadata() {
    return getEventMetadataMap();
  }
  /**
   * <pre>
   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
   * should be used for events that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
   */

  public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> getEventMetadataMap() {
    return internalGetEventMetadata().getMap();
  }
  /**
   * <pre>
   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
   * should be used for events that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
   */

  public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrDefault(
      long key,
      org.tensorflow.proto.profiler.XEventMetadata defaultValue) {
    
    java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> map =
        internalGetEventMetadata().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
   * should be used for events that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
   */

  public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrThrow(
      long key) {
    
    java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> map =
        internalGetEventMetadata().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int STAT_METADATA_FIELD_NUMBER = 5;
  private static final class StatMetadataDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>newDefaultInstance(
                org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.INT64,
                0L,
                com.google.protobuf.WireFormat.FieldType.MESSAGE,
                org.tensorflow.proto.profiler.XStatMetadata.getDefaultInstance());
  }
  private com.google.protobuf.MapField<
      java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> statMetadata_;
  private com.google.protobuf.MapField<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>
  internalGetStatMetadata() {
    if (statMetadata_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          StatMetadataDefaultEntryHolder.defaultEntry);
    }
    return statMetadata_;
  }

  public int getStatMetadataCount() {
    return internalGetStatMetadata().getMap().size();
  }
  /**
   * <pre>
   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
   * should be used for stats that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
   */

  public boolean containsStatMetadata(
      long key) {
    
    return internalGetStatMetadata().getMap().containsKey(key);
  }
  /**
   * Use {@link #getStatMetadataMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> getStatMetadata() {
    return getStatMetadataMap();
  }
  /**
   * <pre>
   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
   * should be used for stats that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
   */

  public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> getStatMetadataMap() {
    return internalGetStatMetadata().getMap();
  }
  /**
   * <pre>
   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
   * should be used for stats that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
   */

  public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrDefault(
      long key,
      org.tensorflow.proto.profiler.XStatMetadata defaultValue) {
    
    java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> map =
        internalGetStatMetadata().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
   * should be used for stats that share the same ID over the whole XPlane.
   * </pre>
   *
   * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
   */

  public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow(
      long key) {
    
    java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> map =
        internalGetStatMetadata().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int STATS_FIELD_NUMBER = 6;
  private java.util.List<org.tensorflow.proto.profiler.XStat> stats_;
  /**
   * <pre>
   * XStats associated with this plane, e.g. device capabilities.
   * Each of these XStats should have a different metadata_id.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
   */
  public java.util.List<org.tensorflow.proto.profiler.XStat> getStatsList() {
    return stats_;
  }
  /**
   * <pre>
   * XStats associated with this plane, e.g. device capabilities.
   * Each of these XStats should have a different metadata_id.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.profiler.XStatOrBuilder> 
      getStatsOrBuilderList() {
    return stats_;
  }
  /**
   * <pre>
   * XStats associated with this plane, e.g. device capabilities.
   * Each of these XStats should have a different metadata_id.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
   */
  public int getStatsCount() {
    return stats_.size();
  }
  /**
   * <pre>
   * XStats associated with this plane, e.g. device capabilities.
   * Each of these XStats should have a different metadata_id.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
   */
  public org.tensorflow.proto.profiler.XStat getStats(int index) {
    return stats_.get(index);
  }
  /**
   * <pre>
   * XStats associated with this plane, e.g. device capabilities.
   * Each of these XStats should have a different metadata_id.
   * </pre>
   *
   * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
   */
  public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder(
      int index) {
    return stats_.get(index);
  }

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (id_ != 0L) {
      output.writeInt64(1, id_);
    }
    if (!getNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
    }
    for (int i = 0; i < lines_.size(); i++) {
      output.writeMessage(3, lines_.get(i));
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeLongMapTo(
        output,
        internalGetEventMetadata(),
        EventMetadataDefaultEntryHolder.defaultEntry,
        4);
    com.google.protobuf.GeneratedMessageV3
      .serializeLongMapTo(
        output,
        internalGetStatMetadata(),
        StatMetadataDefaultEntryHolder.defaultEntry,
        5);
    for (int i = 0; i < stats_.size(); i++) {
      output.writeMessage(6, stats_.get(i));
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (id_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(1, id_);
    }
    if (!getNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
    }
    for (int i = 0; i < lines_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, lines_.get(i));
    }
    for (java.util.Map.Entry<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> entry
         : internalGetEventMetadata().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>
      eventMetadata__ = EventMetadataDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, eventMetadata__);
    }
    for (java.util.Map.Entry<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> entry
         : internalGetStatMetadata().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>
      statMetadata__ = StatMetadataDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, statMetadata__);
    }
    for (int i = 0; i < stats_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, stats_.get(i));
    }
    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.profiler.XPlane)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.profiler.XPlane other = (org.tensorflow.proto.profiler.XPlane) obj;

    if (getId()
        != other.getId()) return false;
    if (!getName()
        .equals(other.getName())) return false;
    if (!getLinesList()
        .equals(other.getLinesList())) return false;
    if (!internalGetEventMetadata().equals(
        other.internalGetEventMetadata())) return false;
    if (!internalGetStatMetadata().equals(
        other.internalGetStatMetadata())) return false;
    if (!getStatsList()
        .equals(other.getStatsList())) 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();
    hash = (37 * hash) + ID_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getId());
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    if (getLinesCount() > 0) {
      hash = (37 * hash) + LINES_FIELD_NUMBER;
      hash = (53 * hash) + getLinesList().hashCode();
    }
    if (!internalGetEventMetadata().getMap().isEmpty()) {
      hash = (37 * hash) + EVENT_METADATA_FIELD_NUMBER;
      hash = (53 * hash) + internalGetEventMetadata().hashCode();
    }
    if (!internalGetStatMetadata().getMap().isEmpty()) {
      hash = (37 * hash) + STAT_METADATA_FIELD_NUMBER;
      hash = (53 * hash) + internalGetStatMetadata().hashCode();
    }
    if (getStatsCount() > 0) {
      hash = (37 * hash) + STATS_FIELD_NUMBER;
      hash = (53 * hash) + getStatsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.profiler.XPlane parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.XPlane 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.profiler.XPlane parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.XPlane 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.profiler.XPlane parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.XPlane parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.XPlane parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.XPlane 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.profiler.XPlane parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.XPlane 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.profiler.XPlane parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.XPlane 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.profiler.XPlane prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * An XPlane is a container of parallel timelines (XLines), generated by a
   * profiling source or by post-processing one or more XPlanes.
   * Next ID: 7
   * </pre>
   *
   * Protobuf type {@code tensorflow.profiler.XPlane}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XPlane)
      org.tensorflow.proto.profiler.XPlaneOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 4:
          return internalGetEventMetadata();
        case 5:
          return internalGetStatMetadata();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 4:
          return internalGetMutableEventMetadata();
        case 5:
          return internalGetMutableStatMetadata();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.profiler.XPlane.class, org.tensorflow.proto.profiler.XPlane.Builder.class);
    }

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getLinesFieldBuilder();
        getStatsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      id_ = 0L;

      name_ = "";

      if (linesBuilder_ == null) {
        lines_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        linesBuilder_.clear();
      }
      internalGetMutableEventMetadata().clear();
      internalGetMutableStatMetadata().clear();
      if (statsBuilder_ == null) {
        stats_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
      } else {
        statsBuilder_.clear();
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_descriptor;
    }

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

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

    @java.lang.Override
    public org.tensorflow.proto.profiler.XPlane buildPartial() {
      org.tensorflow.proto.profiler.XPlane result = new org.tensorflow.proto.profiler.XPlane(this);
      int from_bitField0_ = bitField0_;
      result.id_ = id_;
      result.name_ = name_;
      if (linesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          lines_ = java.util.Collections.unmodifiableList(lines_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.lines_ = lines_;
      } else {
        result.lines_ = linesBuilder_.build();
      }
      result.eventMetadata_ = internalGetEventMetadata();
      result.eventMetadata_.makeImmutable();
      result.statMetadata_ = internalGetStatMetadata();
      result.statMetadata_.makeImmutable();
      if (statsBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)) {
          stats_ = java.util.Collections.unmodifiableList(stats_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.stats_ = stats_;
      } else {
        result.stats_ = statsBuilder_.build();
      }
      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.profiler.XPlane) {
        return mergeFrom((org.tensorflow.proto.profiler.XPlane)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.profiler.XPlane other) {
      if (other == org.tensorflow.proto.profiler.XPlane.getDefaultInstance()) return this;
      if (other.getId() != 0L) {
        setId(other.getId());
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (linesBuilder_ == null) {
        if (!other.lines_.isEmpty()) {
          if (lines_.isEmpty()) {
            lines_ = other.lines_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureLinesIsMutable();
            lines_.addAll(other.lines_);
          }
          onChanged();
        }
      } else {
        if (!other.lines_.isEmpty()) {
          if (linesBuilder_.isEmpty()) {
            linesBuilder_.dispose();
            linesBuilder_ = null;
            lines_ = other.lines_;
            bitField0_ = (bitField0_ & ~0x00000001);
            linesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getLinesFieldBuilder() : null;
          } else {
            linesBuilder_.addAllMessages(other.lines_);
          }
        }
      }
      internalGetMutableEventMetadata().mergeFrom(
          other.internalGetEventMetadata());
      internalGetMutableStatMetadata().mergeFrom(
          other.internalGetStatMetadata());
      if (statsBuilder_ == null) {
        if (!other.stats_.isEmpty()) {
          if (stats_.isEmpty()) {
            stats_ = other.stats_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureStatsIsMutable();
            stats_.addAll(other.stats_);
          }
          onChanged();
        }
      } else {
        if (!other.stats_.isEmpty()) {
          if (statsBuilder_.isEmpty()) {
            statsBuilder_.dispose();
            statsBuilder_ = null;
            stats_ = other.stats_;
            bitField0_ = (bitField0_ & ~0x00000008);
            statsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getStatsFieldBuilder() : null;
          } else {
            statsBuilder_.addAllMessages(other.stats_);
          }
        }
      }
      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.profiler.XPlane parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.profiler.XPlane) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private long id_ ;
    /**
     * <code>int64 id = 1;</code>
     */
    public long getId() {
      return id_;
    }
    /**
     * <code>int64 id = 1;</code>
     */
    public Builder setId(long value) {
      
      id_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int64 id = 1;</code>
     */
    public Builder clearId() {
      
      id_ = 0L;
      onChanged();
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     * <pre>
     * Name of this line.
     * </pre>
     *
     * <code>string name = 2;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Name of this line.
     * </pre>
     *
     * <code>string name = 2;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Name of this line.
     * </pre>
     *
     * <code>string name = 2;</code>
     */
    public Builder setName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      name_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Name of this line.
     * </pre>
     *
     * <code>string name = 2;</code>
     */
    public Builder clearName() {
      
      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Name of this line.
     * </pre>
     *
     * <code>string name = 2;</code>
     */
    public Builder setNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      name_ = value;
      onChanged();
      return this;
    }

    private java.util.List<org.tensorflow.proto.profiler.XLine> lines_ =
      java.util.Collections.emptyList();
    private void ensureLinesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        lines_ = new java.util.ArrayList<org.tensorflow.proto.profiler.XLine>(lines_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.profiler.XLine, org.tensorflow.proto.profiler.XLine.Builder, org.tensorflow.proto.profiler.XLineOrBuilder> linesBuilder_;

    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public java.util.List<org.tensorflow.proto.profiler.XLine> getLinesList() {
      if (linesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(lines_);
      } else {
        return linesBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public int getLinesCount() {
      if (linesBuilder_ == null) {
        return lines_.size();
      } else {
        return linesBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public org.tensorflow.proto.profiler.XLine getLines(int index) {
      if (linesBuilder_ == null) {
        return lines_.get(index);
      } else {
        return linesBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder setLines(
        int index, org.tensorflow.proto.profiler.XLine value) {
      if (linesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLinesIsMutable();
        lines_.set(index, value);
        onChanged();
      } else {
        linesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder setLines(
        int index, org.tensorflow.proto.profiler.XLine.Builder builderForValue) {
      if (linesBuilder_ == null) {
        ensureLinesIsMutable();
        lines_.set(index, builderForValue.build());
        onChanged();
      } else {
        linesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder addLines(org.tensorflow.proto.profiler.XLine value) {
      if (linesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLinesIsMutable();
        lines_.add(value);
        onChanged();
      } else {
        linesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder addLines(
        int index, org.tensorflow.proto.profiler.XLine value) {
      if (linesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLinesIsMutable();
        lines_.add(index, value);
        onChanged();
      } else {
        linesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder addLines(
        org.tensorflow.proto.profiler.XLine.Builder builderForValue) {
      if (linesBuilder_ == null) {
        ensureLinesIsMutable();
        lines_.add(builderForValue.build());
        onChanged();
      } else {
        linesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder addLines(
        int index, org.tensorflow.proto.profiler.XLine.Builder builderForValue) {
      if (linesBuilder_ == null) {
        ensureLinesIsMutable();
        lines_.add(index, builderForValue.build());
        onChanged();
      } else {
        linesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder addAllLines(
        java.lang.Iterable<? extends org.tensorflow.proto.profiler.XLine> values) {
      if (linesBuilder_ == null) {
        ensureLinesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, lines_);
        onChanged();
      } else {
        linesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder clearLines() {
      if (linesBuilder_ == null) {
        lines_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        linesBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public Builder removeLines(int index) {
      if (linesBuilder_ == null) {
        ensureLinesIsMutable();
        lines_.remove(index);
        onChanged();
      } else {
        linesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public org.tensorflow.proto.profiler.XLine.Builder getLinesBuilder(
        int index) {
      return getLinesFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public org.tensorflow.proto.profiler.XLineOrBuilder getLinesOrBuilder(
        int index) {
      if (linesBuilder_ == null) {
        return lines_.get(index);  } else {
        return linesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.profiler.XLineOrBuilder> 
         getLinesOrBuilderList() {
      if (linesBuilder_ != null) {
        return linesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(lines_);
      }
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public org.tensorflow.proto.profiler.XLine.Builder addLinesBuilder() {
      return getLinesFieldBuilder().addBuilder(
          org.tensorflow.proto.profiler.XLine.getDefaultInstance());
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public org.tensorflow.proto.profiler.XLine.Builder addLinesBuilder(
        int index) {
      return getLinesFieldBuilder().addBuilder(
          index, org.tensorflow.proto.profiler.XLine.getDefaultInstance());
    }
    /**
     * <pre>
     * Parallel timelines grouped in this plane. XLines with the same id
     * are effectively the same timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XLine lines = 3;</code>
     */
    public java.util.List<org.tensorflow.proto.profiler.XLine.Builder> 
         getLinesBuilderList() {
      return getLinesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.profiler.XLine, org.tensorflow.proto.profiler.XLine.Builder, org.tensorflow.proto.profiler.XLineOrBuilder> 
        getLinesFieldBuilder() {
      if (linesBuilder_ == null) {
        linesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.profiler.XLine, org.tensorflow.proto.profiler.XLine.Builder, org.tensorflow.proto.profiler.XLineOrBuilder>(
                lines_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        lines_ = null;
      }
      return linesBuilder_;
    }

    private com.google.protobuf.MapField<
        java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> eventMetadata_;
    private com.google.protobuf.MapField<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>
    internalGetEventMetadata() {
      if (eventMetadata_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            EventMetadataDefaultEntryHolder.defaultEntry);
      }
      return eventMetadata_;
    }
    private com.google.protobuf.MapField<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>
    internalGetMutableEventMetadata() {
      onChanged();;
      if (eventMetadata_ == null) {
        eventMetadata_ = com.google.protobuf.MapField.newMapField(
            EventMetadataDefaultEntryHolder.defaultEntry);
      }
      if (!eventMetadata_.isMutable()) {
        eventMetadata_ = eventMetadata_.copy();
      }
      return eventMetadata_;
    }

    public int getEventMetadataCount() {
      return internalGetEventMetadata().getMap().size();
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */

    public boolean containsEventMetadata(
        long key) {
      
      return internalGetEventMetadata().getMap().containsKey(key);
    }
    /**
     * Use {@link #getEventMetadataMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> getEventMetadata() {
      return getEventMetadataMap();
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */

    public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> getEventMetadataMap() {
      return internalGetEventMetadata().getMap();
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */

    public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrDefault(
        long key,
        org.tensorflow.proto.profiler.XEventMetadata defaultValue) {
      
      java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> map =
          internalGetEventMetadata().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */

    public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrThrow(
        long key) {
      
      java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> map =
          internalGetEventMetadata().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearEventMetadata() {
      internalGetMutableEventMetadata().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */

    public Builder removeEventMetadata(
        long key) {
      
      internalGetMutableEventMetadata().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>
    getMutableEventMetadata() {
      return internalGetMutableEventMetadata().getMutableMap();
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */
    public Builder putEventMetadata(
        long key,
        org.tensorflow.proto.profiler.XEventMetadata value) {
      
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableEventMetadata().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
     * should be used for events that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XEventMetadata&gt; event_metadata = 4;</code>
     */

    public Builder putAllEventMetadata(
        java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> values) {
      internalGetMutableEventMetadata().getMutableMap()
          .putAll(values);
      return this;
    }

    private com.google.protobuf.MapField<
        java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> statMetadata_;
    private com.google.protobuf.MapField<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>
    internalGetStatMetadata() {
      if (statMetadata_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            StatMetadataDefaultEntryHolder.defaultEntry);
      }
      return statMetadata_;
    }
    private com.google.protobuf.MapField<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>
    internalGetMutableStatMetadata() {
      onChanged();;
      if (statMetadata_ == null) {
        statMetadata_ = com.google.protobuf.MapField.newMapField(
            StatMetadataDefaultEntryHolder.defaultEntry);
      }
      if (!statMetadata_.isMutable()) {
        statMetadata_ = statMetadata_.copy();
      }
      return statMetadata_;
    }

    public int getStatMetadataCount() {
      return internalGetStatMetadata().getMap().size();
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */

    public boolean containsStatMetadata(
        long key) {
      
      return internalGetStatMetadata().getMap().containsKey(key);
    }
    /**
     * Use {@link #getStatMetadataMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> getStatMetadata() {
      return getStatMetadataMap();
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */

    public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> getStatMetadataMap() {
      return internalGetStatMetadata().getMap();
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */

    public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrDefault(
        long key,
        org.tensorflow.proto.profiler.XStatMetadata defaultValue) {
      
      java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> map =
          internalGetStatMetadata().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */

    public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow(
        long key) {
      
      java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> map =
          internalGetStatMetadata().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearStatMetadata() {
      internalGetMutableStatMetadata().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */

    public Builder removeStatMetadata(
        long key) {
      
      internalGetMutableStatMetadata().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>
    getMutableStatMetadata() {
      return internalGetMutableStatMetadata().getMutableMap();
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */
    public Builder putStatMetadata(
        long key,
        org.tensorflow.proto.profiler.XStatMetadata value) {
      
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableStatMetadata().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
     * should be used for stats that share the same ID over the whole XPlane.
     * </pre>
     *
     * <code>map&lt;int64, .tensorflow.profiler.XStatMetadata&gt; stat_metadata = 5;</code>
     */

    public Builder putAllStatMetadata(
        java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> values) {
      internalGetMutableStatMetadata().getMutableMap()
          .putAll(values);
      return this;
    }

    private java.util.List<org.tensorflow.proto.profiler.XStat> stats_ =
      java.util.Collections.emptyList();
    private void ensureStatsIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        stats_ = new java.util.ArrayList<org.tensorflow.proto.profiler.XStat>(stats_);
        bitField0_ |= 0x00000008;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder> statsBuilder_;

    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public java.util.List<org.tensorflow.proto.profiler.XStat> getStatsList() {
      if (statsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(stats_);
      } else {
        return statsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public int getStatsCount() {
      if (statsBuilder_ == null) {
        return stats_.size();
      } else {
        return statsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public org.tensorflow.proto.profiler.XStat getStats(int index) {
      if (statsBuilder_ == null) {
        return stats_.get(index);
      } else {
        return statsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder setStats(
        int index, org.tensorflow.proto.profiler.XStat value) {
      if (statsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureStatsIsMutable();
        stats_.set(index, value);
        onChanged();
      } else {
        statsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder setStats(
        int index, org.tensorflow.proto.profiler.XStat.Builder builderForValue) {
      if (statsBuilder_ == null) {
        ensureStatsIsMutable();
        stats_.set(index, builderForValue.build());
        onChanged();
      } else {
        statsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder addStats(org.tensorflow.proto.profiler.XStat value) {
      if (statsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureStatsIsMutable();
        stats_.add(value);
        onChanged();
      } else {
        statsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder addStats(
        int index, org.tensorflow.proto.profiler.XStat value) {
      if (statsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureStatsIsMutable();
        stats_.add(index, value);
        onChanged();
      } else {
        statsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder addStats(
        org.tensorflow.proto.profiler.XStat.Builder builderForValue) {
      if (statsBuilder_ == null) {
        ensureStatsIsMutable();
        stats_.add(builderForValue.build());
        onChanged();
      } else {
        statsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder addStats(
        int index, org.tensorflow.proto.profiler.XStat.Builder builderForValue) {
      if (statsBuilder_ == null) {
        ensureStatsIsMutable();
        stats_.add(index, builderForValue.build());
        onChanged();
      } else {
        statsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder addAllStats(
        java.lang.Iterable<? extends org.tensorflow.proto.profiler.XStat> values) {
      if (statsBuilder_ == null) {
        ensureStatsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, stats_);
        onChanged();
      } else {
        statsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder clearStats() {
      if (statsBuilder_ == null) {
        stats_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
      } else {
        statsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public Builder removeStats(int index) {
      if (statsBuilder_ == null) {
        ensureStatsIsMutable();
        stats_.remove(index);
        onChanged();
      } else {
        statsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public org.tensorflow.proto.profiler.XStat.Builder getStatsBuilder(
        int index) {
      return getStatsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder(
        int index) {
      if (statsBuilder_ == null) {
        return stats_.get(index);  } else {
        return statsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.profiler.XStatOrBuilder> 
         getStatsOrBuilderList() {
      if (statsBuilder_ != null) {
        return statsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(stats_);
      }
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder() {
      return getStatsFieldBuilder().addBuilder(
          org.tensorflow.proto.profiler.XStat.getDefaultInstance());
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder(
        int index) {
      return getStatsFieldBuilder().addBuilder(
          index, org.tensorflow.proto.profiler.XStat.getDefaultInstance());
    }
    /**
     * <pre>
     * XStats associated with this plane, e.g. device capabilities.
     * Each of these XStats should have a different metadata_id.
     * </pre>
     *
     * <code>repeated .tensorflow.profiler.XStat stats = 6;</code>
     */
    public java.util.List<org.tensorflow.proto.profiler.XStat.Builder> 
         getStatsBuilderList() {
      return getStatsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder> 
        getStatsFieldBuilder() {
      if (statsBuilder_ == null) {
        statsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder>(
                stats_,
                ((bitField0_ & 0x00000008) != 0),
                getParentForChildren(),
                isClean());
        stats_ = null;
      }
      return statsBuilder_;
    }
    @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.profiler.XPlane)
  }

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

  public static org.tensorflow.proto.profiler.XPlane getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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

}

