T
- The context object which will be used to resolve the localepublic class FixedLocaleResolver<T> extends Object implements LocaleResolver<T>
LocaleResolver
for fixed locale resolution.Modifier and Type | Field and Description |
---|---|
protected Locale |
locale |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
FixedLocaleResolver(Locale locale) |
Modifier and Type | Method and Description |
---|---|
Optional<Locale> |
resolve(T context)
Resolves the locale for the given context.
|
Locale |
resolveOrDefault(T context)
Resolves the local or returns the default locale.
|
protected final Locale locale
public FixedLocaleResolver(Locale locale)
locale
- fixed locale@NonNull public Optional<Locale> resolve(@NonNull T context)
LocaleResolver
resolve
in interface LocaleResolver<T>
context
- The context to retrieve the locale from@NonNull public Locale resolveOrDefault(@NonNull T context)
LocaleResolver
resolveOrDefault
in interface LocaleResolver<T>
context
- The context