Package org.apache.guacamole.language
Class TranslatableMessage
- java.lang.Object
-
- org.apache.guacamole.language.TranslatableMessage
-
public class TranslatableMessage extends Object
A message which can be translated using a translation service, providing a translation key and optional set of values to be substituted into the translation string associated with that key.
-
-
Constructor Summary
Constructors Constructor Description TranslatableMessage(String key)
Creates a new TranslatableMessage associated with the given translation key, without any associated variables.TranslatableMessage(String key, Object variables)
Creates a new TranslatableMessage associated with the given translation key and associated variables.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getKey()
Returns the arbitrary key which can be used to look up the message to be displayed in the user's native language.Object
getVariables()
Returns an arbitrary object whose properties should be substituted for the corresponding placeholders within the string associated with the key.
-
-
-
Constructor Detail
-
TranslatableMessage
public TranslatableMessage(String key)
Creates a new TranslatableMessage associated with the given translation key, without any associated variables.- Parameters:
key
- The translation key to associate with the TranslatableMessage.
-
TranslatableMessage
public TranslatableMessage(String key, Object variables)
Creates a new TranslatableMessage associated with the given translation key and associated variables.- Parameters:
key
- The translation key to associate with the TranslatableMessage.variables
- An arbitrary object whose properties should be substituted for the corresponding placeholders within the string associated with the given translation key.
-
-
Method Detail
-
getKey
public String getKey()
Returns the arbitrary key which can be used to look up the message to be displayed in the user's native language.- Returns:
- The arbitrary key associated with the human-readable message.
-
getVariables
public Object getVariables()
Returns an arbitrary object whose properties should be substituted for the corresponding placeholders within the string associated with the key. If not applicable, null is returned.- Returns:
- An arbitrary object whose properties should be substituted for the corresponding placeholders within the string associated with the key, or null if not applicable.
-
-