Class UserPreferences

java.lang.Object
is.codion.common.model.UserPreferences

public final class UserPreferences extends Object
A utility class for working with user preferences
  • Method Details

    • getUserPreference

      public static String getUserPreference(String key, String defaultValue)
      Parameters:
      key - the key identifying the preference
      defaultValue - the default value if no preference is available
      Returns:
      the user preference associated with the given key
    • setUserPreference

      public static void setUserPreference(String key, String value)
      Parameters:
      key - the key to use to identify the preference
      value - the preference value to associate with the given key
    • removeUserPreference

      public static void removeUserPreference(String key)
      Removes the preference associated with the given key
      Parameters:
      key - the key to use to identify the preference to remove
    • flushUserPreferences

      public static void flushUserPreferences() throws BackingStoreException
      Flushes the preferences to disk
      Throws:
      BackingStoreException - in case of a backing store failure