Package com.stata.sfi.util
Class Preference
- java.lang.Object
-
- com.stata.sfi.util.Preference
-
public class Preference extends Object
A set of utilities for loading and saving preferences.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteSavedPref(String section, String key)
Delete a saved preference.static String
getSavedPref(String section, String key, String defaultValue)
Get a saved preference.static boolean
setSavedPref(String section, String key, String value)
Write a saved preference.
-
-
-
Method Detail
-
deleteSavedPref
@Synchronized public static void deleteSavedPref(String section, String key)
Delete a saved preference.- Parameters:
section
- The preference section.key
- The preference key.
-
getSavedPref
@Synchronized public static String getSavedPref(String section, String key, String defaultValue)
Get a saved preference.- Parameters:
section
- The preference section.key
- The preference key.defaultValue
- The default value if the key is not found.- Returns:
- The saved preference.
-
setSavedPref
@Synchronized public static boolean setSavedPref(String section, String key, String value)
Write a saved preference.- Parameters:
section
- The preference section.key
- The preference key.value
- The value to save.- Returns:
- True if successful.
-
-