Class MessagesImpl

  • All Implemented Interfaces:
    Messages

    @Singleton
    public class MessagesImpl
    extends Object
    implements Messages
    • Constructor Detail

      • MessagesImpl

        public MessagesImpl()
    • Method Detail

      • get

        public String get​(String key,
                          Object... arguments)
        Description copied from interface: Messages
        Get a message by key from the 'messages' resource bundle. If you give arguments, they are interpolated into the message as documented in the MessageFormat javadoc.
        Specified by:
        get in interface Messages
        Parameters:
        key - the key
        arguments - the optional arguments to be interpolated
        Returns:
        the message
      • getOrDefault

        public String getOrDefault​(String key,
                                   String defaultMessage,
                                   Object... arguments)
        Description copied from interface: Messages
        Get a message by key from the 'messages' resource bundle. If the message is not found, it defaults to the defaultMessage given here. If you give arguments, they are interpolated into the message as documented in the MessageFormat javadoc.
        Specified by:
        getOrDefault in interface Messages
        Parameters:
        key - the key
        defaultMessage - the default message the method is falling back to, if the resource bundle does not contain the key
        arguments - the optional arguments to be interpolated
        Returns:
        the message