Code example for Preferences

Methods: get

0
  } 
 
  private static String getRegistryValue(String key) {
    Preferences systemPref = Preferences.systemRoot();
    Preferences prefs = systemPref.node("web_sdk");
    String value = prefs.get(key, "");
    return value;
  } 
 
  private static void setRegistryValue(String key, String value) {
    Preferences systemPref = Preferences.systemRoot();
    Preferences prefs = systemPref.node("web_sdk");
    prefs.put(key, value);
  } 
 
  public static int getOutput() { 
    String registryValue = getRegistryValue(OUTPUT);
    if (registryValue == null || registryValue.equals("")) {
      return 0; 
    } 
    return Integer.parseInt(registryValue);