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:
  • Constructor Details

    • I18nSpringContext

      public I18nSpringContext(@NotNull @NotNull UUID providerUUID)
      Creates a new instance.
      Parameters:
      providerUUID - The UUID of the provider owner of this context
    • I18nSpringContext

      public I18nSpringContext(@NotNull @NotNull I18nSpringContext copy)
      Copy constructor.
      Parameters:
      copy - The instance to copy
  • Method Details

    • getProviderUUID

      @NotNull public @NotNull UUID getProviderUUID()
      Returns the UUID of the provider owner of this context.
      Specified by:
      getProviderUUID in interface I18nContext
      Returns:
      The UUID of the provider owner of this context
    • getLocale

      @NotNull public @NotNull Locale getLocale()
      Returns the user's language.
      Specified by:
      getLocale in interface I18nContext
      Returns:
      The user's language
    • setLocale

      public void setLocale(Locale locale)
      Sets the user's language. If the argument is null the JVM default language is set.
      Specified by:
      setLocale in interface I18nContext
      Parameters:
      locale - The user's language to set
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object