resolutionAndFormattingErrors;
+ bool dataModelError;
+ bool formattingError;
+ bool missingSelectorAnnotationError;
+ bool selectorError;
+ bool syntaxError;
+ bool unknownFunctionError;
+ bool unresolvedVariableError;
+ Errors(UErrorCode& errorCode);
+
+ public:
+ static Errors* create(UErrorCode&);
+
+ int32_t count() const;
+ void setSelectorError(const FunctionName&, UErrorCode&);
+ void setReservedError(UErrorCode&);
+ void setMissingSelectorAnnotation(UErrorCode&);
+ void setUnresolvedVariable(const VariableName&, UErrorCode&);
+ void addSyntaxError(UErrorCode&);
+ void setUnknownFunction(const FunctionName&, UErrorCode&);
+ void setFormattingError(const FunctionName&, UErrorCode&);
+ bool hasDataModelError() const { return dataModelError; }
+ bool hasFormattingError() const { return formattingError; }
+ bool hasSelectorError() const { return selectorError; }
+ bool hasSyntaxError() const { return syntaxError; }
+ bool hasUnknownFunctionError() const { return unknownFunctionError; }
+ bool hasMissingSelectorAnnotationError() const { return missingSelectorAnnotationError; }
+ bool hasUnresolvedVariableError() const { return unresolvedVariableError; }
+ void addError(Error, UErrorCode&);
+ void checkErrors(UErrorCode&);
+ void clearResolutionAndFormattingErrors();
+ bool hasError() const;
+
+ virtual ~Errors();
+}; // class Errors
+
+// Arguments
+// ----------
+
+/**
+ * MessageFormatter is a Technical Preview API implementing MessageFormat 2.0.
+ * Since it is not final, documentation has not yet been added everywhere.
+ *
+ * The following class represents the named arguments to a message.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+
+class U_I18N_API MessageArguments : public UObject {
+public:
+ /**
+ * The mutable Builder class allows each message argument to be initialized
+ * separately; calling its `build()` method yields an immutable MessageArguments.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ class U_I18N_API Builder {
+ public:
+ /**
+ * Adds an argument of type `UnicodeString`.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& add(const UnicodeString& key, const UnicodeString& value, UErrorCode& status);
+ /**
+ * Adds an argument of type `double`.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& addDouble(const UnicodeString& key, double value, UErrorCode& status);
+ /**
+ * Adds an argument of type `int64_t`.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& addInt64(const UnicodeString& key, int64_t value, UErrorCode& status);
+ /**
+ * Adds an argument of type `UDate`.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& addDate(const UnicodeString& key, UDate value, UErrorCode& status);
+ /**
+ * Adds an argument of type `StringPiece`, representing a
+ * decimal number.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& addDecimal(const UnicodeString& key, StringPiece value, UErrorCode& status);
+ /**
+ * Adds an argument of type UnicodeString[]. Adopts `value`.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument, interpreted as an array of strings.
+ * @param length The length of the array.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& add(const UnicodeString& key, const UnicodeString* value, int32_t length, UErrorCode& status);
+ /**
+ * Adds an argument of type UObject*, which must be non-null. Does not
+ * adopt this argument.
+ *
+ * @param key The name of the argument.
+ * @param value The value of the argument.
+ * @param status Input/output error code.
+ * @return A reference to the builder.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& addObject(const UnicodeString& key, const UObject* value, UErrorCode& status);
+ /**
+ * Creates an immutable `MessageArguments` object with the argument names
+ * and values that were added by previous calls. The builder can still be used
+ * after this call.
+ *
+ * @param status Input/output error code.
+ * @return The new MessageArguments object, which is non-null if U_SUCCESS(status).
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ MessageArguments* build(UErrorCode& status) const;
+ /**
+ * Destructor.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ virtual ~Builder();
+ private:
+ friend class MessageArguments;
+ Builder(UErrorCode&);
+ Builder& add(const UnicodeString&, Formattable*, UErrorCode&);
+ LocalPointer contents;
+ // Keep a separate hash table for objects, which does not
+ // own the values
+ // This is because a Formattable that wraps an object can't
+ // be copied
+ // Here, the values are UObjects*
+ LocalPointer objectContents;
+ }; // class MessageArguments::Builder
+
+ /**
+ * Returns a new `MessageArguments::Builder` object.
+ *
+ * @param status Input/output error code.
+ * @return The new builder, which is non-null if U_SUCCESS(status).
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ static Builder* builder(UErrorCode& status);
+ /**
+ * Destructor.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ virtual ~MessageArguments();
+private:
+ friend class MessageContext;
+
+ bool hasFormattable(const VariableName&) const;
+ bool hasObject(const VariableName&) const;
+ const Formattable& getFormattable(const VariableName&) const;
+ const UObject* getObject(const VariableName&) const;
+
+ MessageArguments& add(const UnicodeString&, Formattable*, UErrorCode&);
+ MessageArguments(Hashtable* c, Hashtable* o) : contents(c), objectContents(o) {}
+ LocalPointer contents;
+ // Keep a separate hash table for objects, which does not
+ // own the values
+ LocalPointer objectContents;
+}; // class MessageArguments
+
+// Formatter cache
+// --------------
+
+// Map from expression pointers to Formatters
+class CachedFormatters : public UMemory {
+private:
+ friend class MessageFormatter;
+
+ LocalPointer cache;
+ CachedFormatters(UErrorCode&);
+
+public:
+ const Formatter* getFormatter(const FunctionName&);
+ void setFormatter(const FunctionName&, Formatter*, UErrorCode& errorCode);
+};
+
+// The context contains all the information needed to process
+// an entire message: arguments, formatter cache, and error list
+
+class MessageFormatter;
+
+class MessageContext : public UMemory {
+public:
+ static MessageContext* create(const MessageFormatter& mf, const MessageArguments& args, Errors& errors, UErrorCode& errorCode);
+
+ bool isCustomFormatter(const FunctionName&) const;
+ const Formatter* maybeCachedFormatter(const FunctionName&, UErrorCode&);
+ const SelectorFactory* lookupSelectorFactory(const FunctionName&, UErrorCode& status) const;
+ bool isSelector(const FunctionName& fn) const { return isBuiltInSelector(fn) || isCustomSelector(fn); }
+ bool isFormatter(const FunctionName& fn) const { return isBuiltInFormatter(fn) || isCustomFormatter(fn); }
+
+ bool hasGlobal(const VariableName& v) const { return hasGlobalAsFormattable(v) || hasGlobalAsObject(v); }
+ bool hasGlobalAsFormattable(const VariableName&) const;
+ bool hasGlobalAsObject(const VariableName&) const;
+ const Formattable& getGlobalAsFormattable(const VariableName&) const;
+ const UObject* getGlobalAsObject(const VariableName&) const;
+
+ // If any errors were set, update `status` accordingly
+ void checkErrors(UErrorCode& status) const;
+ Errors& getErrors() const { return errors; }
+
+ const MessageFormatter& messageFormatter() const { return parent; }
+
+ virtual ~MessageContext();
+
+private:
+ MessageContext(const MessageFormatter&, const MessageArguments&, Errors&);
+
+ FormatterFactory* lookupFormatterFactory(const FunctionName&, UErrorCode&) const;
+ bool isBuiltInSelector(const FunctionName&) const;
+ bool isBuiltInFormatter(const FunctionName&) const;
+ bool isCustomSelector(const FunctionName&) const;
+
+ const MessageFormatter& parent;
+ const MessageArguments& arguments; // External message arguments
+ // Errors accumulated during parsing/formatting
+ Errors& errors;
+}; // class MessageContext
+
+} // namespace message2
+
+// Export an explicit template instantiation of the LocalPointer that is used as a
+// data member of MessageContext.
+// (When building DLLs for Windows this is required.)
+// (See messageformat2_data_model_forward_decls.h for similar examples.)
+#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
+#if defined(_MSC_VER)
+// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!=
+#pragma warning(push)
+#pragma warning(disable: 4661)
+#endif
+template class U_I18N_API LocalPointer;
+template class U_I18N_API LocalPointer;
+template class U_I18N_API LocalPointerBase;
+template class U_I18N_API LocalPointerBase;
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+#endif
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // MESSAGEFORMAT2_CONTEXT_H
+
+#endif // U_HIDE_DEPRECATED_API
+// eof
diff --git a/icu4c/source/i18n/unicode/messageformat2_data_model.h b/icu4c/source/i18n/unicode/messageformat2_data_model.h
new file mode 100644
index 000000000000..33e34ac2c2a2
--- /dev/null
+++ b/icu4c/source/i18n/unicode/messageformat2_data_model.h
@@ -0,0 +1,1530 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+#ifndef U_HIDE_DEPRECATED_API
+
+#ifndef MESSAGEFORMAT_DATA_MODEL_H
+#define MESSAGEFORMAT_DATA_MODEL_H
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/messageformat2_data_model_forward_decls.h"
+#include "unicode/messageformat2_macros.h"
+#include "unicode/messageformat2_utils.h"
+#include "unicode/unistr.h"
+#include "unicode/utypes.h"
+
+U_NAMESPACE_BEGIN namespace message2 {
+
+class MessageFormatDataModelImpl : public UMemory {
+private:
+ friend class MessageFormatDataModel;
+
+ // The expressions that are being matched on.
+ // Null iff this is a `pattern` message.
+ const LocalPointer selectors;
+
+ // The list of `when` clauses (case arms).
+ // Null iff this is a `pattern` message.
+ const LocalPointer variants;
+
+ // The pattern forming the body of the message.
+ // If this is non-null, then `variants` and `selectors` must be null.
+ const LocalPointer pattern;
+
+ // Bindings for local variables
+ const LocalPointer bindings;
+
+ // Normalized version of the input string (optional whitespace omitted)
+ // Used for testing purposes
+ const LocalPointer normalizedInput;
+
+ MessageFormatDataModelImpl(const MessageFormatDataModel::Builder& builder, UErrorCode &errorCode);
+};
+
+ /**
+ * The `VariableName` class represents the name of a variable in a message.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ class U_I18N_API MessageFormatDataModel::VariableName {
+ public:
+ /**
+ * Equality comparison.
+ *
+ * @param other the object to be compared with.
+ * @return true if other is equal to this, false otherwise.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ inline bool operator== (const VariableName& other) const { return other.variableName == variableName; }
+ /**
+ * Constructor.
+ *
+ * @param s The variable name, as a string
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ VariableName(const UnicodeString& s) : variableName(s) {}
+ /**
+ * Default constructor. (Needed for representing null operands)
+ *
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ VariableName() {}
+ /**
+ * Returns the name of this variable, as a string.
+ *
+ * @return Reference to the variable's name
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ const UnicodeString& identifier() const { return variableName; }
+ /**
+ * Returns the name of this variable, as a string prefixed by the
+ * variable name sigil ('$')
+ *
+ * @return String representation of the variable as it appears in a declaration
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UnicodeString declaration() const;
+ /**
+ * Destructor.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ virtual ~VariableName();
+ private:
+ const UnicodeString variableName;
+ }; // class VariableName
+
+ /**
+ * The `FunctionName` class represents the name of a function referred to
+ * in a message.
+ *
+ * It corresponds to the `FunctionRef` interface defined in
+ * https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#expressions
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ class U_I18N_API MessageFormatDataModel::FunctionName : public UMemory {
+ public:
+ /**
+ * Type representing the function's kind, which is either ':' (the default)
+ * or "open" ('+')/"close" ('-'), usually used for markup functions.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ enum Sigil {
+ OPEN,
+ CLOSE,
+ DEFAULT
+ };
+ /**
+ * Converts the function name to a string that includes the sigil.
+ *
+ * @return A string beginning with the sigil, followed by the function's name.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UnicodeString toString() const;
+ /**
+ * Constructor.
+ *
+ * @param s The function name, as a string. Constructs a function name with the default sigil.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ FunctionName(UnicodeString s) : functionName(s), functionSigil(Sigil::DEFAULT) {}
+ /**
+ * Constructor.
+ *
+ * @param n The function name, as a string.
+ * @param s The function sigil to use.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ FunctionName(UnicodeString n, Sigil s) : functionName(n), functionSigil(s) {}
+ /**
+ * Copy constructor.
+ *
+ * @param other The function name to copy.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ FunctionName(const FunctionName& other) : functionName(other.functionName), functionSigil(other.functionSigil) {}
+ /**
+ * Destructor.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ virtual ~FunctionName();
+
+ private:
+ const UnicodeString functionName;
+ const Sigil functionSigil;
+
+ UChar sigilChar() const {
+ switch (functionSigil) {
+ case Sigil::OPEN: { return PLUS; }
+ case Sigil::CLOSE: { return HYPHEN; }
+ default: { return COLON; }
+ }
+ }
+ }; // class FunctionName
+
+ /**
+ * The `Literal` class corresponds to the `literal` nonterminal in the MessageFormat 2 grammar,
+ * https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf and the
+ * `Literal` interface defined in
+ * // https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#expressions
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ class U_I18N_API MessageFormatDataModel::Literal {
+ public:
+ /**
+ * Returns the quoted representation of this literal (enclosed in '|' characters)
+ *
+ * @return A string representation of the literal enclosed in quote characters.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UnicodeString quotedString() const;
+ /**
+ * Returns the parsed string contents of this literal.
+ *
+ * @return A reference to a Formattable whose string contents are
+ * the parsed string contents of this literal.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ const Formattable& getContents() const { return contents; }
+ /**
+ * Returns the parsed string contents of this literal.
+ *
+ * @return A string representation of this literal.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ const UnicodeString& stringContents() const;
+ /**
+ * Determines if this literal appeared as a quoted literal in the message.
+ *
+ * @return true if and only if this literal appeared as a quoted literal in the
+ * message.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UBool quoted() const { return isQuoted; }
+ /**
+ * Literal constructor.
+ *
+ * @param q True if and only if this literal was parsed with the `quoted` nonterminal
+ * (appeared enclosed in '|' characters in the message text).
+ * @param s The string contents of this literal; escape sequences are assumed to have
+ * been interpreted already.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Literal(UBool q, const UnicodeString& s) : isQuoted(q), contents(s) {}
+ /**
+ * Destructor.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ virtual ~Literal();
+
+ private:
+ friend class Key;
+ friend class ImmutableVector;
+ friend class Operand;
+ friend class Reserved;
+
+ Literal(const Literal& other) : isQuoted(other.isQuoted), contents(other.contents) {}
+
+ const bool isQuoted = false;
+ // Contents is stored as a Formattable to avoid allocating
+ // new Formattables during formatting, but it's guaranteed
+ // to be a string
+ const Formattable contents;
+ // Because Key uses `Literal` as its underlying representation,
+ // this provides a default constructor for wildcard keys
+ Literal() {}
+ };
+
+ /**
+ * The `Operand` class corresponds to the `operand` nonterminal in the MessageFormat 2 grammar,
+ * https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf .
+ * It represents a `Literal | VariableRef` -- see the `operand?` field of the `FunctionRef`
+ * interface defined at:
+ * https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#expressions
+ * with the difference that it can also represent a null operand (the absent operand in an
+ * `annotation` with no operand).
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ class U_I18N_API MessageFormatDataModel::Operand : public UObject {
+ public:
+ /**
+ * Creates a new `variable` operand.
+ *
+ * @param var The variable name this operand represents.
+ * @param status Input/output error code.
+ * @return The new operand, guaranteed to be non-null if U_SUCCESS(status)
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ static Operand* create(const VariableName& var, UErrorCode& errorCode);
+ /**
+ * Creates a new `literal` operand.
+ *
+ * @param lit The literal this operand represents.
+ * @param status Input/output error code.
+ * @return The new operand, guaranteed to be non-null if U_SUCCESS(status)
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ static Operand* create(const Literal& lit, UErrorCode& errorCode);
+ /**
+ * Creates a new `null` operand, which should only appear when
+ * representing the following production in the grammar:
+ * expression = "{" [s] annotation [s] "}"
+ *
+ * @param status Input/output error code.
+ * @return The new operand, guaranteed to be non-null if U_SUCCESS(status)
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ static Operand* create(UErrorCode& errorCode);
+ /**
+ * Determines if this operand represents a variable.
+ *
+ * @return True if and only if the operand is a variable.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UBool isVariable() const;
+ /**
+ * Determines if this operand represents a literal.
+ *
+ * @return True if and only if the operand is a literal.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UBool isLiteral() const;
+ /**
+ * Determines if this operand is the null operand.
+ *
+ * @return True if and only if the operand is the null operand.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UBool isNull() const;
+ /**
+ * Returns a reference to this operand's variable name.
+ * Precondition: isVariable()
+ *
+ * @return A reference to the name of the variable
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ const VariableName& asVariable() const;
+ /**
+ * Returns a reference to this operand's literal contents.
+ * Precondition: isLiteral()
+ *
+ * @return A reference to the literal
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ const Literal& asLiteral() const;
+ /**
+ * Destructor.
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ virtual ~Operand();
+ private:
+ friend class Expression;
+ friend class OrderedMap;
+
+ enum Type {
+ VARIABLE,
+ LITERAL,
+ NULL_OPERAND
+ };
+ // This wastes some space, but it's simpler than defining a copy
+ // constructor for a union
+ const VariableName var;
+ const Literal lit;
+ const Type type;
+ Operand(const Operand&);
+ Operand() : type(Type::NULL_OPERAND) {}
+
+ Operand(const VariableName& v) : var(v), type(Type::VARIABLE) {}
+ Operand(const Literal& l) : lit(l), type(Type::LITERAL) {}
+ }; // class Operand
+
+ /**
+ * The `Key` class corresponds to the `key` nonterminal in the MessageFormat 2 grammar,
+ * https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf .
+ * It also corresponds to
+ * the `Literal | CatchallKey` that is the
+ * element type of the `keys` array in the `Variant` interface
+ * defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#messages
+ *
+ * A key is either a literal or the wildcard symbol (represented in messages as '*')
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ class U_I18N_API MessageFormatDataModel::Key : public UObject {
+ public:
+ /**
+ * Determines if this is a wildcard key
+ *
+ * @return True if and only if this is the wildcard key
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ UBool isWildcard() const { return wildcard; }
+ /**
+ * Returns the contents of this key as a literal.
+ * Precondition: !isWildcard()
+ *
+ * @return The literal contents of the key
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ const Literal& asLiteral() const;
+ /**
+ * Creates a new wildcard key.
+ *
+ * @param status Input/output error code.
+ * @return The new key, which is non-null if U_SUCCESS(status).
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ static Key* create(UErrorCode& errorCode);
+ /**
+ * Creates a new literal key.
+ *
+ * @param lit The literal that this key matches with.
+ * @param status Input/output error code.
+ * @return The new key, which is non-null if U_SUCCESS(status).
+ *
+ * @internal ICU 74.0 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ static Key* create(const Literal& lit, UErrorCode& errorCode);
+
+ private:
+ friend class ImmutableVector