Package dev.orne.i18n.spring
Class I18nSpringContext
java.lang.Object
dev.orne.i18n.spring.I18nSpringContext
- All Implemented Interfaces:
I18nContext
,Serializable
@API(status=STABLE,
since="0.1")
public class I18nSpringContext
extends Object
implements I18nContext, Serializable
Implementation of
I18nContext
that delegates Locale
handling in Spring LocaleContextHolder
.- Since:
- 0.1
- Version:
- 1.0, 2021-01
- Author:
- (w) Iker Hernaez
- See Also:
-
I18nContext
LocaleContextHolder
- Serialized Form
-
Constructor Summary
ConstructorDescriptionI18nSpringContext
(@NotNull I18nSpringContext copy) Copy constructor.I18nSpringContext
(@NotNull UUID providerUUID) Creates a new instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.orne.i18n.context.I18nContext
getAvailableLocales, getI18nResources, getI18nResources
-
Constructor Details
-
I18nSpringContext
Creates a new instance.- Parameters:
providerUUID
- The UUID of the provider owner of this context
-
I18nSpringContext
Copy constructor.- Parameters:
copy
- The instance to copy
-
-
Method Details
-
getProviderUUID
Returns the UUID of the provider owner of this context.- Specified by:
getProviderUUID
in interfaceI18nContext
- Returns:
- The UUID of the provider owner of this context
-
getLocale
Returns the user's language.- Specified by:
getLocale
in interfaceI18nContext
- Returns:
- The user's language
-
setLocale
Sets the user's language. If the argument isnull
the JVM default language is set.- Specified by:
setLocale
in interfaceI18nContext
- Parameters:
locale
- The user's language to set
-
hashCode
public int hashCode() -
equals
-
toString
-