@Singleton @Requires(property="micronaut.server.locale-resolution.header", notEquals="false") public class RequestLocaleResolver extends HttpAbstractLocaleResolver
HttpRequest.getLocale()
.Modifier and Type | Field and Description |
---|---|
static Integer |
ORDER |
httpLocaleResolutionConfiguration
defaultLocale
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
RequestLocaleResolver(HttpLocaleResolutionConfiguration httpLocaleResolutionConfiguration) |
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
Optional<Locale> |
resolve(HttpRequest<?> request)
Resolves the locale for the given context.
|
resolveOrDefault
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resolveOrDefault
public static final Integer ORDER
public RequestLocaleResolver(HttpLocaleResolutionConfiguration httpLocaleResolutionConfiguration)
httpLocaleResolutionConfiguration
- Locale resolution configuration@NonNull public Optional<Locale> resolve(@NonNull HttpRequest<?> request)
LocaleResolver
request
- The context to retrieve the locale frompublic int getOrder()
getOrder
in interface Ordered
getOrder
in class HttpAbstractLocaleResolver