public interface ConfigTree
ConfigNode.| Modifier and Type | Method and Description |
|---|---|
static ConfigTreeBuilder |
builder()
Creates a new builder for a root config node.
|
static ConfigTreeBuilder |
builder(ConfigTree parent,
String name)
Creates a new non-root
ConfigTreeBuilder with a name. |
NodeCollection |
getItems()
Returns a collection of this node's children.
|
ConfigNode |
lookup(String name)
Tries to find a child in this node by name.
|
boolean |
lookupAndBind(String name,
PropertyMirror<?> mirror)
Tries to find a child leaf in this node by name.
|
ConfigBranch |
lookupBranch(String name)
Tries to find a child branch in this node by name.
|
<T> ConfigLeaf<T> |
lookupLeaf(String name,
SerializableType<T> type)
Tries to find a child leaf in this node by name.
|
static ConfigTreeBuilder builder()
static ConfigTreeBuilder builder(@Nullable ConfigTree parent, @Nullable String name)
ConfigTreeBuilder with a name.
The built subtree will be attached to parent, with the given name.
To generate a whole tree from the root, use builder() instead.
parent - the parent of the builder to createname - the name of the ConfigTree created by the builderConfigTreeBuilder for an intermediary config branchbuilder()@Nonnull NodeCollection getItems()
The returned collection is guaranteed to have no two nodes with the same name. Any changes made to it will be reflected by this tree.
NodeOperations@Nullable ConfigNode lookup(String name)
name - The name of the child to look for.null.@Nullable ConfigBranch lookupBranch(String name)
name - The name of the child to look for.@Nullable <T> ConfigLeaf<T> lookupLeaf(String name, SerializableType<T> type)
T - the type of values held by the leafname - the name of the leaf to look fortype - a SerializableType object representing the type of values held by the leafnullboolean lookupAndBind(String name, PropertyMirror<?> mirror)
name - the name of the leaf to mirrormirror - the mirror to bind to the leaftrue if the operation succeeded