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>
public abstract class AbstractLocaleResolver<T> extends java.lang.Object implements LocaleResolver<T>
Provides an abstract class which implementsLocaleResolver
and handles default locale resolution.- Since:
- 2.3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Locale
defaultLocale
-
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
-
Constructor Summary
Constructors Constructor Description AbstractLocaleResolver(java.util.Locale defaultLocale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Locale
resolveOrDefault(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
-
-
-
-
Method Detail
-
resolveOrDefault
@NonNull public java.util.Locale resolveOrDefault(@NonNull T request)
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
-
-