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

package org.tensorflow.proto.data;

/**
 * <pre>
 * Message stored with Dataset objects to control how datasets are processed and
 * optimized.
 * next: 8
 * </pre>
 *
 * Protobuf type {@code tensorflow.data.Options}
 */
public  final class Options extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.data.Options)
    OptionsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use Options.newBuilder() to construct.
  private Options(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private Options() {
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private Options(
      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: {
            optionalDeterministicCase_ = 1;
            optionalDeterministic_ = input.readBool();
            break;
          }
          case 18: {
            org.tensorflow.proto.data.DistributeOptions.Builder subBuilder = null;
            if (distributeOptions_ != null) {
              subBuilder = distributeOptions_.toBuilder();
            }
            distributeOptions_ = input.readMessage(org.tensorflow.proto.data.DistributeOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(distributeOptions_);
              distributeOptions_ = subBuilder.buildPartial();
            }

            break;
          }
          case 26: {
            org.tensorflow.proto.data.OptimizationOptions.Builder subBuilder = null;
            if (optimizationOptions_ != null) {
              subBuilder = optimizationOptions_.toBuilder();
            }
            optimizationOptions_ = input.readMessage(org.tensorflow.proto.data.OptimizationOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(optimizationOptions_);
              optimizationOptions_ = subBuilder.buildPartial();
            }

            break;
          }
          case 32: {
            optionalSlackCase_ = 4;
            optionalSlack_ = input.readBool();
            break;
          }
          case 42: {
            org.tensorflow.proto.data.ThreadingOptions.Builder subBuilder = null;
            if (threadingOptions_ != null) {
              subBuilder = threadingOptions_.toBuilder();
            }
            threadingOptions_ = input.readMessage(org.tensorflow.proto.data.ThreadingOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(threadingOptions_);
              threadingOptions_ = subBuilder.buildPartial();
            }

            break;
          }
          case 48: {
            int rawValue = input.readEnum();
            optionalExternalStatePolicyCase_ = 6;
            optionalExternalStatePolicy_ = rawValue;
            break;
          }
          case 58: {
            org.tensorflow.proto.data.AutotuneOptions.Builder subBuilder = null;
            if (autotuneOptions_ != null) {
              subBuilder = autotuneOptions_.toBuilder();
            }
            autotuneOptions_ = input.readMessage(org.tensorflow.proto.data.AutotuneOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(autotuneOptions_);
              autotuneOptions_ = subBuilder.buildPartial();
            }

            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.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.data.Options.class, org.tensorflow.proto.data.Options.Builder.class);
  }

  private int optionalDeterministicCase_ = 0;
  private java.lang.Object optionalDeterministic_;
  public enum OptionalDeterministicCase
      implements com.google.protobuf.Internal.EnumLite {
    DETERMINISTIC(1),
    OPTIONALDETERMINISTIC_NOT_SET(0);
    private final int value;
    private OptionalDeterministicCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static OptionalDeterministicCase valueOf(int value) {
      return forNumber(value);
    }

    public static OptionalDeterministicCase forNumber(int value) {
      switch (value) {
        case 1: return DETERMINISTIC;
        case 0: return OPTIONALDETERMINISTIC_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public OptionalDeterministicCase
  getOptionalDeterministicCase() {
    return OptionalDeterministicCase.forNumber(
        optionalDeterministicCase_);
  }

  private int optionalSlackCase_ = 0;
  private java.lang.Object optionalSlack_;
  public enum OptionalSlackCase
      implements com.google.protobuf.Internal.EnumLite {
    SLACK(4),
    OPTIONALSLACK_NOT_SET(0);
    private final int value;
    private OptionalSlackCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static OptionalSlackCase valueOf(int value) {
      return forNumber(value);
    }

    public static OptionalSlackCase forNumber(int value) {
      switch (value) {
        case 4: return SLACK;
        case 0: return OPTIONALSLACK_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public OptionalSlackCase
  getOptionalSlackCase() {
    return OptionalSlackCase.forNumber(
        optionalSlackCase_);
  }

  private int optionalExternalStatePolicyCase_ = 0;
  private java.lang.Object optionalExternalStatePolicy_;
  public enum OptionalExternalStatePolicyCase
      implements com.google.protobuf.Internal.EnumLite {
    EXTERNAL_STATE_POLICY(6),
    OPTIONALEXTERNALSTATEPOLICY_NOT_SET(0);
    private final int value;
    private OptionalExternalStatePolicyCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static OptionalExternalStatePolicyCase valueOf(int value) {
      return forNumber(value);
    }

    public static OptionalExternalStatePolicyCase forNumber(int value) {
      switch (value) {
        case 6: return EXTERNAL_STATE_POLICY;
        case 0: return OPTIONALEXTERNALSTATEPOLICY_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public OptionalExternalStatePolicyCase
  getOptionalExternalStatePolicyCase() {
    return OptionalExternalStatePolicyCase.forNumber(
        optionalExternalStatePolicyCase_);
  }

  public static final int DETERMINISTIC_FIELD_NUMBER = 1;
  /**
   * <code>bool deterministic = 1;</code>
   */
  public boolean getDeterministic() {
    if (optionalDeterministicCase_ == 1) {
      return (java.lang.Boolean) optionalDeterministic_;
    }
    return false;
  }

  public static final int AUTOTUNE_OPTIONS_FIELD_NUMBER = 7;
  private org.tensorflow.proto.data.AutotuneOptions autotuneOptions_;
  /**
   * <pre>
   * The distribution strategy options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
   */
  public boolean hasAutotuneOptions() {
    return autotuneOptions_ != null;
  }
  /**
   * <pre>
   * The distribution strategy options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
   */
  public org.tensorflow.proto.data.AutotuneOptions getAutotuneOptions() {
    return autotuneOptions_ == null ? org.tensorflow.proto.data.AutotuneOptions.getDefaultInstance() : autotuneOptions_;
  }
  /**
   * <pre>
   * The distribution strategy options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
   */
  public org.tensorflow.proto.data.AutotuneOptionsOrBuilder getAutotuneOptionsOrBuilder() {
    return getAutotuneOptions();
  }

  public static final int DISTRIBUTE_OPTIONS_FIELD_NUMBER = 2;
  private org.tensorflow.proto.data.DistributeOptions distributeOptions_;
  /**
   * <pre>
   * The distribution strategy options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
   */
  public boolean hasDistributeOptions() {
    return distributeOptions_ != null;
  }
  /**
   * <pre>
   * The distribution strategy options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
   */
  public org.tensorflow.proto.data.DistributeOptions getDistributeOptions() {
    return distributeOptions_ == null ? org.tensorflow.proto.data.DistributeOptions.getDefaultInstance() : distributeOptions_;
  }
  /**
   * <pre>
   * The distribution strategy options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
   */
  public org.tensorflow.proto.data.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder() {
    return getDistributeOptions();
  }

  public static final int OPTIMIZATION_OPTIONS_FIELD_NUMBER = 3;
  private org.tensorflow.proto.data.OptimizationOptions optimizationOptions_;
  /**
   * <pre>
   * The optimization options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
   */
  public boolean hasOptimizationOptions() {
    return optimizationOptions_ != null;
  }
  /**
   * <pre>
   * The optimization options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
   */
  public org.tensorflow.proto.data.OptimizationOptions getOptimizationOptions() {
    return optimizationOptions_ == null ? org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance() : optimizationOptions_;
  }
  /**
   * <pre>
   * The optimization options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
   */
  public org.tensorflow.proto.data.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder() {
    return getOptimizationOptions();
  }

  public static final int SLACK_FIELD_NUMBER = 4;
  /**
   * <code>bool slack = 4;</code>
   */
  public boolean getSlack() {
    if (optionalSlackCase_ == 4) {
      return (java.lang.Boolean) optionalSlack_;
    }
    return false;
  }

  public static final int THREADING_OPTIONS_FIELD_NUMBER = 5;
  private org.tensorflow.proto.data.ThreadingOptions threadingOptions_;
  /**
   * <pre>
   * The threading options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
   */
  public boolean hasThreadingOptions() {
    return threadingOptions_ != null;
  }
  /**
   * <pre>
   * The threading options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
   */
  public org.tensorflow.proto.data.ThreadingOptions getThreadingOptions() {
    return threadingOptions_ == null ? org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance() : threadingOptions_;
  }
  /**
   * <pre>
   * The threading options associated with the dataset.
   * </pre>
   *
   * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
   */
  public org.tensorflow.proto.data.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder() {
    return getThreadingOptions();
  }

  public static final int EXTERNAL_STATE_POLICY_FIELD_NUMBER = 6;
  /**
   * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
   */
  public int getExternalStatePolicyValue() {
    if (optionalExternalStatePolicyCase_ == 6) {
      return (java.lang.Integer) optionalExternalStatePolicy_;
    }
    return 0;
  }
  /**
   * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
   */
  public org.tensorflow.proto.data.ExternalStatePolicy getExternalStatePolicy() {
    if (optionalExternalStatePolicyCase_ == 6) {
      @SuppressWarnings("deprecation")
      org.tensorflow.proto.data.ExternalStatePolicy result = org.tensorflow.proto.data.ExternalStatePolicy.valueOf(
          (java.lang.Integer) optionalExternalStatePolicy_);
      return result == null ? org.tensorflow.proto.data.ExternalStatePolicy.UNRECOGNIZED : result;
    }
    return org.tensorflow.proto.data.ExternalStatePolicy.POLICY_WARN;
  }

  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 (optionalDeterministicCase_ == 1) {
      output.writeBool(
          1, (boolean)((java.lang.Boolean) optionalDeterministic_));
    }
    if (distributeOptions_ != null) {
      output.writeMessage(2, getDistributeOptions());
    }
    if (optimizationOptions_ != null) {
      output.writeMessage(3, getOptimizationOptions());
    }
    if (optionalSlackCase_ == 4) {
      output.writeBool(
          4, (boolean)((java.lang.Boolean) optionalSlack_));
    }
    if (threadingOptions_ != null) {
      output.writeMessage(5, getThreadingOptions());
    }
    if (optionalExternalStatePolicyCase_ == 6) {
      output.writeEnum(6, ((java.lang.Integer) optionalExternalStatePolicy_));
    }
    if (autotuneOptions_ != null) {
      output.writeMessage(7, getAutotuneOptions());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (optionalDeterministicCase_ == 1) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(
            1, (boolean)((java.lang.Boolean) optionalDeterministic_));
    }
    if (distributeOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getDistributeOptions());
    }
    if (optimizationOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getOptimizationOptions());
    }
    if (optionalSlackCase_ == 4) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(
            4, (boolean)((java.lang.Boolean) optionalSlack_));
    }
    if (threadingOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getThreadingOptions());
    }
    if (optionalExternalStatePolicyCase_ == 6) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(6, ((java.lang.Integer) optionalExternalStatePolicy_));
    }
    if (autotuneOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, getAutotuneOptions());
    }
    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.data.Options)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.data.Options other = (org.tensorflow.proto.data.Options) obj;

    if (hasAutotuneOptions() != other.hasAutotuneOptions()) return false;
    if (hasAutotuneOptions()) {
      if (!getAutotuneOptions()
          .equals(other.getAutotuneOptions())) return false;
    }
    if (hasDistributeOptions() != other.hasDistributeOptions()) return false;
    if (hasDistributeOptions()) {
      if (!getDistributeOptions()
          .equals(other.getDistributeOptions())) return false;
    }
    if (hasOptimizationOptions() != other.hasOptimizationOptions()) return false;
    if (hasOptimizationOptions()) {
      if (!getOptimizationOptions()
          .equals(other.getOptimizationOptions())) return false;
    }
    if (hasThreadingOptions() != other.hasThreadingOptions()) return false;
    if (hasThreadingOptions()) {
      if (!getThreadingOptions()
          .equals(other.getThreadingOptions())) return false;
    }
    if (!getOptionalDeterministicCase().equals(other.getOptionalDeterministicCase())) return false;
    switch (optionalDeterministicCase_) {
      case 1:
        if (getDeterministic()
            != other.getDeterministic()) return false;
        break;
      case 0:
      default:
    }
    if (!getOptionalSlackCase().equals(other.getOptionalSlackCase())) return false;
    switch (optionalSlackCase_) {
      case 4:
        if (getSlack()
            != other.getSlack()) return false;
        break;
      case 0:
      default:
    }
    if (!getOptionalExternalStatePolicyCase().equals(other.getOptionalExternalStatePolicyCase())) return false;
    switch (optionalExternalStatePolicyCase_) {
      case 6:
        if (getExternalStatePolicyValue()
            != other.getExternalStatePolicyValue()) 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();
    if (hasAutotuneOptions()) {
      hash = (37 * hash) + AUTOTUNE_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getAutotuneOptions().hashCode();
    }
    if (hasDistributeOptions()) {
      hash = (37 * hash) + DISTRIBUTE_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getDistributeOptions().hashCode();
    }
    if (hasOptimizationOptions()) {
      hash = (37 * hash) + OPTIMIZATION_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getOptimizationOptions().hashCode();
    }
    if (hasThreadingOptions()) {
      hash = (37 * hash) + THREADING_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getThreadingOptions().hashCode();
    }
    switch (optionalDeterministicCase_) {
      case 1:
        hash = (37 * hash) + DETERMINISTIC_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
            getDeterministic());
        break;
      case 0:
      default:
    }
    switch (optionalSlackCase_) {
      case 4:
        hash = (37 * hash) + SLACK_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
            getSlack());
        break;
      case 0:
      default:
    }
    switch (optionalExternalStatePolicyCase_) {
      case 6:
        hash = (37 * hash) + EXTERNAL_STATE_POLICY_FIELD_NUMBER;
        hash = (53 * hash) + getExternalStatePolicyValue();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.data.Options parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.data.Options 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.data.Options parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.data.Options 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.data.Options parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.data.Options parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.data.Options parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.data.Options 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.data.Options parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.data.Options 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.data.Options parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.data.Options 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.data.Options 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>
   * Message stored with Dataset objects to control how datasets are processed and
   * optimized.
   * next: 8
   * </pre>
   *
   * Protobuf type {@code tensorflow.data.Options}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.data.Options)
      org.tensorflow.proto.data.OptionsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.data.Options.class, org.tensorflow.proto.data.Options.Builder.class);
    }

    // Construct using org.tensorflow.proto.data.Options.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();
      if (autotuneOptionsBuilder_ == null) {
        autotuneOptions_ = null;
      } else {
        autotuneOptions_ = null;
        autotuneOptionsBuilder_ = null;
      }
      if (distributeOptionsBuilder_ == null) {
        distributeOptions_ = null;
      } else {
        distributeOptions_ = null;
        distributeOptionsBuilder_ = null;
      }
      if (optimizationOptionsBuilder_ == null) {
        optimizationOptions_ = null;
      } else {
        optimizationOptions_ = null;
        optimizationOptionsBuilder_ = null;
      }
      if (threadingOptionsBuilder_ == null) {
        threadingOptions_ = null;
      } else {
        threadingOptions_ = null;
        threadingOptionsBuilder_ = null;
      }
      optionalDeterministicCase_ = 0;
      optionalDeterministic_ = null;
      optionalSlackCase_ = 0;
      optionalSlack_ = null;
      optionalExternalStatePolicyCase_ = 0;
      optionalExternalStatePolicy_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_descriptor;
    }

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

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

    @java.lang.Override
    public org.tensorflow.proto.data.Options buildPartial() {
      org.tensorflow.proto.data.Options result = new org.tensorflow.proto.data.Options(this);
      if (optionalDeterministicCase_ == 1) {
        result.optionalDeterministic_ = optionalDeterministic_;
      }
      if (autotuneOptionsBuilder_ == null) {
        result.autotuneOptions_ = autotuneOptions_;
      } else {
        result.autotuneOptions_ = autotuneOptionsBuilder_.build();
      }
      if (distributeOptionsBuilder_ == null) {
        result.distributeOptions_ = distributeOptions_;
      } else {
        result.distributeOptions_ = distributeOptionsBuilder_.build();
      }
      if (optimizationOptionsBuilder_ == null) {
        result.optimizationOptions_ = optimizationOptions_;
      } else {
        result.optimizationOptions_ = optimizationOptionsBuilder_.build();
      }
      if (optionalSlackCase_ == 4) {
        result.optionalSlack_ = optionalSlack_;
      }
      if (threadingOptionsBuilder_ == null) {
        result.threadingOptions_ = threadingOptions_;
      } else {
        result.threadingOptions_ = threadingOptionsBuilder_.build();
      }
      if (optionalExternalStatePolicyCase_ == 6) {
        result.optionalExternalStatePolicy_ = optionalExternalStatePolicy_;
      }
      result.optionalDeterministicCase_ = optionalDeterministicCase_;
      result.optionalSlackCase_ = optionalSlackCase_;
      result.optionalExternalStatePolicyCase_ = optionalExternalStatePolicyCase_;
      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.data.Options) {
        return mergeFrom((org.tensorflow.proto.data.Options)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.data.Options other) {
      if (other == org.tensorflow.proto.data.Options.getDefaultInstance()) return this;
      if (other.hasAutotuneOptions()) {
        mergeAutotuneOptions(other.getAutotuneOptions());
      }
      if (other.hasDistributeOptions()) {
        mergeDistributeOptions(other.getDistributeOptions());
      }
      if (other.hasOptimizationOptions()) {
        mergeOptimizationOptions(other.getOptimizationOptions());
      }
      if (other.hasThreadingOptions()) {
        mergeThreadingOptions(other.getThreadingOptions());
      }
      switch (other.getOptionalDeterministicCase()) {
        case DETERMINISTIC: {
          setDeterministic(other.getDeterministic());
          break;
        }
        case OPTIONALDETERMINISTIC_NOT_SET: {
          break;
        }
      }
      switch (other.getOptionalSlackCase()) {
        case SLACK: {
          setSlack(other.getSlack());
          break;
        }
        case OPTIONALSLACK_NOT_SET: {
          break;
        }
      }
      switch (other.getOptionalExternalStatePolicyCase()) {
        case EXTERNAL_STATE_POLICY: {
          setExternalStatePolicyValue(other.getExternalStatePolicyValue());
          break;
        }
        case OPTIONALEXTERNALSTATEPOLICY_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.data.Options parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.data.Options) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int optionalDeterministicCase_ = 0;
    private java.lang.Object optionalDeterministic_;
    public OptionalDeterministicCase
        getOptionalDeterministicCase() {
      return OptionalDeterministicCase.forNumber(
          optionalDeterministicCase_);
    }

    public Builder clearOptionalDeterministic() {
      optionalDeterministicCase_ = 0;
      optionalDeterministic_ = null;
      onChanged();
      return this;
    }

    private int optionalSlackCase_ = 0;
    private java.lang.Object optionalSlack_;
    public OptionalSlackCase
        getOptionalSlackCase() {
      return OptionalSlackCase.forNumber(
          optionalSlackCase_);
    }

    public Builder clearOptionalSlack() {
      optionalSlackCase_ = 0;
      optionalSlack_ = null;
      onChanged();
      return this;
    }

    private int optionalExternalStatePolicyCase_ = 0;
    private java.lang.Object optionalExternalStatePolicy_;
    public OptionalExternalStatePolicyCase
        getOptionalExternalStatePolicyCase() {
      return OptionalExternalStatePolicyCase.forNumber(
          optionalExternalStatePolicyCase_);
    }

    public Builder clearOptionalExternalStatePolicy() {
      optionalExternalStatePolicyCase_ = 0;
      optionalExternalStatePolicy_ = null;
      onChanged();
      return this;
    }


    /**
     * <code>bool deterministic = 1;</code>
     */
    public boolean getDeterministic() {
      if (optionalDeterministicCase_ == 1) {
        return (java.lang.Boolean) optionalDeterministic_;
      }
      return false;
    }
    /**
     * <code>bool deterministic = 1;</code>
     */
    public Builder setDeterministic(boolean value) {
      optionalDeterministicCase_ = 1;
      optionalDeterministic_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>bool deterministic = 1;</code>
     */
    public Builder clearDeterministic() {
      if (optionalDeterministicCase_ == 1) {
        optionalDeterministicCase_ = 0;
        optionalDeterministic_ = null;
        onChanged();
      }
      return this;
    }

    private org.tensorflow.proto.data.AutotuneOptions autotuneOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.AutotuneOptions, org.tensorflow.proto.data.AutotuneOptions.Builder, org.tensorflow.proto.data.AutotuneOptionsOrBuilder> autotuneOptionsBuilder_;
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public boolean hasAutotuneOptions() {
      return autotuneOptionsBuilder_ != null || autotuneOptions_ != null;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public org.tensorflow.proto.data.AutotuneOptions getAutotuneOptions() {
      if (autotuneOptionsBuilder_ == null) {
        return autotuneOptions_ == null ? org.tensorflow.proto.data.AutotuneOptions.getDefaultInstance() : autotuneOptions_;
      } else {
        return autotuneOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public Builder setAutotuneOptions(org.tensorflow.proto.data.AutotuneOptions value) {
      if (autotuneOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        autotuneOptions_ = value;
        onChanged();
      } else {
        autotuneOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public Builder setAutotuneOptions(
        org.tensorflow.proto.data.AutotuneOptions.Builder builderForValue) {
      if (autotuneOptionsBuilder_ == null) {
        autotuneOptions_ = builderForValue.build();
        onChanged();
      } else {
        autotuneOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public Builder mergeAutotuneOptions(org.tensorflow.proto.data.AutotuneOptions value) {
      if (autotuneOptionsBuilder_ == null) {
        if (autotuneOptions_ != null) {
          autotuneOptions_ =
            org.tensorflow.proto.data.AutotuneOptions.newBuilder(autotuneOptions_).mergeFrom(value).buildPartial();
        } else {
          autotuneOptions_ = value;
        }
        onChanged();
      } else {
        autotuneOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public Builder clearAutotuneOptions() {
      if (autotuneOptionsBuilder_ == null) {
        autotuneOptions_ = null;
        onChanged();
      } else {
        autotuneOptions_ = null;
        autotuneOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public org.tensorflow.proto.data.AutotuneOptions.Builder getAutotuneOptionsBuilder() {
      
      onChanged();
      return getAutotuneOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    public org.tensorflow.proto.data.AutotuneOptionsOrBuilder getAutotuneOptionsOrBuilder() {
      if (autotuneOptionsBuilder_ != null) {
        return autotuneOptionsBuilder_.getMessageOrBuilder();
      } else {
        return autotuneOptions_ == null ?
            org.tensorflow.proto.data.AutotuneOptions.getDefaultInstance() : autotuneOptions_;
      }
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.AutotuneOptions autotune_options = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.AutotuneOptions, org.tensorflow.proto.data.AutotuneOptions.Builder, org.tensorflow.proto.data.AutotuneOptionsOrBuilder> 
        getAutotuneOptionsFieldBuilder() {
      if (autotuneOptionsBuilder_ == null) {
        autotuneOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.data.AutotuneOptions, org.tensorflow.proto.data.AutotuneOptions.Builder, org.tensorflow.proto.data.AutotuneOptionsOrBuilder>(
                getAutotuneOptions(),
                getParentForChildren(),
                isClean());
        autotuneOptions_ = null;
      }
      return autotuneOptionsBuilder_;
    }

    private org.tensorflow.proto.data.DistributeOptions distributeOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.DistributeOptions, org.tensorflow.proto.data.DistributeOptions.Builder, org.tensorflow.proto.data.DistributeOptionsOrBuilder> distributeOptionsBuilder_;
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public boolean hasDistributeOptions() {
      return distributeOptionsBuilder_ != null || distributeOptions_ != null;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public org.tensorflow.proto.data.DistributeOptions getDistributeOptions() {
      if (distributeOptionsBuilder_ == null) {
        return distributeOptions_ == null ? org.tensorflow.proto.data.DistributeOptions.getDefaultInstance() : distributeOptions_;
      } else {
        return distributeOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public Builder setDistributeOptions(org.tensorflow.proto.data.DistributeOptions value) {
      if (distributeOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        distributeOptions_ = value;
        onChanged();
      } else {
        distributeOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public Builder setDistributeOptions(
        org.tensorflow.proto.data.DistributeOptions.Builder builderForValue) {
      if (distributeOptionsBuilder_ == null) {
        distributeOptions_ = builderForValue.build();
        onChanged();
      } else {
        distributeOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public Builder mergeDistributeOptions(org.tensorflow.proto.data.DistributeOptions value) {
      if (distributeOptionsBuilder_ == null) {
        if (distributeOptions_ != null) {
          distributeOptions_ =
            org.tensorflow.proto.data.DistributeOptions.newBuilder(distributeOptions_).mergeFrom(value).buildPartial();
        } else {
          distributeOptions_ = value;
        }
        onChanged();
      } else {
        distributeOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public Builder clearDistributeOptions() {
      if (distributeOptionsBuilder_ == null) {
        distributeOptions_ = null;
        onChanged();
      } else {
        distributeOptions_ = null;
        distributeOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public org.tensorflow.proto.data.DistributeOptions.Builder getDistributeOptionsBuilder() {
      
      onChanged();
      return getDistributeOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    public org.tensorflow.proto.data.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder() {
      if (distributeOptionsBuilder_ != null) {
        return distributeOptionsBuilder_.getMessageOrBuilder();
      } else {
        return distributeOptions_ == null ?
            org.tensorflow.proto.data.DistributeOptions.getDefaultInstance() : distributeOptions_;
      }
    }
    /**
     * <pre>
     * The distribution strategy options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.DistributeOptions distribute_options = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.DistributeOptions, org.tensorflow.proto.data.DistributeOptions.Builder, org.tensorflow.proto.data.DistributeOptionsOrBuilder> 
        getDistributeOptionsFieldBuilder() {
      if (distributeOptionsBuilder_ == null) {
        distributeOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.data.DistributeOptions, org.tensorflow.proto.data.DistributeOptions.Builder, org.tensorflow.proto.data.DistributeOptionsOrBuilder>(
                getDistributeOptions(),
                getParentForChildren(),
                isClean());
        distributeOptions_ = null;
      }
      return distributeOptionsBuilder_;
    }

    private org.tensorflow.proto.data.OptimizationOptions optimizationOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.OptimizationOptions, org.tensorflow.proto.data.OptimizationOptions.Builder, org.tensorflow.proto.data.OptimizationOptionsOrBuilder> optimizationOptionsBuilder_;
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public boolean hasOptimizationOptions() {
      return optimizationOptionsBuilder_ != null || optimizationOptions_ != null;
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public org.tensorflow.proto.data.OptimizationOptions getOptimizationOptions() {
      if (optimizationOptionsBuilder_ == null) {
        return optimizationOptions_ == null ? org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance() : optimizationOptions_;
      } else {
        return optimizationOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public Builder setOptimizationOptions(org.tensorflow.proto.data.OptimizationOptions value) {
      if (optimizationOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        optimizationOptions_ = value;
        onChanged();
      } else {
        optimizationOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public Builder setOptimizationOptions(
        org.tensorflow.proto.data.OptimizationOptions.Builder builderForValue) {
      if (optimizationOptionsBuilder_ == null) {
        optimizationOptions_ = builderForValue.build();
        onChanged();
      } else {
        optimizationOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public Builder mergeOptimizationOptions(org.tensorflow.proto.data.OptimizationOptions value) {
      if (optimizationOptionsBuilder_ == null) {
        if (optimizationOptions_ != null) {
          optimizationOptions_ =
            org.tensorflow.proto.data.OptimizationOptions.newBuilder(optimizationOptions_).mergeFrom(value).buildPartial();
        } else {
          optimizationOptions_ = value;
        }
        onChanged();
      } else {
        optimizationOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public Builder clearOptimizationOptions() {
      if (optimizationOptionsBuilder_ == null) {
        optimizationOptions_ = null;
        onChanged();
      } else {
        optimizationOptions_ = null;
        optimizationOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public org.tensorflow.proto.data.OptimizationOptions.Builder getOptimizationOptionsBuilder() {
      
      onChanged();
      return getOptimizationOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    public org.tensorflow.proto.data.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder() {
      if (optimizationOptionsBuilder_ != null) {
        return optimizationOptionsBuilder_.getMessageOrBuilder();
      } else {
        return optimizationOptions_ == null ?
            org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance() : optimizationOptions_;
      }
    }
    /**
     * <pre>
     * The optimization options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.OptimizationOptions optimization_options = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.OptimizationOptions, org.tensorflow.proto.data.OptimizationOptions.Builder, org.tensorflow.proto.data.OptimizationOptionsOrBuilder> 
        getOptimizationOptionsFieldBuilder() {
      if (optimizationOptionsBuilder_ == null) {
        optimizationOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.data.OptimizationOptions, org.tensorflow.proto.data.OptimizationOptions.Builder, org.tensorflow.proto.data.OptimizationOptionsOrBuilder>(
                getOptimizationOptions(),
                getParentForChildren(),
                isClean());
        optimizationOptions_ = null;
      }
      return optimizationOptionsBuilder_;
    }

    /**
     * <code>bool slack = 4;</code>
     */
    public boolean getSlack() {
      if (optionalSlackCase_ == 4) {
        return (java.lang.Boolean) optionalSlack_;
      }
      return false;
    }
    /**
     * <code>bool slack = 4;</code>
     */
    public Builder setSlack(boolean value) {
      optionalSlackCase_ = 4;
      optionalSlack_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>bool slack = 4;</code>
     */
    public Builder clearSlack() {
      if (optionalSlackCase_ == 4) {
        optionalSlackCase_ = 0;
        optionalSlack_ = null;
        onChanged();
      }
      return this;
    }

    private org.tensorflow.proto.data.ThreadingOptions threadingOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.ThreadingOptions, org.tensorflow.proto.data.ThreadingOptions.Builder, org.tensorflow.proto.data.ThreadingOptionsOrBuilder> threadingOptionsBuilder_;
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public boolean hasThreadingOptions() {
      return threadingOptionsBuilder_ != null || threadingOptions_ != null;
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public org.tensorflow.proto.data.ThreadingOptions getThreadingOptions() {
      if (threadingOptionsBuilder_ == null) {
        return threadingOptions_ == null ? org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance() : threadingOptions_;
      } else {
        return threadingOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public Builder setThreadingOptions(org.tensorflow.proto.data.ThreadingOptions value) {
      if (threadingOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        threadingOptions_ = value;
        onChanged();
      } else {
        threadingOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public Builder setThreadingOptions(
        org.tensorflow.proto.data.ThreadingOptions.Builder builderForValue) {
      if (threadingOptionsBuilder_ == null) {
        threadingOptions_ = builderForValue.build();
        onChanged();
      } else {
        threadingOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public Builder mergeThreadingOptions(org.tensorflow.proto.data.ThreadingOptions value) {
      if (threadingOptionsBuilder_ == null) {
        if (threadingOptions_ != null) {
          threadingOptions_ =
            org.tensorflow.proto.data.ThreadingOptions.newBuilder(threadingOptions_).mergeFrom(value).buildPartial();
        } else {
          threadingOptions_ = value;
        }
        onChanged();
      } else {
        threadingOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public Builder clearThreadingOptions() {
      if (threadingOptionsBuilder_ == null) {
        threadingOptions_ = null;
        onChanged();
      } else {
        threadingOptions_ = null;
        threadingOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public org.tensorflow.proto.data.ThreadingOptions.Builder getThreadingOptionsBuilder() {
      
      onChanged();
      return getThreadingOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    public org.tensorflow.proto.data.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder() {
      if (threadingOptionsBuilder_ != null) {
        return threadingOptionsBuilder_.getMessageOrBuilder();
      } else {
        return threadingOptions_ == null ?
            org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance() : threadingOptions_;
      }
    }
    /**
     * <pre>
     * The threading options associated with the dataset.
     * </pre>
     *
     * <code>.tensorflow.data.ThreadingOptions threading_options = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.data.ThreadingOptions, org.tensorflow.proto.data.ThreadingOptions.Builder, org.tensorflow.proto.data.ThreadingOptionsOrBuilder> 
        getThreadingOptionsFieldBuilder() {
      if (threadingOptionsBuilder_ == null) {
        threadingOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.data.ThreadingOptions, org.tensorflow.proto.data.ThreadingOptions.Builder, org.tensorflow.proto.data.ThreadingOptionsOrBuilder>(
                getThreadingOptions(),
                getParentForChildren(),
                isClean());
        threadingOptions_ = null;
      }
      return threadingOptionsBuilder_;
    }

    /**
     * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
     */
    public int getExternalStatePolicyValue() {
      if (optionalExternalStatePolicyCase_ == 6) {
        return ((java.lang.Integer) optionalExternalStatePolicy_).intValue();
      }
      return 0;
    }
    /**
     * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
     */
    public Builder setExternalStatePolicyValue(int value) {
      optionalExternalStatePolicyCase_ = 6;
      optionalExternalStatePolicy_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
     */
    public org.tensorflow.proto.data.ExternalStatePolicy getExternalStatePolicy() {
      if (optionalExternalStatePolicyCase_ == 6) {
        @SuppressWarnings("deprecation")
        org.tensorflow.proto.data.ExternalStatePolicy result = org.tensorflow.proto.data.ExternalStatePolicy.valueOf(
            (java.lang.Integer) optionalExternalStatePolicy_);
        return result == null ? org.tensorflow.proto.data.ExternalStatePolicy.UNRECOGNIZED : result;
      }
      return org.tensorflow.proto.data.ExternalStatePolicy.POLICY_WARN;
    }
    /**
     * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
     */
    public Builder setExternalStatePolicy(org.tensorflow.proto.data.ExternalStatePolicy value) {
      if (value == null) {
        throw new NullPointerException();
      }
      optionalExternalStatePolicyCase_ = 6;
      optionalExternalStatePolicy_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <code>.tensorflow.data.ExternalStatePolicy external_state_policy = 6;</code>
     */
    public Builder clearExternalStatePolicy() {
      if (optionalExternalStatePolicyCase_ == 6) {
        optionalExternalStatePolicyCase_ = 0;
        optionalExternalStatePolicy_ = 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.data.Options)
  }

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

  public static org.tensorflow.proto.data.Options getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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

}

