public static interface MessageSource.MessageContext
Modifier and Type | Field and Description |
---|---|
static MessageSource.MessageContext |
DEFAULT
The default message context.
|
Modifier and Type | Method and Description |
---|---|
default Locale |
getLocale()
The locale to use to resolve messages.
|
default Locale |
getLocale(Locale defaultLocale)
The locale to use to resolve messages.
|
default Map<String,Object> |
getVariables() |
static MessageSource.MessageContext |
of(Locale locale)
Obtain a message context for the given locale.
|
static MessageSource.MessageContext |
of(Locale locale,
Map<String,Object> variables)
Obtain a message context for the given locale and variables.
|
static MessageSource.MessageContext |
of(Map<String,Object> variables)
Obtain a message context for the given variables.
|
static final MessageSource.MessageContext DEFAULT
@NonNull default Locale getLocale()
@NonNull default Locale getLocale(@Nullable Locale defaultLocale)
defaultLocale
- The locale to use if no locale is present@NonNull default Map<String,Object> getVariables()
@NonNull static MessageSource.MessageContext of(@Nullable Locale locale)
locale
- The locale@NonNull static MessageSource.MessageContext of(@Nullable Map<String,Object> variables)
variables
- The variables.