Package de.codecamp.messages
Interface HasMessages
-
public interface HasMessagesA common interface that can be implemented by objects that should provide access to messages.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default StringgetMessage(ResolvableMessage resolvableMessage)Returns the message for the givenResolvableMessage.default StringgetMessage(String messageKey)Returns the message for the given message key.StringgetMessage(String messageKey, Object... args)Returns the message for the given message key and arguments.default StringgetMessage(String messageKey, Map<String,Object> args)Returns the message for the given message key and arguments.
-
-
-
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 codeargs- either a regular array of message arguments; or a single element array containing a map of named arguments (Map<String, Object>) or aResolvableMessage; 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 codeargs- 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 givenResolvableMessage.- Parameters:
resolvableMessage- the resolvable message- Returns:
- the resolved message or null
-
-