Package io.micronaut.context
Interface MessageSource.MessageContext
- Enclosing interface:
- MessageSource
public static interface MessageSource.MessageContext
The context to use.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MessageSource.MessageContext
The default message context. -
Method Summary
Modifier and TypeMethodDescriptionThe locale to use to resolve messages.The locale to use to resolve messages.Obtain a message context for the given locale.Obtain a message context for the given locale and variables.Obtain a message context for the given variables.
-
Field Details
-
DEFAULT
The default message context.
-
-
Method Details
-
getLocale
The locale to use to resolve messages.- Returns:
- The locale
-
getLocale
The locale to use to resolve messages.- Parameters:
defaultLocale
- The locale to use if no locale is present- Returns:
- The locale
-
getVariables
- Returns:
- The variables to use resolve message placeholders
-
of
Obtain a message context for the given locale.- Parameters:
locale
- The locale- Returns:
- The message context
-
of
@NonNull static @NonNull MessageSource.MessageContext of(@Nullable @Nullable Map<String, Object> variables) Obtain a message context for the given variables.- Parameters:
variables
- The variables.- Returns:
- The message context
-
of
@NonNull static @NonNull MessageSource.MessageContext of(@Nullable @Nullable Locale locale, @Nullable @Nullable Map<String, Object> variables) Obtain a message context for the given locale and variables.- Parameters:
locale
- The localevariables
- The variables.- Returns:
- The message context
-