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

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

Description

put Boolean Dont Overwrite

License

Open Source License

Declaration

private static boolean putBooleanDontOverwrite(Preferences prefs, String key, boolean value) 

Method Source Code

//package com.java2s;
/*/*w  ww  .j a v  a  2 s .c o  m*/
 *  PrefsUtil.java
 *  Eisenkraut
 *
 *  Copyright (c) 2004-2015 Hanns Holger Rutz. All rights reserved.
 *
 *  This software is published under the GNU General Public License v3+
 *
 *
 *   For further information, please contact Hanns Holger Rutz at
 *   contact@sciss.de
 *
 *
 *  Changelog:
 *      25-Jan-05   created from de.sciss.meloncillo.util.PrefsUtil
 *      13-May-05   updated from Meloncillo
 *      22-Jul-05   suggests 57109 as default scsynth port ; no longer
 *               uses 'Built-in Audio' device on Mac (sc will use
 *               default system output instead) ; TEMPDIR refers to IOUtil
 */

import java.util.prefs.Preferences;

public class Main {
    private static boolean putBooleanDontOverwrite(Preferences prefs, String key, boolean value) {
        boolean overwrite = prefs.get(key, null) == null;

        if (overwrite) {
            prefs.putBoolean(key, value);
        }

        return overwrite;
    }
}

Related

  1. put(final String key, final boolean value)
  2. putCLOB(Preferences prefs, String key, String clob)
  3. putList(String path, ArrayList list)
  4. putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def)
  5. putPrefsStrings(Preferences prefs, String key, String[] strings)