// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/privacy/dlp/v2/dlp.proto

package com.google.privacy.dlp.v2;

/**
 * <pre>
 * The configuration that controls how the data will change.
 * </pre>
 *
 * Protobuf type {@code google.privacy.dlp.v2.DeidentifyConfig}
 */
public  final class DeidentifyConfig extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.DeidentifyConfig)
    DeidentifyConfigOrBuilder {
private static final long serialVersionUID = 0L;
  // Use DeidentifyConfig.newBuilder() to construct.
  private DeidentifyConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private DeidentifyConfig() {
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private DeidentifyConfig(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            com.google.privacy.dlp.v2.InfoTypeTransformations.Builder subBuilder = null;
            if (transformationCase_ == 1) {
              subBuilder = ((com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_).toBuilder();
            }
            transformation_ =
                input.readMessage(com.google.privacy.dlp.v2.InfoTypeTransformations.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_);
              transformation_ = subBuilder.buildPartial();
            }
            transformationCase_ = 1;
            break;
          }
          case 18: {
            com.google.privacy.dlp.v2.RecordTransformations.Builder subBuilder = null;
            if (transformationCase_ == 2) {
              subBuilder = ((com.google.privacy.dlp.v2.RecordTransformations) transformation_).toBuilder();
            }
            transformation_ =
                input.readMessage(com.google.privacy.dlp.v2.RecordTransformations.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.privacy.dlp.v2.RecordTransformations) transformation_);
              transformation_ = subBuilder.buildPartial();
            }
            transformationCase_ = 2;
            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 com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeidentifyConfig_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeidentifyConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.privacy.dlp.v2.DeidentifyConfig.class, com.google.privacy.dlp.v2.DeidentifyConfig.Builder.class);
  }

  private int transformationCase_ = 0;
  private java.lang.Object transformation_;
  public enum TransformationCase
      implements com.google.protobuf.Internal.EnumLite {
    INFO_TYPE_TRANSFORMATIONS(1),
    RECORD_TRANSFORMATIONS(2),
    TRANSFORMATION_NOT_SET(0);
    private final int value;
    private TransformationCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TransformationCase valueOf(int value) {
      return forNumber(value);
    }

    public static TransformationCase forNumber(int value) {
      switch (value) {
        case 1: return INFO_TYPE_TRANSFORMATIONS;
        case 2: return RECORD_TRANSFORMATIONS;
        case 0: return TRANSFORMATION_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public TransformationCase
  getTransformationCase() {
    return TransformationCase.forNumber(
        transformationCase_);
  }

  public static final int INFO_TYPE_TRANSFORMATIONS_FIELD_NUMBER = 1;
  /**
   * <pre>
   * Treat the dataset as free-form text and apply the same free text
   * transformation everywhere.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
   */
  public boolean hasInfoTypeTransformations() {
    return transformationCase_ == 1;
  }
  /**
   * <pre>
   * Treat the dataset as free-form text and apply the same free text
   * transformation everywhere.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
   */
  public com.google.privacy.dlp.v2.InfoTypeTransformations getInfoTypeTransformations() {
    if (transformationCase_ == 1) {
       return (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_;
    }
    return com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance();
  }
  /**
   * <pre>
   * Treat the dataset as free-form text and apply the same free text
   * transformation everywhere.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
   */
  public com.google.privacy.dlp.v2.InfoTypeTransformationsOrBuilder getInfoTypeTransformationsOrBuilder() {
    if (transformationCase_ == 1) {
       return (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_;
    }
    return com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance();
  }

  public static final int RECORD_TRANSFORMATIONS_FIELD_NUMBER = 2;
  /**
   * <pre>
   * Treat the dataset as structured. Transformations can be applied to
   * specific locations within structured datasets, such as transforming
   * a column within a table.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
   */
  public boolean hasRecordTransformations() {
    return transformationCase_ == 2;
  }
  /**
   * <pre>
   * Treat the dataset as structured. Transformations can be applied to
   * specific locations within structured datasets, such as transforming
   * a column within a table.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
   */
  public com.google.privacy.dlp.v2.RecordTransformations getRecordTransformations() {
    if (transformationCase_ == 2) {
       return (com.google.privacy.dlp.v2.RecordTransformations) transformation_;
    }
    return com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance();
  }
  /**
   * <pre>
   * Treat the dataset as structured. Transformations can be applied to
   * specific locations within structured datasets, such as transforming
   * a column within a table.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
   */
  public com.google.privacy.dlp.v2.RecordTransformationsOrBuilder getRecordTransformationsOrBuilder() {
    if (transformationCase_ == 2) {
       return (com.google.privacy.dlp.v2.RecordTransformations) transformation_;
    }
    return com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (transformationCase_ == 1) {
      output.writeMessage(1, (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_);
    }
    if (transformationCase_ == 2) {
      output.writeMessage(2, (com.google.privacy.dlp.v2.RecordTransformations) transformation_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (transformationCase_ == 1) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_);
    }
    if (transformationCase_ == 2) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, (com.google.privacy.dlp.v2.RecordTransformations) transformation_);
    }
    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 com.google.privacy.dlp.v2.DeidentifyConfig)) {
      return super.equals(obj);
    }
    com.google.privacy.dlp.v2.DeidentifyConfig other = (com.google.privacy.dlp.v2.DeidentifyConfig) obj;

    boolean result = true;
    result = result && getTransformationCase().equals(
        other.getTransformationCase());
    if (!result) return false;
    switch (transformationCase_) {
      case 1:
        result = result && getInfoTypeTransformations()
            .equals(other.getInfoTypeTransformations());
        break;
      case 2:
        result = result && getRecordTransformations()
            .equals(other.getRecordTransformations());
        break;
      case 0:
      default:
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    switch (transformationCase_) {
      case 1:
        hash = (37 * hash) + INFO_TYPE_TRANSFORMATIONS_FIELD_NUMBER;
        hash = (53 * hash) + getInfoTypeTransformations().hashCode();
        break;
      case 2:
        hash = (37 * hash) + RECORD_TRANSFORMATIONS_FIELD_NUMBER;
        hash = (53 * hash) + getRecordTransformations().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.privacy.dlp.v2.DeidentifyConfig prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * The configuration that controls how the data will change.
   * </pre>
   *
   * Protobuf type {@code google.privacy.dlp.v2.DeidentifyConfig}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.DeidentifyConfig)
      com.google.privacy.dlp.v2.DeidentifyConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeidentifyConfig_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeidentifyConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.privacy.dlp.v2.DeidentifyConfig.class, com.google.privacy.dlp.v2.DeidentifyConfig.Builder.class);
    }

    // Construct using com.google.privacy.dlp.v2.DeidentifyConfig.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      transformationCase_ = 0;
      transformation_ = null;
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeidentifyConfig_descriptor;
    }

    public com.google.privacy.dlp.v2.DeidentifyConfig getDefaultInstanceForType() {
      return com.google.privacy.dlp.v2.DeidentifyConfig.getDefaultInstance();
    }

    public com.google.privacy.dlp.v2.DeidentifyConfig build() {
      com.google.privacy.dlp.v2.DeidentifyConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.privacy.dlp.v2.DeidentifyConfig buildPartial() {
      com.google.privacy.dlp.v2.DeidentifyConfig result = new com.google.privacy.dlp.v2.DeidentifyConfig(this);
      if (transformationCase_ == 1) {
        if (infoTypeTransformationsBuilder_ == null) {
          result.transformation_ = transformation_;
        } else {
          result.transformation_ = infoTypeTransformationsBuilder_.build();
        }
      }
      if (transformationCase_ == 2) {
        if (recordTransformationsBuilder_ == null) {
          result.transformation_ = transformation_;
        } else {
          result.transformation_ = recordTransformationsBuilder_.build();
        }
      }
      result.transformationCase_ = transformationCase_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.privacy.dlp.v2.DeidentifyConfig) {
        return mergeFrom((com.google.privacy.dlp.v2.DeidentifyConfig)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.privacy.dlp.v2.DeidentifyConfig other) {
      if (other == com.google.privacy.dlp.v2.DeidentifyConfig.getDefaultInstance()) return this;
      switch (other.getTransformationCase()) {
        case INFO_TYPE_TRANSFORMATIONS: {
          mergeInfoTypeTransformations(other.getInfoTypeTransformations());
          break;
        }
        case RECORD_TRANSFORMATIONS: {
          mergeRecordTransformations(other.getRecordTransformations());
          break;
        }
        case TRANSFORMATION_NOT_SET: {
          break;
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.privacy.dlp.v2.DeidentifyConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.privacy.dlp.v2.DeidentifyConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int transformationCase_ = 0;
    private java.lang.Object transformation_;
    public TransformationCase
        getTransformationCase() {
      return TransformationCase.forNumber(
          transformationCase_);
    }

    public Builder clearTransformation() {
      transformationCase_ = 0;
      transformation_ = null;
      onChanged();
      return this;
    }


    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2.InfoTypeTransformations, com.google.privacy.dlp.v2.InfoTypeTransformations.Builder, com.google.privacy.dlp.v2.InfoTypeTransformationsOrBuilder> infoTypeTransformationsBuilder_;
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public boolean hasInfoTypeTransformations() {
      return transformationCase_ == 1;
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public com.google.privacy.dlp.v2.InfoTypeTransformations getInfoTypeTransformations() {
      if (infoTypeTransformationsBuilder_ == null) {
        if (transformationCase_ == 1) {
          return (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_;
        }
        return com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance();
      } else {
        if (transformationCase_ == 1) {
          return infoTypeTransformationsBuilder_.getMessage();
        }
        return com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public Builder setInfoTypeTransformations(com.google.privacy.dlp.v2.InfoTypeTransformations value) {
      if (infoTypeTransformationsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        transformation_ = value;
        onChanged();
      } else {
        infoTypeTransformationsBuilder_.setMessage(value);
      }
      transformationCase_ = 1;
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public Builder setInfoTypeTransformations(
        com.google.privacy.dlp.v2.InfoTypeTransformations.Builder builderForValue) {
      if (infoTypeTransformationsBuilder_ == null) {
        transformation_ = builderForValue.build();
        onChanged();
      } else {
        infoTypeTransformationsBuilder_.setMessage(builderForValue.build());
      }
      transformationCase_ = 1;
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public Builder mergeInfoTypeTransformations(com.google.privacy.dlp.v2.InfoTypeTransformations value) {
      if (infoTypeTransformationsBuilder_ == null) {
        if (transformationCase_ == 1 &&
            transformation_ != com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance()) {
          transformation_ = com.google.privacy.dlp.v2.InfoTypeTransformations.newBuilder((com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_)
              .mergeFrom(value).buildPartial();
        } else {
          transformation_ = value;
        }
        onChanged();
      } else {
        if (transformationCase_ == 1) {
          infoTypeTransformationsBuilder_.mergeFrom(value);
        }
        infoTypeTransformationsBuilder_.setMessage(value);
      }
      transformationCase_ = 1;
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public Builder clearInfoTypeTransformations() {
      if (infoTypeTransformationsBuilder_ == null) {
        if (transformationCase_ == 1) {
          transformationCase_ = 0;
          transformation_ = null;
          onChanged();
        }
      } else {
        if (transformationCase_ == 1) {
          transformationCase_ = 0;
          transformation_ = null;
        }
        infoTypeTransformationsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public com.google.privacy.dlp.v2.InfoTypeTransformations.Builder getInfoTypeTransformationsBuilder() {
      return getInfoTypeTransformationsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    public com.google.privacy.dlp.v2.InfoTypeTransformationsOrBuilder getInfoTypeTransformationsOrBuilder() {
      if ((transformationCase_ == 1) && (infoTypeTransformationsBuilder_ != null)) {
        return infoTypeTransformationsBuilder_.getMessageOrBuilder();
      } else {
        if (transformationCase_ == 1) {
          return (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_;
        }
        return com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * Treat the dataset as free-form text and apply the same free text
     * transformation everywhere.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoTypeTransformations info_type_transformations = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2.InfoTypeTransformations, com.google.privacy.dlp.v2.InfoTypeTransformations.Builder, com.google.privacy.dlp.v2.InfoTypeTransformationsOrBuilder> 
        getInfoTypeTransformationsFieldBuilder() {
      if (infoTypeTransformationsBuilder_ == null) {
        if (!(transformationCase_ == 1)) {
          transformation_ = com.google.privacy.dlp.v2.InfoTypeTransformations.getDefaultInstance();
        }
        infoTypeTransformationsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.InfoTypeTransformations, com.google.privacy.dlp.v2.InfoTypeTransformations.Builder, com.google.privacy.dlp.v2.InfoTypeTransformationsOrBuilder>(
                (com.google.privacy.dlp.v2.InfoTypeTransformations) transformation_,
                getParentForChildren(),
                isClean());
        transformation_ = null;
      }
      transformationCase_ = 1;
      onChanged();;
      return infoTypeTransformationsBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2.RecordTransformations, com.google.privacy.dlp.v2.RecordTransformations.Builder, com.google.privacy.dlp.v2.RecordTransformationsOrBuilder> recordTransformationsBuilder_;
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public boolean hasRecordTransformations() {
      return transformationCase_ == 2;
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public com.google.privacy.dlp.v2.RecordTransformations getRecordTransformations() {
      if (recordTransformationsBuilder_ == null) {
        if (transformationCase_ == 2) {
          return (com.google.privacy.dlp.v2.RecordTransformations) transformation_;
        }
        return com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance();
      } else {
        if (transformationCase_ == 2) {
          return recordTransformationsBuilder_.getMessage();
        }
        return com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public Builder setRecordTransformations(com.google.privacy.dlp.v2.RecordTransformations value) {
      if (recordTransformationsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        transformation_ = value;
        onChanged();
      } else {
        recordTransformationsBuilder_.setMessage(value);
      }
      transformationCase_ = 2;
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public Builder setRecordTransformations(
        com.google.privacy.dlp.v2.RecordTransformations.Builder builderForValue) {
      if (recordTransformationsBuilder_ == null) {
        transformation_ = builderForValue.build();
        onChanged();
      } else {
        recordTransformationsBuilder_.setMessage(builderForValue.build());
      }
      transformationCase_ = 2;
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public Builder mergeRecordTransformations(com.google.privacy.dlp.v2.RecordTransformations value) {
      if (recordTransformationsBuilder_ == null) {
        if (transformationCase_ == 2 &&
            transformation_ != com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance()) {
          transformation_ = com.google.privacy.dlp.v2.RecordTransformations.newBuilder((com.google.privacy.dlp.v2.RecordTransformations) transformation_)
              .mergeFrom(value).buildPartial();
        } else {
          transformation_ = value;
        }
        onChanged();
      } else {
        if (transformationCase_ == 2) {
          recordTransformationsBuilder_.mergeFrom(value);
        }
        recordTransformationsBuilder_.setMessage(value);
      }
      transformationCase_ = 2;
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public Builder clearRecordTransformations() {
      if (recordTransformationsBuilder_ == null) {
        if (transformationCase_ == 2) {
          transformationCase_ = 0;
          transformation_ = null;
          onChanged();
        }
      } else {
        if (transformationCase_ == 2) {
          transformationCase_ = 0;
          transformation_ = null;
        }
        recordTransformationsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public com.google.privacy.dlp.v2.RecordTransformations.Builder getRecordTransformationsBuilder() {
      return getRecordTransformationsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    public com.google.privacy.dlp.v2.RecordTransformationsOrBuilder getRecordTransformationsOrBuilder() {
      if ((transformationCase_ == 2) && (recordTransformationsBuilder_ != null)) {
        return recordTransformationsBuilder_.getMessageOrBuilder();
      } else {
        if (transformationCase_ == 2) {
          return (com.google.privacy.dlp.v2.RecordTransformations) transformation_;
        }
        return com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * Treat the dataset as structured. Transformations can be applied to
     * specific locations within structured datasets, such as transforming
     * a column within a table.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.RecordTransformations record_transformations = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2.RecordTransformations, com.google.privacy.dlp.v2.RecordTransformations.Builder, com.google.privacy.dlp.v2.RecordTransformationsOrBuilder> 
        getRecordTransformationsFieldBuilder() {
      if (recordTransformationsBuilder_ == null) {
        if (!(transformationCase_ == 2)) {
          transformation_ = com.google.privacy.dlp.v2.RecordTransformations.getDefaultInstance();
        }
        recordTransformationsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.RecordTransformations, com.google.privacy.dlp.v2.RecordTransformations.Builder, com.google.privacy.dlp.v2.RecordTransformationsOrBuilder>(
                (com.google.privacy.dlp.v2.RecordTransformations) transformation_,
                getParentForChildren(),
                isClean());
        transformation_ = null;
      }
      transformationCase_ = 2;
      onChanged();;
      return recordTransformationsBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.DeidentifyConfig)
  }

  // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeidentifyConfig)
  private static final com.google.privacy.dlp.v2.DeidentifyConfig DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.DeidentifyConfig();
  }

  public static com.google.privacy.dlp.v2.DeidentifyConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.privacy.dlp.v2.DeidentifyConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

