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
FieldsFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull LocaleresolveOrDefault(@NonNull 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, waitMethods 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:LocaleResolverResolves the local or returns the default locale.- Specified by:
resolveOrDefaultin interfaceLocaleResolver<T>- Parameters:
request- The context- Returns:
- The locale
-