de.caff.i18n

## Class WeakReferencedLocalizable

- java.lang.Object
- - de.caff.i18n.WeakReferencedLocalizable

- All Implemented Interfaces:
    Localizable

      public class WeakReferencedLocalizable
      extends java.lang.Object
      implements Localizable

  A wrapper for localization changes, which wraps the original listener by holding it with a weak reference. This allows garbage collection when the wrapped object is no longer referenced otherwise.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WeakReferencedLocalizable(Localizable wrappedLocalizable)` Constructor.
    `WeakReferencedLocalizable(Localizable wrappedLocalizable, java.util.function.Consumer<? super Localizable> remover)` Weak localization wrapper.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Locale` | `getLocale()` Get the locale.
    `void` | `setLocale(java.util.Locale l)` Set the locale.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WeakReferencedLocalizable

          public WeakReferencedLocalizable(@NotNull
                                           Localizable wrappedLocalizable)

      Constructor. This registers a remover which automatically removes this object from the global localizatipn change list when the wrapped localizable is garbage collected.
      Parameters:
        `wrappedLocalizable` - localizable to wrap

    - #### WeakReferencedLocalizable

          public WeakReferencedLocalizable(@NotNull
                                           Localizable wrappedLocalizable,
                                           @Nullable
                                           java.util.function.Consumer<? super Localizable> remover)

      Weak localization wrapper.
      Parameters:
        `wrappedLocalizable` - localizable to wrap
        `remover` - remover which removes this object when its content is garbage collected

  - ### Method Detail

    - #### setLocale

          public void setLocale(java.util.Locale l)

      Set the locale.
      Specified by:
        `setLocale` in interface `Localizable`
      Parameters:
        `l` - locale to set.

    - #### getLocale

          public java.util.Locale getLocale()

      Get the locale.
      Specified by:
        `getLocale` in interface `Localizable`
      Returns:
        the locale