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 Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.lang.String getMessage​(java.lang.String key, java.lang.String defaultMessage, java.util.Locale locale, java.lang.Object... args)
      Gets the message.
      java.lang.String getMessage​(java.lang.String key, java.util.function.Supplier<java.lang.String> defaultMessageSupplier, java.util.Locale locale, java.lang.Object... args)
      Gets the message.
      default java.lang.String getMessage​(java.lang.String key, java.util.Locale locale, java.lang.Object... args)
      Gets the message.
    • Method Detail

      • getMessage

        java.lang.String getMessage​(java.lang.String key,
                                    java.util.function.Supplier<java.lang.String> defaultMessageSupplier,
                                    java.util.Locale locale,
                                    java.lang.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 java.lang.String getMessage​(java.lang.String key,
                                            java.lang.String defaultMessage,
                                            java.util.Locale locale,
                                            java.lang.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 java.lang.String getMessage​(java.lang.String key,
                                            java.util.Locale locale,
                                            java.lang.Object... args)
        Gets the message.
        Parameters:
        key - to look up the message
        locale - the locale to use
        args - the message arguments
        Returns:
        the message