Package com.networknt.schema.i18n
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 StringgetMessage(String key, String defaultMessage, Locale locale, Object... args)Gets the message.StringgetMessage(String key, Supplier<String> defaultMessageSupplier, Locale locale, Object... args)Gets the message.default StringgetMessage(String key, Locale locale, Object... args)Gets the message.
-
-
-
Method Detail
-
getMessage
String getMessage(String key, Supplier<String> defaultMessageSupplier, Locale locale, Object... args)
Gets the message.- Parameters:
key- to look up the messagedefaultMessageSupplier- the default messagelocale- the locale to useargs- 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 messagedefaultMessage- the default messagelocale- the locale to useargs- the message arguments- Returns:
- the message
-
-