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

package org.tensorflow.proto.profiler;

/**
 * <pre>
 * An XStat is a named value associated with an XEvent, e.g., a performance
 * counter value, a metric computed by a formula applied over nested XEvents
 * and XStats.
 * Next ID: 8
 * </pre>
 *
 * Protobuf type {@code tensorflow.profiler.XStat}
 */
public  final class XStat extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.profiler.XStat)
    XStatOrBuilder {
private static final long serialVersionUID = 0L;
  // Use XStat.newBuilder() to construct.
  private XStat(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private XStat() {
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private XStat(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    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: {

            metadataId_ = input.readInt64();
            break;
          }
          case 17: {
            valueCase_ = 2;
            value_ = input.readDouble();
            break;
          }
          case 24: {
            valueCase_ = 3;
            value_ = input.readUInt64();
            break;
          }
          case 32: {
            valueCase_ = 4;
            value_ = input.readInt64();
            break;
          }
          case 42: {
            java.lang.String s = input.readStringRequireUtf8();
            valueCase_ = 5;
            value_ = s;
            break;
          }
          case 50: {
            valueCase_ = 6;
            value_ = input.readBytes();
            break;
          }
          case 56: {
            valueCase_ = 7;
            value_ = input.readUInt64();
            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 {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.profiler.XStat.class, org.tensorflow.proto.profiler.XStat.Builder.class);
  }

  private int valueCase_ = 0;
  private java.lang.Object value_;
  public enum ValueCase
      implements com.google.protobuf.Internal.EnumLite {
    DOUBLE_VALUE(2),
    UINT64_VALUE(3),
    INT64_VALUE(4),
    STR_VALUE(5),
    BYTES_VALUE(6),
    REF_VALUE(7),
    VALUE_NOT_SET(0);
    private final int value;
    private ValueCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static ValueCase valueOf(int value) {
      return forNumber(value);
    }

    public static ValueCase forNumber(int value) {
      switch (value) {
        case 2: return DOUBLE_VALUE;
        case 3: return UINT64_VALUE;
        case 4: return INT64_VALUE;
        case 5: return STR_VALUE;
        case 6: return BYTES_VALUE;
        case 7: return REF_VALUE;
        case 0: return VALUE_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public ValueCase
  getValueCase() {
    return ValueCase.forNumber(
        valueCase_);
  }

  public static final int METADATA_ID_FIELD_NUMBER = 1;
  private long metadataId_;
  /**
   * <pre>
   * XStatMetadata.id of corresponding metadata.
   * </pre>
   *
   * <code>int64 metadata_id = 1;</code>
   */
  public long getMetadataId() {
    return metadataId_;
  }

  public static final int DOUBLE_VALUE_FIELD_NUMBER = 2;
  /**
   * <code>double double_value = 2;</code>
   */
  public double getDoubleValue() {
    if (valueCase_ == 2) {
      return (java.lang.Double) value_;
    }
    return 0D;
  }

  public static final int UINT64_VALUE_FIELD_NUMBER = 3;
  /**
   * <code>uint64 uint64_value = 3;</code>
   */
  public long getUint64Value() {
    if (valueCase_ == 3) {
      return (java.lang.Long) value_;
    }
    return 0L;
  }

  public static final int INT64_VALUE_FIELD_NUMBER = 4;
  /**
   * <code>int64 int64_value = 4;</code>
   */
  public long getInt64Value() {
    if (valueCase_ == 4) {
      return (java.lang.Long) value_;
    }
    return 0L;
  }

  public static final int STR_VALUE_FIELD_NUMBER = 5;
  /**
   * <code>string str_value = 5;</code>
   */
  public java.lang.String getStrValue() {
    java.lang.Object ref = "";
    if (valueCase_ == 5) {
      ref = value_;
    }
    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();
      if (valueCase_ == 5) {
        value_ = s;
      }
      return s;
    }
  }
  /**
   * <code>string str_value = 5;</code>
   */
  public com.google.protobuf.ByteString
      getStrValueBytes() {
    java.lang.Object ref = "";
    if (valueCase_ == 5) {
      ref = value_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      if (valueCase_ == 5) {
        value_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int BYTES_VALUE_FIELD_NUMBER = 6;
  /**
   * <code>bytes bytes_value = 6;</code>
   */
  public com.google.protobuf.ByteString getBytesValue() {
    if (valueCase_ == 6) {
      return (com.google.protobuf.ByteString) value_;
    }
    return com.google.protobuf.ByteString.EMPTY;
  }

  public static final int REF_VALUE_FIELD_NUMBER = 7;
  /**
   * <pre>
   * A string value that stored in XStatMetadata::name.
   * </pre>
   *
   * <code>uint64 ref_value = 7;</code>
   */
  public long getRefValue() {
    if (valueCase_ == 7) {
      return (java.lang.Long) value_;
    }
    return 0L;
  }

  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 (metadataId_ != 0L) {
      output.writeInt64(1, metadataId_);
    }
    if (valueCase_ == 2) {
      output.writeDouble(
          2, (double)((java.lang.Double) value_));
    }
    if (valueCase_ == 3) {
      output.writeUInt64(
          3, (long)((java.lang.Long) value_));
    }
    if (valueCase_ == 4) {
      output.writeInt64(
          4, (long)((java.lang.Long) value_));
    }
    if (valueCase_ == 5) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, value_);
    }
    if (valueCase_ == 6) {
      output.writeBytes(
          6, (com.google.protobuf.ByteString) value_);
    }
    if (valueCase_ == 7) {
      output.writeUInt64(
          7, (long)((java.lang.Long) value_));
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (metadataId_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(1, metadataId_);
    }
    if (valueCase_ == 2) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(
            2, (double)((java.lang.Double) value_));
    }
    if (valueCase_ == 3) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(
            3, (long)((java.lang.Long) value_));
    }
    if (valueCase_ == 4) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(
            4, (long)((java.lang.Long) value_));
    }
    if (valueCase_ == 5) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, value_);
    }
    if (valueCase_ == 6) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(
            6, (com.google.protobuf.ByteString) value_);
    }
    if (valueCase_ == 7) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(
            7, (long)((java.lang.Long) value_));
    }
    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.XStat)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.profiler.XStat other = (org.tensorflow.proto.profiler.XStat) obj;

    if (getMetadataId()
        != other.getMetadataId()) return false;
    if (!getValueCase().equals(other.getValueCase())) return false;
    switch (valueCase_) {
      case 2:
        if (java.lang.Double.doubleToLongBits(getDoubleValue())
            != java.lang.Double.doubleToLongBits(
                other.getDoubleValue())) return false;
        break;
      case 3:
        if (getUint64Value()
            != other.getUint64Value()) return false;
        break;
      case 4:
        if (getInt64Value()
            != other.getInt64Value()) return false;
        break;
      case 5:
        if (!getStrValue()
            .equals(other.getStrValue())) return false;
        break;
      case 6:
        if (!getBytesValue()
            .equals(other.getBytesValue())) return false;
        break;
      case 7:
        if (getRefValue()
            != other.getRefValue()) return false;
        break;
      case 0:
      default:
    }
    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) + METADATA_ID_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getMetadataId());
    switch (valueCase_) {
      case 2:
        hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            java.lang.Double.doubleToLongBits(getDoubleValue()));
        break;
      case 3:
        hash = (37 * hash) + UINT64_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getUint64Value());
        break;
      case 4:
        hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getInt64Value());
        break;
      case 5:
        hash = (37 * hash) + STR_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getStrValue().hashCode();
        break;
      case 6:
        hash = (37 * hash) + BYTES_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + getBytesValue().hashCode();
        break;
      case 7:
        hash = (37 * hash) + REF_VALUE_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getRefValue());
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.profiler.XStat parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.XStat 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.XStat parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.XStat 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.XStat parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.XStat parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.XStat parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.XStat 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.XStat parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.XStat 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.XStat parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.XStat 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.XStat 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 XStat is a named value associated with an XEvent, e.g., a performance
   * counter value, a metric computed by a formula applied over nested XEvents
   * and XStats.
   * Next ID: 8
   * </pre>
   *
   * Protobuf type {@code tensorflow.profiler.XStat}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XStat)
      org.tensorflow.proto.profiler.XStatOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.profiler.XStat.class, org.tensorflow.proto.profiler.XStat.Builder.class);
    }

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

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

      valueCase_ = 0;
      value_ = null;
      return this;
    }

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

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

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

    @java.lang.Override
    public org.tensorflow.proto.profiler.XStat buildPartial() {
      org.tensorflow.proto.profiler.XStat result = new org.tensorflow.proto.profiler.XStat(this);
      result.metadataId_ = metadataId_;
      if (valueCase_ == 2) {
        result.value_ = value_;
      }
      if (valueCase_ == 3) {
        result.value_ = value_;
      }
      if (valueCase_ == 4) {
        result.value_ = value_;
      }
      if (valueCase_ == 5) {
        result.value_ = value_;
      }
      if (valueCase_ == 6) {
        result.value_ = value_;
      }
      if (valueCase_ == 7) {
        result.value_ = value_;
      }
      result.valueCase_ = valueCase_;
      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.XStat) {
        return mergeFrom((org.tensorflow.proto.profiler.XStat)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.profiler.XStat other) {
      if (other == org.tensorflow.proto.profiler.XStat.getDefaultInstance()) return this;
      if (other.getMetadataId() != 0L) {
        setMetadataId(other.getMetadataId());
      }
      switch (other.getValueCase()) {
        case DOUBLE_VALUE: {
          setDoubleValue(other.getDoubleValue());
          break;
        }
        case UINT64_VALUE: {
          setUint64Value(other.getUint64Value());
          break;
        }
        case INT64_VALUE: {
          setInt64Value(other.getInt64Value());
          break;
        }
        case STR_VALUE: {
          valueCase_ = 5;
          value_ = other.value_;
          onChanged();
          break;
        }
        case BYTES_VALUE: {
          setBytesValue(other.getBytesValue());
          break;
        }
        case REF_VALUE: {
          setRefValue(other.getRefValue());
          break;
        }
        case VALUE_NOT_SET: {
          break;
        }
      }
      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.XStat parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.profiler.XStat) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int valueCase_ = 0;
    private java.lang.Object value_;
    public ValueCase
        getValueCase() {
      return ValueCase.forNumber(
          valueCase_);
    }

    public Builder clearValue() {
      valueCase_ = 0;
      value_ = null;
      onChanged();
      return this;
    }


    private long metadataId_ ;
    /**
     * <pre>
     * XStatMetadata.id of corresponding metadata.
     * </pre>
     *
     * <code>int64 metadata_id = 1;</code>
     */
    public long getMetadataId() {
      return metadataId_;
    }
    /**
     * <pre>
     * XStatMetadata.id of corresponding metadata.
     * </pre>
     *
     * <code>int64 metadata_id = 1;</code>
     */
    public Builder setMetadataId(long value) {
      
      metadataId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * XStatMetadata.id of corresponding metadata.
     * </pre>
     *
     * <code>int64 metadata_id = 1;</code>
     */
    public Builder clearMetadataId() {
      
      metadataId_ = 0L;
      onChanged();
      return this;
    }

    /**
     * <code>double double_value = 2;</code>
     */
    public double getDoubleValue() {
      if (valueCase_ == 2) {
        return (java.lang.Double) value_;
      }
      return 0D;
    }
    /**
     * <code>double double_value = 2;</code>
     */
    public Builder setDoubleValue(double value) {
      valueCase_ = 2;
      value_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double double_value = 2;</code>
     */
    public Builder clearDoubleValue() {
      if (valueCase_ == 2) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <code>uint64 uint64_value = 3;</code>
     */
    public long getUint64Value() {
      if (valueCase_ == 3) {
        return (java.lang.Long) value_;
      }
      return 0L;
    }
    /**
     * <code>uint64 uint64_value = 3;</code>
     */
    public Builder setUint64Value(long value) {
      valueCase_ = 3;
      value_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>uint64 uint64_value = 3;</code>
     */
    public Builder clearUint64Value() {
      if (valueCase_ == 3) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <code>int64 int64_value = 4;</code>
     */
    public long getInt64Value() {
      if (valueCase_ == 4) {
        return (java.lang.Long) value_;
      }
      return 0L;
    }
    /**
     * <code>int64 int64_value = 4;</code>
     */
    public Builder setInt64Value(long value) {
      valueCase_ = 4;
      value_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int64 int64_value = 4;</code>
     */
    public Builder clearInt64Value() {
      if (valueCase_ == 4) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <code>string str_value = 5;</code>
     */
    public java.lang.String getStrValue() {
      java.lang.Object ref = "";
      if (valueCase_ == 5) {
        ref = value_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (valueCase_ == 5) {
          value_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string str_value = 5;</code>
     */
    public com.google.protobuf.ByteString
        getStrValueBytes() {
      java.lang.Object ref = "";
      if (valueCase_ == 5) {
        ref = value_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        if (valueCase_ == 5) {
          value_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string str_value = 5;</code>
     */
    public Builder setStrValue(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  valueCase_ = 5;
      value_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string str_value = 5;</code>
     */
    public Builder clearStrValue() {
      if (valueCase_ == 5) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }
    /**
     * <code>string str_value = 5;</code>
     */
    public Builder setStrValueBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      valueCase_ = 5;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <code>bytes bytes_value = 6;</code>
     */
    public com.google.protobuf.ByteString getBytesValue() {
      if (valueCase_ == 6) {
        return (com.google.protobuf.ByteString) value_;
      }
      return com.google.protobuf.ByteString.EMPTY;
    }
    /**
     * <code>bytes bytes_value = 6;</code>
     */
    public Builder setBytesValue(com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  valueCase_ = 6;
      value_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>bytes bytes_value = 6;</code>
     */
    public Builder clearBytesValue() {
      if (valueCase_ == 6) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * A string value that stored in XStatMetadata::name.
     * </pre>
     *
     * <code>uint64 ref_value = 7;</code>
     */
    public long getRefValue() {
      if (valueCase_ == 7) {
        return (java.lang.Long) value_;
      }
      return 0L;
    }
    /**
     * <pre>
     * A string value that stored in XStatMetadata::name.
     * </pre>
     *
     * <code>uint64 ref_value = 7;</code>
     */
    public Builder setRefValue(long value) {
      valueCase_ = 7;
      value_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * A string value that stored in XStatMetadata::name.
     * </pre>
     *
     * <code>uint64 ref_value = 7;</code>
     */
    public Builder clearRefValue() {
      if (valueCase_ == 7) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XStat)
  }

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

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

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

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

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

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

}

