@ConsumerType
@FunctionalInterface
public interface AcceptLanguage
Language
Modifier and Type | Method and Description |
---|---|
default java.util.stream.Stream<java.util.Locale> |
getLocales()
Returns the
Stream of the request's preferred Locale , in
decreasing order. |
java.util.Locale |
getPreferredLocale()
Returns the first
Locale added on the Accept-Language
header. |
default java.util.stream.Stream<java.util.Locale> getLocales()
Stream
of the request's preferred Locale
, in
decreasing order.
The stream values start with the first locale added on the Accept-Language
header and continue with the rest of the header.
If the request doesn't have an Accept-Language
header, this
method returns an Stream
containing the default locale for the
server.
Stream
of the request's preferred Locale
, if
the Accept-Language
header is present; otherwise returns
the Stream
containing the server's default localejava.util.Locale getPreferredLocale()
Locale
added on the Accept-Language
header. If the request doesn't have an Accept-Language
header,
this method returns the server's default locale.Locale
, if the Accept-Language
header is present; otherwise returns the Enumeration
containing the default locale for the server