public class ConfigNode extends ConfigLeaf implements Node
ConfigLeaf with children| Constructor and Description |
|---|
ConfigNode()
Creates a new
ConfigNode without a name or comment. |
ConfigNode(java.lang.String name,
java.lang.String comment)
Creates a new
ConfigNode with the provided name and comment. |
ConfigNode(java.lang.String name,
java.lang.String comment,
java.util.Map<java.lang.String,TreeItem> items,
boolean serializeSeparately)
Creates a new
ConfigNode. |
| Modifier and Type | Method and Description |
|---|---|
static ConfigNodeBuilder |
builder() |
java.util.Collection<TreeItem> |
getItems()
Returns a collection of this node's children.
|
boolean |
isSerializedSeparately()
Returns if this node should be serialised separately.
|
TreeItem |
lookup(java.lang.String name)
Tries to find a child in this node by name.
|
getComment, getName, toStringpublic ConfigNode(java.lang.String name,
@Nullable
java.lang.String comment,
@Nonnull
java.util.Map<java.lang.String,TreeItem> items,
boolean serializeSeparately)
ConfigNode.name - the name for this ConfigNodecomment - the comment for this ConfigNodeitems - the node's itemsserializeSeparately - whether or not this node should be serialised separately. If true, it will be ignored during serialisation.public ConfigNode(@Nonnull
java.lang.String name,
@Nullable
java.lang.String comment)
ConfigNode with the provided name and comment.
This node will not be serialised separately.
name - the name for this ConfigNodecomment - the comment for this ConfigNodeConfigNodepublic ConfigNode()
ConfigNode without a name or comment.
This node will not be serialised separately.
ConfigNodepublic static ConfigNodeBuilder builder()
@Nonnull public java.util.Collection<TreeItem> getItems()
NodeThe returned collection is unmodifiable, and guaranteed not to have two nodes with the same name.
@Nullable public TreeItem lookup(java.lang.String name)
Node The value returned for a given name is always the same.
public boolean isSerializedSeparately()
If true, it should be ignored during serialisation.
isSerializedSeparately in interface Node