Class LocaleMessageText

java.lang.Object
io.vertigo.core.locale.LocaleMessageText
All Implemented Interfaces:
Serializable

public final class LocaleMessageText extends Object implements Serializable
A Text that can be externalized in a resource file, based on the application's configuration settings. If the label is not found, the display is
Author:
npiedeloup, pchretien
See Also:
  • Method Details

    • of

      public static LocaleMessageText of(LocaleMessageKey key, Serializable... params)
      Static Builder of a messageText by its key.
      Parameters:
      key - Key of the resource
      Returns:
      the messageText
    • of

      public static LocaleMessageText of(String msg, Serializable... params)
      Static Builder of a messageText by its default message.
      Parameters:
      msg - Default message (unformatted) of the resource
      Returns:
      the messageText
    • ofDefaultMsg

      public static LocaleMessageText ofDefaultMsg(String defaultMsg, LocaleMessageKey key, Serializable... params)
      Static Builder of a messageText by its default message.
      Parameters:
      defaultMsg - Default message (unformatted) of the resource
      Returns:
      the messageText
    • getDisplayOpt

      public Optional<String> getDisplayOpt()
      Format message with parameters. No exception thrown!!
      Returns:
      Formatted message, if exists.
    • getDisplay

      public String getDisplay()
      Format message with parameters. If nothing is found, return a "panic message" displaying what is missing. No exception thrown!!
      Returns:
      Formatted message.
    • toString

      public String toString()
      Overrides:
      toString in class Object