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

package com.google.privacy.dlp.v2;

/**
 *
 *
 * <pre>
 * Pseudonymization method that generates deterministic encryption for the given
 * input. Outputs a base64 encoded representation of the encrypted output.
 * Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
 * </pre>
 *
 * Protobuf type {@code google.privacy.dlp.v2.CryptoDeterministicConfig}
 */
public final class CryptoDeterministicConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.CryptoDeterministicConfig)
    CryptoDeterministicConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use CryptoDeterministicConfig.newBuilder() to construct.
  private CryptoDeterministicConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private CryptoDeterministicConfig() {}

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private CryptoDeterministicConfig(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              com.google.privacy.dlp.v2.CryptoKey.Builder subBuilder = null;
              if (cryptoKey_ != null) {
                subBuilder = cryptoKey_.toBuilder();
              }
              cryptoKey_ =
                  input.readMessage(
                      com.google.privacy.dlp.v2.CryptoKey.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(cryptoKey_);
                cryptoKey_ = subBuilder.buildPartial();
              }

              break;
            }
          case 18:
            {
              com.google.privacy.dlp.v2.InfoType.Builder subBuilder = null;
              if (surrogateInfoType_ != null) {
                subBuilder = surrogateInfoType_.toBuilder();
              }
              surrogateInfoType_ =
                  input.readMessage(com.google.privacy.dlp.v2.InfoType.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(surrogateInfoType_);
                surrogateInfoType_ = subBuilder.buildPartial();
              }

              break;
            }
          case 26:
            {
              com.google.privacy.dlp.v2.FieldId.Builder subBuilder = null;
              if (context_ != null) {
                subBuilder = context_.toBuilder();
              }
              context_ =
                  input.readMessage(com.google.privacy.dlp.v2.FieldId.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(context_);
                context_ = 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 com.google.privacy.dlp.v2.DlpProto
        .internal_static_google_privacy_dlp_v2_CryptoDeterministicConfig_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.privacy.dlp.v2.DlpProto
        .internal_static_google_privacy_dlp_v2_CryptoDeterministicConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.privacy.dlp.v2.CryptoDeterministicConfig.class,
            com.google.privacy.dlp.v2.CryptoDeterministicConfig.Builder.class);
  }

  public static final int CRYPTO_KEY_FIELD_NUMBER = 1;
  private com.google.privacy.dlp.v2.CryptoKey cryptoKey_;
  /**
   *
   *
   * <pre>
   * The key used by the encryption function.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
   */
  public boolean hasCryptoKey() {
    return cryptoKey_ != null;
  }
  /**
   *
   *
   * <pre>
   * The key used by the encryption function.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
   */
  public com.google.privacy.dlp.v2.CryptoKey getCryptoKey() {
    return cryptoKey_ == null
        ? com.google.privacy.dlp.v2.CryptoKey.getDefaultInstance()
        : cryptoKey_;
  }
  /**
   *
   *
   * <pre>
   * The key used by the encryption function.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
   */
  public com.google.privacy.dlp.v2.CryptoKeyOrBuilder getCryptoKeyOrBuilder() {
    return getCryptoKey();
  }

  public static final int SURROGATE_INFO_TYPE_FIELD_NUMBER = 2;
  private com.google.privacy.dlp.v2.InfoType surrogateInfoType_;
  /**
   *
   *
   * <pre>
   * The custom info type to annotate the surrogate with.
   * This annotation will be applied to the surrogate by prefixing it with
   * the name of the custom info type followed by the number of
   * characters comprising the surrogate. The following scheme defines the
   * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
   * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
   * the surrogate is 'abc', the full replacement value
   * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
   * This annotation identifies the surrogate when inspecting content using the
   * custom info type 'Surrogate'. This facilitates reversal of the
   * surrogate when it occurs in free text.
   * In order for inspection to work properly, the name of this info type must
   * not occur naturally anywhere in your data; otherwise, inspection may either
   * - reverse a surrogate that does not correspond to an actual identifier
   * - be unable to parse the surrogate and result in an error
   * Therefore, choose your custom info type name carefully after considering
   * what your data looks like. One way to select a name that has a high chance
   * of yielding reliable detection is to include one or more unicode characters
   * that are highly improbable to exist in your data.
   * For example, assuming your data is entered from a regular ASCII keyboard,
   * the symbol with the hex code point 29DD might be used like so:
   * ⧝MY_TOKEN_TYPE
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
   */
  public boolean hasSurrogateInfoType() {
    return surrogateInfoType_ != null;
  }
  /**
   *
   *
   * <pre>
   * The custom info type to annotate the surrogate with.
   * This annotation will be applied to the surrogate by prefixing it with
   * the name of the custom info type followed by the number of
   * characters comprising the surrogate. The following scheme defines the
   * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
   * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
   * the surrogate is 'abc', the full replacement value
   * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
   * This annotation identifies the surrogate when inspecting content using the
   * custom info type 'Surrogate'. This facilitates reversal of the
   * surrogate when it occurs in free text.
   * In order for inspection to work properly, the name of this info type must
   * not occur naturally anywhere in your data; otherwise, inspection may either
   * - reverse a surrogate that does not correspond to an actual identifier
   * - be unable to parse the surrogate and result in an error
   * Therefore, choose your custom info type name carefully after considering
   * what your data looks like. One way to select a name that has a high chance
   * of yielding reliable detection is to include one or more unicode characters
   * that are highly improbable to exist in your data.
   * For example, assuming your data is entered from a regular ASCII keyboard,
   * the symbol with the hex code point 29DD might be used like so:
   * ⧝MY_TOKEN_TYPE
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
   */
  public com.google.privacy.dlp.v2.InfoType getSurrogateInfoType() {
    return surrogateInfoType_ == null
        ? com.google.privacy.dlp.v2.InfoType.getDefaultInstance()
        : surrogateInfoType_;
  }
  /**
   *
   *
   * <pre>
   * The custom info type to annotate the surrogate with.
   * This annotation will be applied to the surrogate by prefixing it with
   * the name of the custom info type followed by the number of
   * characters comprising the surrogate. The following scheme defines the
   * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
   * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
   * the surrogate is 'abc', the full replacement value
   * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
   * This annotation identifies the surrogate when inspecting content using the
   * custom info type 'Surrogate'. This facilitates reversal of the
   * surrogate when it occurs in free text.
   * In order for inspection to work properly, the name of this info type must
   * not occur naturally anywhere in your data; otherwise, inspection may either
   * - reverse a surrogate that does not correspond to an actual identifier
   * - be unable to parse the surrogate and result in an error
   * Therefore, choose your custom info type name carefully after considering
   * what your data looks like. One way to select a name that has a high chance
   * of yielding reliable detection is to include one or more unicode characters
   * that are highly improbable to exist in your data.
   * For example, assuming your data is entered from a regular ASCII keyboard,
   * the symbol with the hex code point 29DD might be used like so:
   * ⧝MY_TOKEN_TYPE
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
   */
  public com.google.privacy.dlp.v2.InfoTypeOrBuilder getSurrogateInfoTypeOrBuilder() {
    return getSurrogateInfoType();
  }

  public static final int CONTEXT_FIELD_NUMBER = 3;
  private com.google.privacy.dlp.v2.FieldId context_;
  /**
   *
   *
   * <pre>
   * Optional. A context may be used for higher security and maintaining
   * referential integrity such that the same identifier in two different
   * contexts will be given a distinct surrogate. The context is appended to
   * plaintext value being encrypted. On decryption the provided context is
   * validated against the value used during encryption. If a context was
   * provided during encryption, same context must be provided during decryption
   * as well.
   * If the context is not set, plaintext would be used as is for encryption.
   * If the context is set but:
   * 1. there is no record present when transforming a given value or
   * 2. the field is not present when transforming a given value,
   * plaintext would be used as is for encryption.
   * Note that case (1) is expected when an `InfoTypeTransformation` is
   * applied to both structured and non-structured `ContentItem`s.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
   */
  public boolean hasContext() {
    return context_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. A context may be used for higher security and maintaining
   * referential integrity such that the same identifier in two different
   * contexts will be given a distinct surrogate. The context is appended to
   * plaintext value being encrypted. On decryption the provided context is
   * validated against the value used during encryption. If a context was
   * provided during encryption, same context must be provided during decryption
   * as well.
   * If the context is not set, plaintext would be used as is for encryption.
   * If the context is set but:
   * 1. there is no record present when transforming a given value or
   * 2. the field is not present when transforming a given value,
   * plaintext would be used as is for encryption.
   * Note that case (1) is expected when an `InfoTypeTransformation` is
   * applied to both structured and non-structured `ContentItem`s.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
   */
  public com.google.privacy.dlp.v2.FieldId getContext() {
    return context_ == null ? com.google.privacy.dlp.v2.FieldId.getDefaultInstance() : context_;
  }
  /**
   *
   *
   * <pre>
   * Optional. A context may be used for higher security and maintaining
   * referential integrity such that the same identifier in two different
   * contexts will be given a distinct surrogate. The context is appended to
   * plaintext value being encrypted. On decryption the provided context is
   * validated against the value used during encryption. If a context was
   * provided during encryption, same context must be provided during decryption
   * as well.
   * If the context is not set, plaintext would be used as is for encryption.
   * If the context is set but:
   * 1. there is no record present when transforming a given value or
   * 2. the field is not present when transforming a given value,
   * plaintext would be used as is for encryption.
   * Note that case (1) is expected when an `InfoTypeTransformation` is
   * applied to both structured and non-structured `ContentItem`s.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
   */
  public com.google.privacy.dlp.v2.FieldIdOrBuilder getContextOrBuilder() {
    return getContext();
  }

  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 (cryptoKey_ != null) {
      output.writeMessage(1, getCryptoKey());
    }
    if (surrogateInfoType_ != null) {
      output.writeMessage(2, getSurrogateInfoType());
    }
    if (context_ != null) {
      output.writeMessage(3, getContext());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (cryptoKey_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCryptoKey());
    }
    if (surrogateInfoType_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSurrogateInfoType());
    }
    if (context_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getContext());
    }
    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.CryptoDeterministicConfig)) {
      return super.equals(obj);
    }
    com.google.privacy.dlp.v2.CryptoDeterministicConfig other =
        (com.google.privacy.dlp.v2.CryptoDeterministicConfig) obj;

    if (hasCryptoKey() != other.hasCryptoKey()) return false;
    if (hasCryptoKey()) {
      if (!getCryptoKey().equals(other.getCryptoKey())) return false;
    }
    if (hasSurrogateInfoType() != other.hasSurrogateInfoType()) return false;
    if (hasSurrogateInfoType()) {
      if (!getSurrogateInfoType().equals(other.getSurrogateInfoType())) return false;
    }
    if (hasContext() != other.hasContext()) return false;
    if (hasContext()) {
      if (!getContext().equals(other.getContext())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasCryptoKey()) {
      hash = (37 * hash) + CRYPTO_KEY_FIELD_NUMBER;
      hash = (53 * hash) + getCryptoKey().hashCode();
    }
    if (hasSurrogateInfoType()) {
      hash = (37 * hash) + SURROGATE_INFO_TYPE_FIELD_NUMBER;
      hash = (53 * hash) + getSurrogateInfoType().hashCode();
    }
    if (hasContext()) {
      hash = (37 * hash) + CONTEXT_FIELD_NUMBER;
      hash = (53 * hash) + getContext().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.privacy.dlp.v2.CryptoDeterministicConfig parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.privacy.dlp.v2.CryptoDeterministicConfig 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.CryptoDeterministicConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.privacy.dlp.v2.CryptoDeterministicConfig 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.CryptoDeterministicConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.privacy.dlp.v2.CryptoDeterministicConfig 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.CryptoDeterministicConfig parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.privacy.dlp.v2.CryptoDeterministicConfig 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.CryptoDeterministicConfig parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.privacy.dlp.v2.CryptoDeterministicConfig 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.CryptoDeterministicConfig 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.CryptoDeterministicConfig 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(com.google.privacy.dlp.v2.CryptoDeterministicConfig 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>
   * Pseudonymization method that generates deterministic encryption for the given
   * input. Outputs a base64 encoded representation of the encrypted output.
   * Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
   * </pre>
   *
   * Protobuf type {@code google.privacy.dlp.v2.CryptoDeterministicConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.CryptoDeterministicConfig)
      com.google.privacy.dlp.v2.CryptoDeterministicConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.privacy.dlp.v2.DlpProto
          .internal_static_google_privacy_dlp_v2_CryptoDeterministicConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.privacy.dlp.v2.DlpProto
          .internal_static_google_privacy_dlp_v2_CryptoDeterministicConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.privacy.dlp.v2.CryptoDeterministicConfig.class,
              com.google.privacy.dlp.v2.CryptoDeterministicConfig.Builder.class);
    }

    // Construct using com.google.privacy.dlp.v2.CryptoDeterministicConfig.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 (cryptoKeyBuilder_ == null) {
        cryptoKey_ = null;
      } else {
        cryptoKey_ = null;
        cryptoKeyBuilder_ = null;
      }
      if (surrogateInfoTypeBuilder_ == null) {
        surrogateInfoType_ = null;
      } else {
        surrogateInfoType_ = null;
        surrogateInfoTypeBuilder_ = null;
      }
      if (contextBuilder_ == null) {
        context_ = null;
      } else {
        context_ = null;
        contextBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.privacy.dlp.v2.DlpProto
          .internal_static_google_privacy_dlp_v2_CryptoDeterministicConfig_descriptor;
    }

    @java.lang.Override
    public com.google.privacy.dlp.v2.CryptoDeterministicConfig getDefaultInstanceForType() {
      return com.google.privacy.dlp.v2.CryptoDeterministicConfig.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.privacy.dlp.v2.CryptoDeterministicConfig build() {
      com.google.privacy.dlp.v2.CryptoDeterministicConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.privacy.dlp.v2.CryptoDeterministicConfig buildPartial() {
      com.google.privacy.dlp.v2.CryptoDeterministicConfig result =
          new com.google.privacy.dlp.v2.CryptoDeterministicConfig(this);
      if (cryptoKeyBuilder_ == null) {
        result.cryptoKey_ = cryptoKey_;
      } else {
        result.cryptoKey_ = cryptoKeyBuilder_.build();
      }
      if (surrogateInfoTypeBuilder_ == null) {
        result.surrogateInfoType_ = surrogateInfoType_;
      } else {
        result.surrogateInfoType_ = surrogateInfoTypeBuilder_.build();
      }
      if (contextBuilder_ == null) {
        result.context_ = context_;
      } else {
        result.context_ = contextBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.privacy.dlp.v2.CryptoDeterministicConfig) {
        return mergeFrom((com.google.privacy.dlp.v2.CryptoDeterministicConfig) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.privacy.dlp.v2.CryptoDeterministicConfig other) {
      if (other == com.google.privacy.dlp.v2.CryptoDeterministicConfig.getDefaultInstance())
        return this;
      if (other.hasCryptoKey()) {
        mergeCryptoKey(other.getCryptoKey());
      }
      if (other.hasSurrogateInfoType()) {
        mergeSurrogateInfoType(other.getSurrogateInfoType());
      }
      if (other.hasContext()) {
        mergeContext(other.getContext());
      }
      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 {
      com.google.privacy.dlp.v2.CryptoDeterministicConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.privacy.dlp.v2.CryptoDeterministicConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.privacy.dlp.v2.CryptoKey cryptoKey_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.CryptoKey,
            com.google.privacy.dlp.v2.CryptoKey.Builder,
            com.google.privacy.dlp.v2.CryptoKeyOrBuilder>
        cryptoKeyBuilder_;
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public boolean hasCryptoKey() {
      return cryptoKeyBuilder_ != null || cryptoKey_ != null;
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public com.google.privacy.dlp.v2.CryptoKey getCryptoKey() {
      if (cryptoKeyBuilder_ == null) {
        return cryptoKey_ == null
            ? com.google.privacy.dlp.v2.CryptoKey.getDefaultInstance()
            : cryptoKey_;
      } else {
        return cryptoKeyBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public Builder setCryptoKey(com.google.privacy.dlp.v2.CryptoKey value) {
      if (cryptoKeyBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cryptoKey_ = value;
        onChanged();
      } else {
        cryptoKeyBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public Builder setCryptoKey(com.google.privacy.dlp.v2.CryptoKey.Builder builderForValue) {
      if (cryptoKeyBuilder_ == null) {
        cryptoKey_ = builderForValue.build();
        onChanged();
      } else {
        cryptoKeyBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public Builder mergeCryptoKey(com.google.privacy.dlp.v2.CryptoKey value) {
      if (cryptoKeyBuilder_ == null) {
        if (cryptoKey_ != null) {
          cryptoKey_ =
              com.google.privacy.dlp.v2.CryptoKey.newBuilder(cryptoKey_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          cryptoKey_ = value;
        }
        onChanged();
      } else {
        cryptoKeyBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public Builder clearCryptoKey() {
      if (cryptoKeyBuilder_ == null) {
        cryptoKey_ = null;
        onChanged();
      } else {
        cryptoKey_ = null;
        cryptoKeyBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public com.google.privacy.dlp.v2.CryptoKey.Builder getCryptoKeyBuilder() {

      onChanged();
      return getCryptoKeyFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    public com.google.privacy.dlp.v2.CryptoKeyOrBuilder getCryptoKeyOrBuilder() {
      if (cryptoKeyBuilder_ != null) {
        return cryptoKeyBuilder_.getMessageOrBuilder();
      } else {
        return cryptoKey_ == null
            ? com.google.privacy.dlp.v2.CryptoKey.getDefaultInstance()
            : cryptoKey_;
      }
    }
    /**
     *
     *
     * <pre>
     * The key used by the encryption function.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.CryptoKey crypto_key = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.CryptoKey,
            com.google.privacy.dlp.v2.CryptoKey.Builder,
            com.google.privacy.dlp.v2.CryptoKeyOrBuilder>
        getCryptoKeyFieldBuilder() {
      if (cryptoKeyBuilder_ == null) {
        cryptoKeyBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.privacy.dlp.v2.CryptoKey,
                com.google.privacy.dlp.v2.CryptoKey.Builder,
                com.google.privacy.dlp.v2.CryptoKeyOrBuilder>(
                getCryptoKey(), getParentForChildren(), isClean());
        cryptoKey_ = null;
      }
      return cryptoKeyBuilder_;
    }

    private com.google.privacy.dlp.v2.InfoType surrogateInfoType_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.InfoType,
            com.google.privacy.dlp.v2.InfoType.Builder,
            com.google.privacy.dlp.v2.InfoTypeOrBuilder>
        surrogateInfoTypeBuilder_;
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public boolean hasSurrogateInfoType() {
      return surrogateInfoTypeBuilder_ != null || surrogateInfoType_ != null;
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public com.google.privacy.dlp.v2.InfoType getSurrogateInfoType() {
      if (surrogateInfoTypeBuilder_ == null) {
        return surrogateInfoType_ == null
            ? com.google.privacy.dlp.v2.InfoType.getDefaultInstance()
            : surrogateInfoType_;
      } else {
        return surrogateInfoTypeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public Builder setSurrogateInfoType(com.google.privacy.dlp.v2.InfoType value) {
      if (surrogateInfoTypeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        surrogateInfoType_ = value;
        onChanged();
      } else {
        surrogateInfoTypeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public Builder setSurrogateInfoType(
        com.google.privacy.dlp.v2.InfoType.Builder builderForValue) {
      if (surrogateInfoTypeBuilder_ == null) {
        surrogateInfoType_ = builderForValue.build();
        onChanged();
      } else {
        surrogateInfoTypeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public Builder mergeSurrogateInfoType(com.google.privacy.dlp.v2.InfoType value) {
      if (surrogateInfoTypeBuilder_ == null) {
        if (surrogateInfoType_ != null) {
          surrogateInfoType_ =
              com.google.privacy.dlp.v2.InfoType.newBuilder(surrogateInfoType_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          surrogateInfoType_ = value;
        }
        onChanged();
      } else {
        surrogateInfoTypeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public Builder clearSurrogateInfoType() {
      if (surrogateInfoTypeBuilder_ == null) {
        surrogateInfoType_ = null;
        onChanged();
      } else {
        surrogateInfoType_ = null;
        surrogateInfoTypeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public com.google.privacy.dlp.v2.InfoType.Builder getSurrogateInfoTypeBuilder() {

      onChanged();
      return getSurrogateInfoTypeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    public com.google.privacy.dlp.v2.InfoTypeOrBuilder getSurrogateInfoTypeOrBuilder() {
      if (surrogateInfoTypeBuilder_ != null) {
        return surrogateInfoTypeBuilder_.getMessageOrBuilder();
      } else {
        return surrogateInfoType_ == null
            ? com.google.privacy.dlp.v2.InfoType.getDefaultInstance()
            : surrogateInfoType_;
      }
    }
    /**
     *
     *
     * <pre>
     * The custom info type to annotate the surrogate with.
     * This annotation will be applied to the surrogate by prefixing it with
     * the name of the custom info type followed by the number of
     * characters comprising the surrogate. The following scheme defines the
     * format: &lt;info type name&gt;(&lt;surrogate character count&gt;):&lt;surrogate&gt;
     * For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
     * the surrogate is 'abc', the full replacement value
     * will be: 'MY_TOKEN_INFO_TYPE(3):abc'
     * This annotation identifies the surrogate when inspecting content using the
     * custom info type 'Surrogate'. This facilitates reversal of the
     * surrogate when it occurs in free text.
     * In order for inspection to work properly, the name of this info type must
     * not occur naturally anywhere in your data; otherwise, inspection may either
     * - reverse a surrogate that does not correspond to an actual identifier
     * - be unable to parse the surrogate and result in an error
     * Therefore, choose your custom info type name carefully after considering
     * what your data looks like. One way to select a name that has a high chance
     * of yielding reliable detection is to include one or more unicode characters
     * that are highly improbable to exist in your data.
     * For example, assuming your data is entered from a regular ASCII keyboard,
     * the symbol with the hex code point 29DD might be used like so:
     * ⧝MY_TOKEN_TYPE
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.InfoType surrogate_info_type = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.InfoType,
            com.google.privacy.dlp.v2.InfoType.Builder,
            com.google.privacy.dlp.v2.InfoTypeOrBuilder>
        getSurrogateInfoTypeFieldBuilder() {
      if (surrogateInfoTypeBuilder_ == null) {
        surrogateInfoTypeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.privacy.dlp.v2.InfoType,
                com.google.privacy.dlp.v2.InfoType.Builder,
                com.google.privacy.dlp.v2.InfoTypeOrBuilder>(
                getSurrogateInfoType(), getParentForChildren(), isClean());
        surrogateInfoType_ = null;
      }
      return surrogateInfoTypeBuilder_;
    }

    private com.google.privacy.dlp.v2.FieldId context_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.FieldId,
            com.google.privacy.dlp.v2.FieldId.Builder,
            com.google.privacy.dlp.v2.FieldIdOrBuilder>
        contextBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public boolean hasContext() {
      return contextBuilder_ != null || context_ != null;
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public com.google.privacy.dlp.v2.FieldId getContext() {
      if (contextBuilder_ == null) {
        return context_ == null ? com.google.privacy.dlp.v2.FieldId.getDefaultInstance() : context_;
      } else {
        return contextBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public Builder setContext(com.google.privacy.dlp.v2.FieldId value) {
      if (contextBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        context_ = value;
        onChanged();
      } else {
        contextBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public Builder setContext(com.google.privacy.dlp.v2.FieldId.Builder builderForValue) {
      if (contextBuilder_ == null) {
        context_ = builderForValue.build();
        onChanged();
      } else {
        contextBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public Builder mergeContext(com.google.privacy.dlp.v2.FieldId value) {
      if (contextBuilder_ == null) {
        if (context_ != null) {
          context_ =
              com.google.privacy.dlp.v2.FieldId.newBuilder(context_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          context_ = value;
        }
        onChanged();
      } else {
        contextBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public Builder clearContext() {
      if (contextBuilder_ == null) {
        context_ = null;
        onChanged();
      } else {
        context_ = null;
        contextBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public com.google.privacy.dlp.v2.FieldId.Builder getContextBuilder() {

      onChanged();
      return getContextFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    public com.google.privacy.dlp.v2.FieldIdOrBuilder getContextOrBuilder() {
      if (contextBuilder_ != null) {
        return contextBuilder_.getMessageOrBuilder();
      } else {
        return context_ == null ? com.google.privacy.dlp.v2.FieldId.getDefaultInstance() : context_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A context may be used for higher security and maintaining
     * referential integrity such that the same identifier in two different
     * contexts will be given a distinct surrogate. The context is appended to
     * plaintext value being encrypted. On decryption the provided context is
     * validated against the value used during encryption. If a context was
     * provided during encryption, same context must be provided during decryption
     * as well.
     * If the context is not set, plaintext would be used as is for encryption.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 2. the field is not present when transforming a given value,
     * plaintext would be used as is for encryption.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2.FieldId context = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2.FieldId,
            com.google.privacy.dlp.v2.FieldId.Builder,
            com.google.privacy.dlp.v2.FieldIdOrBuilder>
        getContextFieldBuilder() {
      if (contextBuilder_ == null) {
        contextBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.privacy.dlp.v2.FieldId,
                com.google.privacy.dlp.v2.FieldId.Builder,
                com.google.privacy.dlp.v2.FieldIdOrBuilder>(
                getContext(), getParentForChildren(), isClean());
        context_ = null;
      }
      return contextBuilder_;
    }

    @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:google.privacy.dlp.v2.CryptoDeterministicConfig)
  }

  // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CryptoDeterministicConfig)
  private static final com.google.privacy.dlp.v2.CryptoDeterministicConfig DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.CryptoDeterministicConfig();
  }

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

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

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

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

  @java.lang.Override
  public com.google.privacy.dlp.v2.CryptoDeterministicConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
