Java Preference Put putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def)

Here you can find the source of putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def)

Description

put Prefs Boolean

License

Open Source License

Declaration

public static void putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def) 

Method Source Code

//package com.java2s;

import java.util.prefs.Preferences;

public class Main {
    public static void putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def) {
        if (value != def)
            prefs.putBoolean(key, value);
        else// w  w w  . j  a va2 s  .c o m
            prefs.remove(key);
    }
}

Related

  1. put(final String key, final boolean value)
  2. putBooleanDontOverwrite(Preferences prefs, String key, boolean value)
  3. putCLOB(Preferences prefs, String key, String clob)
  4. putList(String path, ArrayList list)
  5. putPrefsStrings(Preferences prefs, String key, String[] strings)
  6. setLocale(final Locale l)
  7. setPrefBoolean(Object context, final String key, final boolean value)
  8. setUserString(final String preferencesGroup, final String preferenceName, final String value)