Java Preference Get getPreference(String key, Boolean defaultValue)

Here you can find the source of getPreference(String key, Boolean defaultValue)

Description

get Preference

License

Open Source License

Declaration

public static boolean getPreference(String key, Boolean defaultValue) 

Method Source Code

//package com.java2s;

import java.util.prefs.Preferences;

public class Main {
    private static Preferences prefs = null;

    public static String getPreference(String key, String defaultValue) {
        return prefs.get(key, defaultValue);
    }//  ww  w. j  a  v  a2 s . co  m

    public static Integer getPreference(String key, Integer defaultValue) {
        return prefs.getInt(key, defaultValue);
    }

    public static boolean getPreference(String key, Boolean defaultValue) {
        return prefs.getBoolean(key, defaultValue);
    }
}

Related

  1. getDefault()
  2. getFloat(String key, Float def)
  3. getInt(final Class preferencesClass, final String preferenceName)
  4. getList(String path)
  5. getNode(String path)
  6. getPreferences()
  7. getPreferences(final Class preferencesClass)
  8. getPrefs(Class cls)
  9. getPrefsStrings(Preferences prefs, String key)