public class ConfigBranchImpl extends ConfigNodeImpl implements ConfigBranch
ConfigBranch.| Constructor and Description |
|---|
ConfigBranchImpl()
Creates a new
ConfigBranch without a name or comment. |
ConfigBranchImpl(String name,
String comment)
Creates a new
ConfigBranch with the provided name and comment. |
ConfigBranchImpl(String name,
String comment,
Collection<ConfigNode> items,
boolean serializeSeparately)
Creates a new
ConfigBranch. |
| Modifier and Type | Method and Description |
|---|---|
NodeCollection |
getItems()
Returns a collection of this branch's children.
|
boolean |
isSerializedSeparately()
Returns
true if this node should be serialized separately from its parent. |
ConfigNode |
lookup(String name)
Tries to find a child in this group 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.
|
attachTo, detach, getAttributes, getAttributeValue, getAttributeValue, getComment, getName, getOrCreateAttribute, getParent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNamebuilder, builderattachTo, detach, getAttributes, getAttributeValue, getAttributeValue, getOrCreateAttribute, getParentgetCommentpublic ConfigBranchImpl(String name, @Nullable String comment, @Nonnull Collection<ConfigNode> items, boolean serializeSeparately)
ConfigBranch.name - the name for this ConfigBranchImplcomment - the comment for this ConfigBranchImplitems - the node's itemsserializeSeparately - whether or not this node should be serialised separately. If true, it will be ignored during serialisation.public ConfigBranchImpl(@Nonnull String name, @Nullable String comment)
ConfigBranch with the provided name and comment.
This node will not be serialised separately.
name - the name for this ConfigBranchImplcomment - the comment for this ConfigBranchImplpublic ConfigBranchImpl()
ConfigBranch without a name or comment.
This node will not be serialised separately.
@Nonnull public NodeCollection getItems()
ConfigBranchThe returned collection is guaranteed not to have two nodes with the same name.
getItems in interface ConfigBranchgetItems in interface ConfigTreeNodeOperations@Nullable public ConfigNode lookup(String name)
ConfigBranchThe node returned for a given name is always the same.
lookup in interface ConfigBranchlookup in interface ConfigTreename - The name of the child to look fornull@Nullable public <T> ConfigLeaf<T> lookupLeaf(String name, SerializableType<T> type)
ConfigTreelookupLeaf in interface ConfigTreeT - 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 leafnullpublic boolean lookupAndBind(String name, PropertyMirror<?> mirror)
ConfigTreelookupAndBind in interface ConfigTreename - the name of the leaf to mirrormirror - the mirror to bind to the leaftrue if the operation succeeded@Nullable public ConfigBranch lookupBranch(String name)
ConfigTreelookupBranch in interface ConfigTreename - The name of the child to look for.public boolean isSerializedSeparately()
ConfigBranchtrue if this node should be serialized separately from its parent.
If a node is serialized separately, it should not appear in the serialized representation of its ancestors. This property should be ignored if this node is the root of the currently serialised tree.
isSerializedSeparately in interface ConfigBranchtrue if this node should be serialized separately, and false otherwise