Determining If a Preference Node Contains a Specific Key - Java Native OS

Java examples for Native OS:Preference

Description

Determining If a Preference Node Contains a Specific Key

Demo Code

import java.util.prefs.Preferences;

public class Main {
  // Returns true if node contains the specified key; false otherwise.
  public static boolean contains(Preferences node, String key) {
    return node.get(key, null) != null;
  }/*from  w w w .  j  av  a2s.c  o  m*/
}

Related Tutorials