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
    Creates a new TranslatableMessage associated with the given translation key, without any associated variables.
    Creates a new TranslatableMessage associated with the given translation key and associated variables.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the arbitrary key which can be used to look up the message to be displayed in the user's native language.
    Returns an arbitrary object whose properties should be substituted for the corresponding placeholders within the string associated with the key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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.