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

package com.google.privacy.dlp.v2beta1;

/**
 * <pre>
 * Replaces an identifier with a surrogate using FPE with the FFX
 * mode of operation.
 * The identifier must be representable by the US-ASCII character set.
 * For a given crypto key and context, the same identifier will be
 * replaced with the same surrogate.
 * Identifiers must be at least two characters long.
 * In the case that the identifier is the empty string, it will be skipped.
 * </pre>
 *
 * Protobuf type {@code google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig}
 */
public  final class CryptoReplaceFfxFpeConfig extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig)
    CryptoReplaceFfxFpeConfigOrBuilder {
private static final long serialVersionUID = 0L;
  // Use CryptoReplaceFfxFpeConfig.newBuilder() to construct.
  private CryptoReplaceFfxFpeConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private CryptoReplaceFfxFpeConfig() {
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private CryptoReplaceFfxFpeConfig(
      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.v2beta1.CryptoKey.Builder subBuilder = null;
            if (cryptoKey_ != null) {
              subBuilder = cryptoKey_.toBuilder();
            }
            cryptoKey_ = input.readMessage(com.google.privacy.dlp.v2beta1.CryptoKey.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(cryptoKey_);
              cryptoKey_ = subBuilder.buildPartial();
            }

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

            break;
          }
          case 32: {
            int rawValue = input.readEnum();
            alphabetCase_ = 4;
            alphabet_ = rawValue;
            break;
          }
          case 42: {
            java.lang.String s = input.readStringRequireUtf8();
            alphabetCase_ = 5;
            alphabet_ = s;
            break;
          }
          case 48: {
            alphabetCase_ = 6;
            alphabet_ = input.readInt32();
            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.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_CryptoReplaceFfxFpeConfig_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_CryptoReplaceFfxFpeConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.class, com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.Builder.class);
  }

  /**
   * <pre>
   * These are commonly used subsets of the alphabet that the FFX mode
   * natively supports. In the algorithm, the alphabet is selected using
   * the "radix". Therefore each corresponds to particular radix.
   * </pre>
   *
   * Protobuf enum {@code google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet}
   */
  public enum FfxCommonNativeAlphabet
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;</code>
     */
    FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED(0),
    /**
     * <pre>
     * [0-9] (radix of 10)
     * </pre>
     *
     * <code>NUMERIC = 1;</code>
     */
    NUMERIC(1),
    /**
     * <pre>
     * [0-9A-F] (radix of 16)
     * </pre>
     *
     * <code>HEXADECIMAL = 2;</code>
     */
    HEXADECIMAL(2),
    /**
     * <pre>
     * [0-9A-Z] (radix of 36)
     * </pre>
     *
     * <code>UPPER_CASE_ALPHA_NUMERIC = 3;</code>
     */
    UPPER_CASE_ALPHA_NUMERIC(3),
    /**
     * <pre>
     * [0-9A-Za-z] (radix of 62)
     * </pre>
     *
     * <code>ALPHA_NUMERIC = 4;</code>
     */
    ALPHA_NUMERIC(4),
    UNRECOGNIZED(-1),
    ;

    /**
     * <code>FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;</code>
     */
    public static final int FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * [0-9] (radix of 10)
     * </pre>
     *
     * <code>NUMERIC = 1;</code>
     */
    public static final int NUMERIC_VALUE = 1;
    /**
     * <pre>
     * [0-9A-F] (radix of 16)
     * </pre>
     *
     * <code>HEXADECIMAL = 2;</code>
     */
    public static final int HEXADECIMAL_VALUE = 2;
    /**
     * <pre>
     * [0-9A-Z] (radix of 36)
     * </pre>
     *
     * <code>UPPER_CASE_ALPHA_NUMERIC = 3;</code>
     */
    public static final int UPPER_CASE_ALPHA_NUMERIC_VALUE = 3;
    /**
     * <pre>
     * [0-9A-Za-z] (radix of 62)
     * </pre>
     *
     * <code>ALPHA_NUMERIC = 4;</code>
     */
    public static final int ALPHA_NUMERIC_VALUE = 4;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static FfxCommonNativeAlphabet valueOf(int value) {
      return forNumber(value);
    }

    public static FfxCommonNativeAlphabet forNumber(int value) {
      switch (value) {
        case 0: return FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED;
        case 1: return NUMERIC;
        case 2: return HEXADECIMAL;
        case 3: return UPPER_CASE_ALPHA_NUMERIC;
        case 4: return ALPHA_NUMERIC;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<FfxCommonNativeAlphabet>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        FfxCommonNativeAlphabet> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<FfxCommonNativeAlphabet>() {
            public FfxCommonNativeAlphabet findValueByNumber(int number) {
              return FfxCommonNativeAlphabet.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.getDescriptor().getEnumTypes().get(0);
    }

    private static final FfxCommonNativeAlphabet[] VALUES = values();

    public static FfxCommonNativeAlphabet valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private FfxCommonNativeAlphabet(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet)
  }

  private int alphabetCase_ = 0;
  private java.lang.Object alphabet_;
  public enum AlphabetCase
      implements com.google.protobuf.Internal.EnumLite {
    COMMON_ALPHABET(4),
    CUSTOM_ALPHABET(5),
    RADIX(6),
    ALPHABET_NOT_SET(0);
    private final int value;
    private AlphabetCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static AlphabetCase valueOf(int value) {
      return forNumber(value);
    }

    public static AlphabetCase forNumber(int value) {
      switch (value) {
        case 4: return COMMON_ALPHABET;
        case 5: return CUSTOM_ALPHABET;
        case 6: return RADIX;
        case 0: return ALPHABET_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public AlphabetCase
  getAlphabetCase() {
    return AlphabetCase.forNumber(
        alphabetCase_);
  }

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

  public static final int CONTEXT_FIELD_NUMBER = 2;
  private com.google.privacy.dlp.v2beta1.FieldId context_;
  /**
   * <pre>
   * A context may be used for higher security since the same
   * identifier in two different contexts likely will be given a distinct
   * surrogate. The principle is that the likeliness is inversely related
   * to the ratio of the number of distinct identifiers per context over the
   * number of possible surrogates: As long as this ratio is small, the
   * likehood is large.
   * If the context is not set, a default tweak will be used.
   * If the context is set but:
   * 1. there is no record present when transforming a given value or
   * 1. the field is not present when transforming a given value,
   * a default tweak will be used.
   * Note that case (1) is expected when an `InfoTypeTransformation` is
   * applied to both structured and non-structured `ContentItem`s.
   * Currently, the referenced field may be of value type integer or string.
   * The tweak is constructed as a sequence of bytes in big endian byte order
   * such that:
   * - a 64 bit integer is encoded followed by a single byte of value 1
   * - a string is encoded in UTF-8 format followed by a single byte of value 2
   * This is also known as the 'tweak', as in tweakable encryption.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
   */
  public boolean hasContext() {
    return context_ != null;
  }
  /**
   * <pre>
   * A context may be used for higher security since the same
   * identifier in two different contexts likely will be given a distinct
   * surrogate. The principle is that the likeliness is inversely related
   * to the ratio of the number of distinct identifiers per context over the
   * number of possible surrogates: As long as this ratio is small, the
   * likehood is large.
   * If the context is not set, a default tweak will be used.
   * If the context is set but:
   * 1. there is no record present when transforming a given value or
   * 1. the field is not present when transforming a given value,
   * a default tweak will be used.
   * Note that case (1) is expected when an `InfoTypeTransformation` is
   * applied to both structured and non-structured `ContentItem`s.
   * Currently, the referenced field may be of value type integer or string.
   * The tweak is constructed as a sequence of bytes in big endian byte order
   * such that:
   * - a 64 bit integer is encoded followed by a single byte of value 1
   * - a string is encoded in UTF-8 format followed by a single byte of value 2
   * This is also known as the 'tweak', as in tweakable encryption.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
   */
  public com.google.privacy.dlp.v2beta1.FieldId getContext() {
    return context_ == null ? com.google.privacy.dlp.v2beta1.FieldId.getDefaultInstance() : context_;
  }
  /**
   * <pre>
   * A context may be used for higher security since the same
   * identifier in two different contexts likely will be given a distinct
   * surrogate. The principle is that the likeliness is inversely related
   * to the ratio of the number of distinct identifiers per context over the
   * number of possible surrogates: As long as this ratio is small, the
   * likehood is large.
   * If the context is not set, a default tweak will be used.
   * If the context is set but:
   * 1. there is no record present when transforming a given value or
   * 1. the field is not present when transforming a given value,
   * a default tweak will be used.
   * Note that case (1) is expected when an `InfoTypeTransformation` is
   * applied to both structured and non-structured `ContentItem`s.
   * Currently, the referenced field may be of value type integer or string.
   * The tweak is constructed as a sequence of bytes in big endian byte order
   * such that:
   * - a 64 bit integer is encoded followed by a single byte of value 1
   * - a string is encoded in UTF-8 format followed by a single byte of value 2
   * This is also known as the 'tweak', as in tweakable encryption.
   * </pre>
   *
   * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
   */
  public com.google.privacy.dlp.v2beta1.FieldIdOrBuilder getContextOrBuilder() {
    return getContext();
  }

  public static final int COMMON_ALPHABET_FIELD_NUMBER = 4;
  /**
   * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
   */
  public int getCommonAlphabetValue() {
    if (alphabetCase_ == 4) {
      return (java.lang.Integer) alphabet_;
    }
    return 0;
  }
  /**
   * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
   */
  public com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet getCommonAlphabet() {
    if (alphabetCase_ == 4) {
      com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet result = com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet.valueOf(
          (java.lang.Integer) alphabet_);
      return result == null ? com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet.UNRECOGNIZED : result;
    }
    return com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet.FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED;
  }

  public static final int CUSTOM_ALPHABET_FIELD_NUMBER = 5;
  /**
   * <pre>
   * This is supported by mapping these to the alphanumeric characters
   * that the FFX mode natively supports. This happens before/after
   * encryption/decryption.
   * Each character listed must appear only once.
   * Number of characters must be in the range [2, 62].
   * This must be encoded as ASCII.
   * The order of characters does not matter.
   * </pre>
   *
   * <code>string custom_alphabet = 5;</code>
   */
  public java.lang.String getCustomAlphabet() {
    java.lang.Object ref = "";
    if (alphabetCase_ == 5) {
      ref = alphabet_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (alphabetCase_ == 5) {
        alphabet_ = s;
      }
      return s;
    }
  }
  /**
   * <pre>
   * This is supported by mapping these to the alphanumeric characters
   * that the FFX mode natively supports. This happens before/after
   * encryption/decryption.
   * Each character listed must appear only once.
   * Number of characters must be in the range [2, 62].
   * This must be encoded as ASCII.
   * The order of characters does not matter.
   * </pre>
   *
   * <code>string custom_alphabet = 5;</code>
   */
  public com.google.protobuf.ByteString
      getCustomAlphabetBytes() {
    java.lang.Object ref = "";
    if (alphabetCase_ == 5) {
      ref = alphabet_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      if (alphabetCase_ == 5) {
        alphabet_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int RADIX_FIELD_NUMBER = 6;
  /**
   * <pre>
   * The native way to select the alphabet. Must be in the range [2, 62].
   * </pre>
   *
   * <code>int32 radix = 6;</code>
   */
  public int getRadix() {
    if (alphabetCase_ == 6) {
      return (java.lang.Integer) alphabet_;
    }
    return 0;
  }

  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 (cryptoKey_ != null) {
      output.writeMessage(1, getCryptoKey());
    }
    if (context_ != null) {
      output.writeMessage(2, getContext());
    }
    if (alphabetCase_ == 4) {
      output.writeEnum(4, ((java.lang.Integer) alphabet_));
    }
    if (alphabetCase_ == 5) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, alphabet_);
    }
    if (alphabetCase_ == 6) {
      output.writeInt32(
          6, (int)((java.lang.Integer) alphabet_));
    }
    unknownFields.writeTo(output);
  }

  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 (context_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getContext());
    }
    if (alphabetCase_ == 4) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(4, ((java.lang.Integer) alphabet_));
    }
    if (alphabetCase_ == 5) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, alphabet_);
    }
    if (alphabetCase_ == 6) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(
            6, (int)((java.lang.Integer) alphabet_));
    }
    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.v2beta1.CryptoReplaceFfxFpeConfig)) {
      return super.equals(obj);
    }
    com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig other = (com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig) obj;

    boolean result = true;
    result = result && (hasCryptoKey() == other.hasCryptoKey());
    if (hasCryptoKey()) {
      result = result && getCryptoKey()
          .equals(other.getCryptoKey());
    }
    result = result && (hasContext() == other.hasContext());
    if (hasContext()) {
      result = result && getContext()
          .equals(other.getContext());
    }
    result = result && getAlphabetCase().equals(
        other.getAlphabetCase());
    if (!result) return false;
    switch (alphabetCase_) {
      case 4:
        result = result && getCommonAlphabetValue()
            == other.getCommonAlphabetValue();
        break;
      case 5:
        result = result && getCustomAlphabet()
            .equals(other.getCustomAlphabet());
        break;
      case 6:
        result = result && (getRadix()
            == other.getRadix());
        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();
    if (hasCryptoKey()) {
      hash = (37 * hash) + CRYPTO_KEY_FIELD_NUMBER;
      hash = (53 * hash) + getCryptoKey().hashCode();
    }
    if (hasContext()) {
      hash = (37 * hash) + CONTEXT_FIELD_NUMBER;
      hash = (53 * hash) + getContext().hashCode();
    }
    switch (alphabetCase_) {
      case 4:
        hash = (37 * hash) + COMMON_ALPHABET_FIELD_NUMBER;
        hash = (53 * hash) + getCommonAlphabetValue();
        break;
      case 5:
        hash = (37 * hash) + CUSTOM_ALPHABET_FIELD_NUMBER;
        hash = (53 * hash) + getCustomAlphabet().hashCode();
        break;
      case 6:
        hash = (37 * hash) + RADIX_FIELD_NUMBER;
        hash = (53 * hash) + getRadix();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig 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.v2beta1.CryptoReplaceFfxFpeConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig 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.v2beta1.CryptoReplaceFfxFpeConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig 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.v2beta1.CryptoReplaceFfxFpeConfig parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig 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.v2beta1.CryptoReplaceFfxFpeConfig parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig 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.v2beta1.CryptoReplaceFfxFpeConfig 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>
   * Replaces an identifier with a surrogate using FPE with the FFX
   * mode of operation.
   * The identifier must be representable by the US-ASCII character set.
   * For a given crypto key and context, the same identifier will be
   * replaced with the same surrogate.
   * Identifiers must be at least two characters long.
   * In the case that the identifier is the empty string, it will be skipped.
   * </pre>
   *
   * Protobuf type {@code google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig)
      com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_CryptoReplaceFfxFpeConfig_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_CryptoReplaceFfxFpeConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.class, com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.Builder.class);
    }

    // Construct using com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.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();
      if (cryptoKeyBuilder_ == null) {
        cryptoKey_ = null;
      } else {
        cryptoKey_ = null;
        cryptoKeyBuilder_ = null;
      }
      if (contextBuilder_ == null) {
        context_ = null;
      } else {
        context_ = null;
        contextBuilder_ = null;
      }
      alphabetCase_ = 0;
      alphabet_ = null;
      return this;
    }

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

    public com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig getDefaultInstanceForType() {
      return com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.getDefaultInstance();
    }

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

    public com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig buildPartial() {
      com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig result = new com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig(this);
      if (cryptoKeyBuilder_ == null) {
        result.cryptoKey_ = cryptoKey_;
      } else {
        result.cryptoKey_ = cryptoKeyBuilder_.build();
      }
      if (contextBuilder_ == null) {
        result.context_ = context_;
      } else {
        result.context_ = contextBuilder_.build();
      }
      if (alphabetCase_ == 4) {
        result.alphabet_ = alphabet_;
      }
      if (alphabetCase_ == 5) {
        result.alphabet_ = alphabet_;
      }
      if (alphabetCase_ == 6) {
        result.alphabet_ = alphabet_;
      }
      result.alphabetCase_ = alphabetCase_;
      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.v2beta1.CryptoReplaceFfxFpeConfig) {
        return mergeFrom((com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig other) {
      if (other == com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.getDefaultInstance()) return this;
      if (other.hasCryptoKey()) {
        mergeCryptoKey(other.getCryptoKey());
      }
      if (other.hasContext()) {
        mergeContext(other.getContext());
      }
      switch (other.getAlphabetCase()) {
        case COMMON_ALPHABET: {
          setCommonAlphabetValue(other.getCommonAlphabetValue());
          break;
        }
        case CUSTOM_ALPHABET: {
          alphabetCase_ = 5;
          alphabet_ = other.alphabet_;
          onChanged();
          break;
        }
        case RADIX: {
          setRadix(other.getRadix());
          break;
        }
        case ALPHABET_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.v2beta1.CryptoReplaceFfxFpeConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int alphabetCase_ = 0;
    private java.lang.Object alphabet_;
    public AlphabetCase
        getAlphabetCase() {
      return AlphabetCase.forNumber(
          alphabetCase_);
    }

    public Builder clearAlphabet() {
      alphabetCase_ = 0;
      alphabet_ = null;
      onChanged();
      return this;
    }


    private com.google.privacy.dlp.v2beta1.CryptoKey cryptoKey_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2beta1.CryptoKey, com.google.privacy.dlp.v2beta1.CryptoKey.Builder, com.google.privacy.dlp.v2beta1.CryptoKeyOrBuilder> cryptoKeyBuilder_;
    /**
     * <pre>
     * The key used by the encryption algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    public boolean hasCryptoKey() {
      return cryptoKeyBuilder_ != null || cryptoKey_ != null;
    }
    /**
     * <pre>
     * The key used by the encryption algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    public com.google.privacy.dlp.v2beta1.CryptoKey getCryptoKey() {
      if (cryptoKeyBuilder_ == null) {
        return cryptoKey_ == null ? com.google.privacy.dlp.v2beta1.CryptoKey.getDefaultInstance() : cryptoKey_;
      } else {
        return cryptoKeyBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The key used by the encryption algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    public Builder setCryptoKey(com.google.privacy.dlp.v2beta1.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 algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    public Builder setCryptoKey(
        com.google.privacy.dlp.v2beta1.CryptoKey.Builder builderForValue) {
      if (cryptoKeyBuilder_ == null) {
        cryptoKey_ = builderForValue.build();
        onChanged();
      } else {
        cryptoKeyBuilder_.setMessage(builderForValue.build());
      }

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

      return this;
    }
    /**
     * <pre>
     * The key used by the encryption algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.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 algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    public com.google.privacy.dlp.v2beta1.CryptoKey.Builder getCryptoKeyBuilder() {
      
      onChanged();
      return getCryptoKeyFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The key used by the encryption algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    public com.google.privacy.dlp.v2beta1.CryptoKeyOrBuilder getCryptoKeyOrBuilder() {
      if (cryptoKeyBuilder_ != null) {
        return cryptoKeyBuilder_.getMessageOrBuilder();
      } else {
        return cryptoKey_ == null ?
            com.google.privacy.dlp.v2beta1.CryptoKey.getDefaultInstance() : cryptoKey_;
      }
    }
    /**
     * <pre>
     * The key used by the encryption algorithm. [required]
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.CryptoKey crypto_key = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2beta1.CryptoKey, com.google.privacy.dlp.v2beta1.CryptoKey.Builder, com.google.privacy.dlp.v2beta1.CryptoKeyOrBuilder> 
        getCryptoKeyFieldBuilder() {
      if (cryptoKeyBuilder_ == null) {
        cryptoKeyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2beta1.CryptoKey, com.google.privacy.dlp.v2beta1.CryptoKey.Builder, com.google.privacy.dlp.v2beta1.CryptoKeyOrBuilder>(
                getCryptoKey(),
                getParentForChildren(),
                isClean());
        cryptoKey_ = null;
      }
      return cryptoKeyBuilder_;
    }

    private com.google.privacy.dlp.v2beta1.FieldId context_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2beta1.FieldId, com.google.privacy.dlp.v2beta1.FieldId.Builder, com.google.privacy.dlp.v2beta1.FieldIdOrBuilder> contextBuilder_;
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public boolean hasContext() {
      return contextBuilder_ != null || context_ != null;
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public com.google.privacy.dlp.v2beta1.FieldId getContext() {
      if (contextBuilder_ == null) {
        return context_ == null ? com.google.privacy.dlp.v2beta1.FieldId.getDefaultInstance() : context_;
      } else {
        return contextBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public Builder setContext(com.google.privacy.dlp.v2beta1.FieldId value) {
      if (contextBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        context_ = value;
        onChanged();
      } else {
        contextBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public Builder setContext(
        com.google.privacy.dlp.v2beta1.FieldId.Builder builderForValue) {
      if (contextBuilder_ == null) {
        context_ = builderForValue.build();
        onChanged();
      } else {
        contextBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public Builder mergeContext(com.google.privacy.dlp.v2beta1.FieldId value) {
      if (contextBuilder_ == null) {
        if (context_ != null) {
          context_ =
            com.google.privacy.dlp.v2beta1.FieldId.newBuilder(context_).mergeFrom(value).buildPartial();
        } else {
          context_ = value;
        }
        onChanged();
      } else {
        contextBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public Builder clearContext() {
      if (contextBuilder_ == null) {
        context_ = null;
        onChanged();
      } else {
        context_ = null;
        contextBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public com.google.privacy.dlp.v2beta1.FieldId.Builder getContextBuilder() {
      
      onChanged();
      return getContextFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    public com.google.privacy.dlp.v2beta1.FieldIdOrBuilder getContextOrBuilder() {
      if (contextBuilder_ != null) {
        return contextBuilder_.getMessageOrBuilder();
      } else {
        return context_ == null ?
            com.google.privacy.dlp.v2beta1.FieldId.getDefaultInstance() : context_;
      }
    }
    /**
     * <pre>
     * A context may be used for higher security since the same
     * identifier in two different contexts likely will be given a distinct
     * surrogate. The principle is that the likeliness is inversely related
     * to the ratio of the number of distinct identifiers per context over the
     * number of possible surrogates: As long as this ratio is small, the
     * likehood is large.
     * If the context is not set, a default tweak will be used.
     * If the context is set but:
     * 1. there is no record present when transforming a given value or
     * 1. the field is not present when transforming a given value,
     * a default tweak will be used.
     * Note that case (1) is expected when an `InfoTypeTransformation` is
     * applied to both structured and non-structured `ContentItem`s.
     * Currently, the referenced field may be of value type integer or string.
     * The tweak is constructed as a sequence of bytes in big endian byte order
     * such that:
     * - a 64 bit integer is encoded followed by a single byte of value 1
     * - a string is encoded in UTF-8 format followed by a single byte of value 2
     * This is also known as the 'tweak', as in tweakable encryption.
     * </pre>
     *
     * <code>.google.privacy.dlp.v2beta1.FieldId context = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.privacy.dlp.v2beta1.FieldId, com.google.privacy.dlp.v2beta1.FieldId.Builder, com.google.privacy.dlp.v2beta1.FieldIdOrBuilder> 
        getContextFieldBuilder() {
      if (contextBuilder_ == null) {
        contextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.privacy.dlp.v2beta1.FieldId, com.google.privacy.dlp.v2beta1.FieldId.Builder, com.google.privacy.dlp.v2beta1.FieldIdOrBuilder>(
                getContext(),
                getParentForChildren(),
                isClean());
        context_ = null;
      }
      return contextBuilder_;
    }

    /**
     * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
     */
    public int getCommonAlphabetValue() {
      if (alphabetCase_ == 4) {
        return ((java.lang.Integer) alphabet_).intValue();
      }
      return 0;
    }
    /**
     * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
     */
    public Builder setCommonAlphabetValue(int value) {
      alphabetCase_ = 4;
      alphabet_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
     */
    public com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet getCommonAlphabet() {
      if (alphabetCase_ == 4) {
        com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet result = com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet.valueOf(
            (java.lang.Integer) alphabet_);
        return result == null ? com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet.UNRECOGNIZED : result;
      }
      return com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet.FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED;
    }
    /**
     * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
     */
    public Builder setCommonAlphabet(com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet value) {
      if (value == null) {
        throw new NullPointerException();
      }
      alphabetCase_ = 4;
      alphabet_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <code>.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabet common_alphabet = 4;</code>
     */
    public Builder clearCommonAlphabet() {
      if (alphabetCase_ == 4) {
        alphabetCase_ = 0;
        alphabet_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * This is supported by mapping these to the alphanumeric characters
     * that the FFX mode natively supports. This happens before/after
     * encryption/decryption.
     * Each character listed must appear only once.
     * Number of characters must be in the range [2, 62].
     * This must be encoded as ASCII.
     * The order of characters does not matter.
     * </pre>
     *
     * <code>string custom_alphabet = 5;</code>
     */
    public java.lang.String getCustomAlphabet() {
      java.lang.Object ref = "";
      if (alphabetCase_ == 5) {
        ref = alphabet_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (alphabetCase_ == 5) {
          alphabet_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * This is supported by mapping these to the alphanumeric characters
     * that the FFX mode natively supports. This happens before/after
     * encryption/decryption.
     * Each character listed must appear only once.
     * Number of characters must be in the range [2, 62].
     * This must be encoded as ASCII.
     * The order of characters does not matter.
     * </pre>
     *
     * <code>string custom_alphabet = 5;</code>
     */
    public com.google.protobuf.ByteString
        getCustomAlphabetBytes() {
      java.lang.Object ref = "";
      if (alphabetCase_ == 5) {
        ref = alphabet_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        if (alphabetCase_ == 5) {
          alphabet_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * This is supported by mapping these to the alphanumeric characters
     * that the FFX mode natively supports. This happens before/after
     * encryption/decryption.
     * Each character listed must appear only once.
     * Number of characters must be in the range [2, 62].
     * This must be encoded as ASCII.
     * The order of characters does not matter.
     * </pre>
     *
     * <code>string custom_alphabet = 5;</code>
     */
    public Builder setCustomAlphabet(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  alphabetCase_ = 5;
      alphabet_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * This is supported by mapping these to the alphanumeric characters
     * that the FFX mode natively supports. This happens before/after
     * encryption/decryption.
     * Each character listed must appear only once.
     * Number of characters must be in the range [2, 62].
     * This must be encoded as ASCII.
     * The order of characters does not matter.
     * </pre>
     *
     * <code>string custom_alphabet = 5;</code>
     */
    public Builder clearCustomAlphabet() {
      if (alphabetCase_ == 5) {
        alphabetCase_ = 0;
        alphabet_ = null;
        onChanged();
      }
      return this;
    }
    /**
     * <pre>
     * This is supported by mapping these to the alphanumeric characters
     * that the FFX mode natively supports. This happens before/after
     * encryption/decryption.
     * Each character listed must appear only once.
     * Number of characters must be in the range [2, 62].
     * This must be encoded as ASCII.
     * The order of characters does not matter.
     * </pre>
     *
     * <code>string custom_alphabet = 5;</code>
     */
    public Builder setCustomAlphabetBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      alphabetCase_ = 5;
      alphabet_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * The native way to select the alphabet. Must be in the range [2, 62].
     * </pre>
     *
     * <code>int32 radix = 6;</code>
     */
    public int getRadix() {
      if (alphabetCase_ == 6) {
        return (java.lang.Integer) alphabet_;
      }
      return 0;
    }
    /**
     * <pre>
     * The native way to select the alphabet. Must be in the range [2, 62].
     * </pre>
     *
     * <code>int32 radix = 6;</code>
     */
    public Builder setRadix(int value) {
      alphabetCase_ = 6;
      alphabet_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The native way to select the alphabet. Must be in the range [2, 62].
     * </pre>
     *
     * <code>int32 radix = 6;</code>
     */
    public Builder clearRadix() {
      if (alphabetCase_ == 6) {
        alphabetCase_ = 0;
        alphabet_ = null;
        onChanged();
      }
      return this;
    }
    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.v2beta1.CryptoReplaceFfxFpeConfig)
  }

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

  public static com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

