Interface LocaleFacade

All Known Implementing Classes:
DefaultLocaleFacade
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 LocaleFacade
Facade interface to provide access to single and multiple current locales.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Locale
    Returns the requested locale of the current HTTP request, or default locale of the server.
    Returns a list of locales indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.
  • Method Details

    • getCurrentLocale

      @Nonnull default Locale getCurrentLocale()
      Returns the requested locale of the current HTTP request, or default locale of the server.
      Returns:
      The locale.
    • getCurrentLocales

      @Nonnull List<Locale> getCurrentLocales()
      Returns a list of locales indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an "Accept-Language" header, this method returns a list containing one locale, the default locale of the server.
      Returns:
      A list of locales.