Interface MessageSource

  • All Known Implementing Classes:
    ResourceBundleMessageSource
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface MessageSource
    Resolves locale specific messages.
    • Method Detail

      • getMessage

        String getMessage​(String key,
                          Supplier<String> defaultMessageSupplier,
                          Locale locale,
                          Object... args)
        Gets the message.
        Parameters:
        key - to look up the message
        defaultMessageSupplier - the default message
        locale - the locale to use
        args - the message arguments
        Returns:
        the message
      • getMessage

        default String getMessage​(String key,
                                  String defaultMessage,
                                  Locale locale,
                                  Object... args)
        Gets the message.
        Parameters:
        key - to look up the message
        defaultMessage - the default message
        locale - the locale to use
        args - the message arguments
        Returns:
        the message
      • getMessage

        default String getMessage​(String key,
                                  Locale locale,
                                  Object... args)
        Gets the message.
        Parameters:
        key - to look up the message
        locale - the locale to use
        args - the message arguments
        Returns:
        the message