private static AesEaxParameters.Variant toVariant(OutputPrefixType outputPrefixType)
      throws GeneralSecurityException {
    switch (outputPrefixType) {
      case TINK:
        return AesEaxParameters.Variant.TINK;
        /** Parse LEGACY prefix to CRUNCHY, since they act the same for this type of key */
      case CRUNCHY:
      case LEGACY:
        return AesEaxParameters.Variant.CRUNCHY;
      case RAW:
        return AesEaxParameters.Variant.NO_PREFIX;
      default:
        throw new GeneralSecurityException(
            "Unable to parse OutputPrefixType: " + outputPrefixType.getNumber());
    }
  }
Methods to serialize and parse {@link AesEaxKey} objects and {@link AesEaxParameters} objects
java_src/src/main/java/com/google/crypto/tink/aead/internal/AesEaxProtoSerialization.java