public interface LocalizedMessageSource
| Modifier and Type | Method and Description |
|---|---|
Optional<String> |
getMessage(String code)
Resolve a message for the given code.
|
Optional<String> |
getMessage(String code,
Map<String,Object> variables)
Resolve a message for the given code and variables for the messages.
|
Optional<String> |
getMessage(String code,
Object... variables)
Resolve a message for the given code and variables for the messages.
|
default String |
getMessageOrDefault(String code,
String defaultMessage)
Resolve a message for the given code.
|
default String |
getMessageOrDefault(String code,
String defaultMessage,
Map<String,Object> variables)
Resolve a message for the given code.
|
default String |
getMessageOrDefault(String code,
String defaultMessage,
Object... variables)
Resolve a message for the given code.
|
@NonNull Optional<String> getMessage(@NonNull String code)
code - The code@NonNull Optional<String> getMessage(@NonNull String code, Object... variables)
code - The codevariables - to be used to interpolate the message@NonNull Optional<String> getMessage(@NonNull String code, Map<String,Object> variables)
code - The codevariables - to be used to interpolate the message@NonNull default String getMessageOrDefault(@NonNull String code, @NonNull String defaultMessage)
code - The codedefaultMessage - The default message to use if no other message is found@NonNull default String getMessageOrDefault(@NonNull String code, @NonNull String defaultMessage, Object... variables)
code - The codedefaultMessage - The default message to use if no other message is foundvariables - to be used to interpolate the message@NonNull default String getMessageOrDefault(@NonNull String code, @NonNull String defaultMessage, Map<String,Object> variables)
code - The codedefaultMessage - The default message to use if no other message is foundvariables - to be used to interpolate the message