Interface Messages

  • All Known Implementing Classes:
    MessagesImpl

    public interface Messages
    Inject → The MobileUI MessageService that let's you translate your UI with Java's resource bundle mechanism
    Since:
    0.5.1
    • Method Detail

      • get

        @Nonnull
        String get​(@Nonnull
                   String key,
                   Object... arguments)
        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.
        Parameters:
        key - the key
        arguments - the optional arguments to be interpolated
        Returns:
        the message
      • getOrDefault

        @Nonnull
        String getOrDefault​(@Nonnull
                            String key,
                            @Nonnull
                            String defaultMessage,
                            Object... arguments)
        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.
        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