de.caff.util.settings

## Class LocaleEnumValue

- java.lang.Object
- - de.caff.util.settings.LocaleEnumValue

- All Implemented Interfaces:
    EnumValue<java.util.Locale>

      public class LocaleEnumValue
      extends java.lang.Object
      implements EnumValue<java.util.Locale>

  Enum value representing a locale.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocaleEnumValue(java.util.Locale locale)` Create a locale enum value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.swing.Icon` | `getIcon(java.util.Locale l)` Get a possible icon to display for this value.
    `java.util.Locale` | `getLocale()` Get the locale.
    `java.lang.String` | `getLongName(java.util.Locale l)` Get a longer description which describes this value.
    `java.util.Locale` | `getRealValue()` Get the real value which is used in this enum.
    `java.lang.String` | `getShortName(java.util.Locale l)` Get a human readable name for this enum value.
    `boolean` | `isEqualTo(java.util.prefs.Preferences preferences, java.lang.String key)` Is this value equal to the value which is stored in the preferences under the given key?
    `void` | `storeTo(java.util.prefs.Preferences preferences, java.lang.String key)` Store this value to the preferences under the given key.

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

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

- - ### Constructor Detail

    - #### LocaleEnumValue

          public LocaleEnumValue(java.util.Locale locale)

      Create a locale enum value.
      Parameters:
        `locale` - locale to set

  - ### Method Detail

    - #### getShortName

          @NotNull
          public java.lang.String getShortName(@Nullable
                                                        java.util.Locale l)

      Get a human readable name for this enum value.
      Specified by:
        `getShortName` in interface `EnumValue<java.util.Locale>`
      Parameters:
        `l` - locale to use
      Returns:
        human readable short name

    - #### getLongName

          public java.lang.String getLongName(@Nullable
                                              java.util.Locale l)

      Get a longer description which describes this value.
      Specified by:
        `getLongName` in interface `EnumValue<java.util.Locale>`
      Parameters:
        `l` - locale to use
      Returns:
        human readable description or `null` if no description is available

    - #### getIcon

          public javax.swing.Icon getIcon(@Nullable
                                          java.util.Locale l)

      Get a possible icon to display for this value.
      Specified by:
        `getIcon` in interface `EnumValue<java.util.Locale>`
      Parameters:
        `l` - locale to use
      Returns:
        icon or `null` if no icon is available

    - #### storeTo

          public void storeTo(@NotNull
                              java.util.prefs.Preferences preferences,
                              @NotNull
                              java.lang.String key)

      Store this value to the preferences under the given key.
      Specified by:
        `storeTo` in interface `EnumValue<java.util.Locale>`
      Parameters:
        `preferences` - preferences to store to
        `key` - key under which to store

    - #### isEqualTo

          public boolean isEqualTo(@NotNull
                                   java.util.prefs.Preferences preferences,
                                   @NotNull
                                   java.lang.String key)

      Is this value equal to the value which is stored in the preferences under the given key?
      Specified by:
        `isEqualTo` in interface `EnumValue<java.util.Locale>`
      Parameters:
        `preferences` - preferences where a enum value is stored
        `key` - key under which the enum value is stored
      Returns:
        `true` if the enum value is equal to the one stored in the preferences, `false` otherwise

    - #### getRealValue

          public java.util.Locale getRealValue()

      Get the real value which is used in this enum.
      Specified by:
        `getRealValue` in interface `EnumValue<java.util.Locale>`
      Returns:
        the real value

    - #### getLocale

          public java.util.Locale getLocale()

      Get the locale.
      Returns:
        locale (`null` for default locale