public final class PreferencesUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
flushUserPreferences()
Flushes the preferences to disk
|
static java.lang.String |
getUserPreference(java.lang.String key,
java.lang.String defaultValue) |
static void |
putUserPreference(java.lang.String key,
java.lang.String value) |
static void |
removeUserPreference(java.lang.String key)
Removes the preference associated with the given key
|
public static java.lang.String getUserPreference(java.lang.String key, java.lang.String defaultValue)
key
- the key identifying the preferencedefaultValue
- the default value if no preference is availablepublic static void putUserPreference(java.lang.String key, java.lang.String value)
key
- the key to use to identify the preferencevalue
- the preference value to associate with the given keypublic static void removeUserPreference(java.lang.String key)
key
- the key to use to identify the preference to removepublic static void flushUserPreferences() throws java.util.prefs.BackingStoreException
java.util.prefs.BackingStoreException
- in case of a backing store failure