Class LocalizedMessageResolver

java.lang.Object
io.micronaut.views.fields.messages.LocalizedMessageResolver

public class LocalizedMessageResolver extends Object
Utility class to resolve message of a Message with a given LocalizedMessageSource.
Since:
5.6.0
Author:
Sergio del Amo
  • Constructor Details

    • LocalizedMessageResolver

      public LocalizedMessageResolver(io.micronaut.context.LocalizedMessageSource messageSource)
  • Method Details

    • getMessageOrDefault

      @NonNull public @NonNull String getMessageOrDefault(@NonNull @NonNull Message message)
      Parameters:
      message - The message
      Returns:
      the resolved message or the defaultMessage if the message is not found.
    • getMessage

      @NonNull public @NonNull Optional<String> getMessage(@NonNull @NonNull Message message)
      Parameters:
      message - The message
      Returns:
      the resolved message or an empty optional if not found.