Class LocalizedMessageResolver
java.lang.Object
io.micronaut.views.fields.messages.LocalizedMessageResolver
Utility class to resolve message of a
Message
with a given LocalizedMessageSource
.- Since:
- 5.6.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionLocalizedMessageResolver
(io.micronaut.context.LocalizedMessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptiongetMessage
(@NonNull Message message) @NonNull String
getMessageOrDefault
(@NonNull Message message)
-
Constructor Details
-
LocalizedMessageResolver
public LocalizedMessageResolver(io.micronaut.context.LocalizedMessageSource messageSource)
-
-
Method Details
-
getMessageOrDefault
- Parameters:
message
- The message- Returns:
- the resolved message or the defaultMessage if the message is not found.
-
getMessage
- Parameters:
message
- The message- Returns:
- the resolved message or an empty optional if not found.
-