public interface PreferencesNode
Modifier and Type | Field and Description |
---|---|
static String |
PATH_SEPARATOR |
Modifier and Type | Method and Description |
---|---|
Map<String,PreferencesNode> |
children() |
void |
clear() |
boolean |
containsKey(String key) |
boolean |
containsNode(Class<?> clazz) |
boolean |
containsNode(String path) |
PreferencesNode |
createChildNode(String nodeName) |
<T> T |
getAs(String key)
Returns the value associated with the given key.
|
<T> T |
getAs(String key,
T defaultValue)
Returns the value associated with the given key.
|
Object |
getAt(String key)
Returns the value associated with the given key.
|
Object |
getAt(String key,
Object defaultValue)
Returns the value associated with the given key.
|
PreferencesNode |
getChildNode(String nodeName) |
<T> T |
getConverted(String key,
Class<T> type)
Finds a value associated with the given key.
|
<T> T |
getConverted(String key,
Class<T> type,
T defaultValue)
Finds a value associated with the given key.
|
boolean |
isRoot() |
String[] |
keys() |
PreferencesNode |
merge(PreferencesNode other) |
String |
name() |
PreferencesNode |
node(Class<?> clazz) |
PreferencesNode |
node(String path) |
PreferencesNode |
parent() |
String |
path() |
void |
putAt(String key,
Object value) |
void |
remove(String key) |
PreferencesNode |
removeChildNode(String nodeName) |
PreferencesNode |
removeNode(Class<?> clazz) |
PreferencesNode |
removeNode(String path) |
void |
storeChildNode(String nodeName,
PreferencesNode node) |
static final String PATH_SEPARATOR
@Nullable PreferencesNode parent()
@Nullable Object getAt(@Nonnull String key)
key
- the key to search@Nullable Object getAt(@Nonnull String key, @Nullable Object defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key was not found@Nullable <T> T getAs(@Nonnull String key)
T
- the type of the valuekey
- the key to search@Nullable <T> T getAs(@Nonnull String key, @Nullable T defaultValue)
T
- the type of the valuekey
- the key to searchdefaultValue
- the value to be returned if the key was not found@Nullable <T> T getConverted(@Nonnull String key, @Nonnull Class<T> type)
PropertyEditor
.key
- the key to searchtype
- the type to be returned@Nullable <T> T getConverted(@Nonnull String key, @Nonnull Class<T> type, @Nullable T defaultValue)
PropertyEditor
.
If not found then the supplied defaultValue will be returned.key
- the key to searchtype
- the type to be returneddefaultValue
- the value to be returned if the key is not foundboolean isRoot()
void clear()
@Nonnull Map<String,PreferencesNode> children()
@Nullable PreferencesNode node(@Nonnull Class<?> clazz)
@Nullable PreferencesNode node(@Nonnull String path)
@Nullable PreferencesNode removeNode(@Nonnull Class<?> clazz)
@Nullable PreferencesNode removeNode(@Nonnull String path)
@Nullable PreferencesNode getChildNode(@Nonnull String nodeName)
@Nonnull PreferencesNode createChildNode(@Nonnull String nodeName)
void storeChildNode(@Nonnull String nodeName, @Nonnull PreferencesNode node)
@Nullable PreferencesNode removeChildNode(@Nonnull String nodeName)
@Nonnull PreferencesNode merge(@Nonnull PreferencesNode other)