Class Message
java.lang.Object
com.atlassian.confluence.util.i18n.Message
A user interface message consisting of a message key with optional arguments.
Typically, messages will be presented to the user by looking up their value in a properties file (or "bundle"), and
applying MessageFormat
to the value with any optional arguments. However, this class
does not stipulate how the values held by this object might be used.
This class is immutable and thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionObject[]
Returns the arguments to the message.static Message
getInstance
(String key) Constructs and returns an instance of a message with the given key and no arguments.static Message
getInstance
(String key, Object... arguments) Constructs and returns an instance of a message with the given key and arguments.static Message
getInstance
(String key, List arguments) Constructs and returns an instance of a message with the given key and arguments.getKey()
Returns the message key, used for looking up the message in a localisation bundle.boolean
Returns true if the message has arguments defined, otherwise false.toString()
-
Method Details
-
getInstance
Constructs and returns an instance of a message with the given key and no arguments.- Parameters:
key
- the i18n message key- Returns:
- a new immutable Message instance
-
getInstance
Constructs and returns an instance of a message with the given key and arguments.- Parameters:
key
- the i18n message keyarguments
- the arguments which will be interpolated in the message value, like with MessageFormat- Returns:
- a new immutable Message instance
-
getInstance
Constructs and returns an instance of a message with the given key and arguments.- Parameters:
key
- the i18n message keyarguments
- the arguments which will be interpolated in the message value, like with MessageFormat- Returns:
- a new immutable Message instance
-
getKey
Returns the message key, used for looking up the message in a localisation bundle. -
getArguments
Returns the arguments to the message. These arguments might be interpolated in the message using MessageFormat, for instance.Returns null if the message has no arguments.
-
hasArguments
public boolean hasArguments()Returns true if the message has arguments defined, otherwise false. -
toString
-