private static LegacyKmsAeadParameters.Variant toVariant(OutputPrefixType outputPrefixType)
      throws GeneralSecurityException {
    switch (outputPrefixType) {
      case TINK:
        return LegacyKmsAeadParameters.Variant.TINK;
      case RAW:
        return LegacyKmsAeadParameters.Variant.NO_PREFIX;
      default:
        throw new GeneralSecurityException(
            "Unable to parse OutputPrefixType: " + outputPrefixType.getNumber());
    }
  }
Serializers and Parsers for LegacyKmsAeadProtoKey and LegacyKmsAeadProtoParameters
java_src/src/main/java/com/google/crypto/tink/aead/LegacyKmsAeadProtoSerialization.java