Package io.micronaut.core.util.locale
Class AbstractLocaleResolver<T>
java.lang.Object
io.micronaut.core.util.locale.AbstractLocaleResolver<T>
- Type Parameters:
T
- The context object which will be used to resolve the locale
- All Implemented Interfaces:
Ordered
,LocaleResolver<T>
- Direct Known Subclasses:
HttpAbstractLocaleResolver
Provides an abstract class which implements
LocaleResolver
and handles default locale resolution.- Since:
- 2.3.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionresolveOrDefault
(T request) Resolves the local or returns the default locale.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.util.LocaleResolver
resolve
-
Field Details
-
defaultLocale
-
-
Constructor Details
-
AbstractLocaleResolver
- Parameters:
defaultLocale
- The locale to use if one cannot be found.
-
-
Method Details
-
resolveOrDefault
Description copied from interface:LocaleResolver
Resolves the local or returns the default locale.- Specified by:
resolveOrDefault
in interfaceLocaleResolver<T>
- Parameters:
request
- The context- Returns:
- The locale
-