Interface HasMessages


  • public interface HasMessages
    A common interface that can be implemented by objects that should provide access to messages.
    • Method Detail

      • getMessage

        default String getMessage​(String messageKey)
        Returns the message for the given message key.
        Parameters:
        messageKey - the message key code
        Returns:
        the message
        See Also:
        MessageKeyUtils
      • getMessage

        String getMessage​(String messageKey,
                          Object... args)
        Returns the message for the given message key and arguments.
        Parameters:
        messageKey - the message key code
        args - either a regular array of message arguments; or a single element array containing a map of named arguments (Map<String, Object>) or a ResolvableMessage; may be null
        Returns:
        the message
        See Also:
        MessageKeyUtils
      • getMessage

        default String getMessage​(String messageKey,
                                  Map<String,​Object> args)
        Returns the message for the given message key and arguments.
        Parameters:
        messageKey - the message key code
        args - the map of named arguments; may be null
        Returns:
        the message
        See Also:
        MessageKeyUtils
      • getMessage

        default String getMessage​(ResolvableMessage resolvableMessage)
        Returns the message for the given ResolvableMessage.
        Parameters:
        resolvableMessage - the resolvable message
        Returns:
        the resolved message or null