Here you can find the source of getUserPrefsNode(Object mainClassInstance)
Parameter | Description |
---|---|
mainClassInstance | Either the object, or the object's Class object. |
public static Preferences getUserPrefsNode(Object mainClassInstance)
//package com.java2s; //License from project: Apache License import java.util.prefs.Preferences; public class Main { /**// w w w .j a v a 2 s . c om * Gets the Preferences node for a package, given one class in the package * (either by reference or by reference to its Class object). * * @param mainClassInstance Either the object, or the object's Class object. */ public static Preferences getUserPrefsNode(Object mainClassInstance) { Class clazz; if (mainClassInstance instanceof Class) clazz = (Class) mainClassInstance; else clazz = mainClassInstance.getClass(); return Preferences.userNodeForPackage(clazz); } }