Interface MutableConfigNode
- All Superinterfaces:
ConfigNode
- All Known Implementing Classes:
YamlConfigNode
Mutable configuration node that supports modification operations.
Used during serialization to build configuration trees.
-
Method Summary
Modifier and TypeMethodDescription@NotNull MutableConfigNodeAppends a new item to this list node.@NotNull MutableConfigNodeNavigates to a child node by path segments.@NotNull ConfigNodenode(@NotNull PropertyPath path) Navigates to a child node by a property path.@NotNull MutableConfigNoderemove()Removes this node from its parent.@NotNull MutableConfigNodeSets the value of this node.@NotNull MutableConfigNodesetComment(@Nullable String... lines) Sets a comment for this node (if supported by the format).Methods inherited from interface tech.guilhermekaua.spigotboot.config.node.ConfigNode
childrenList, childrenMap, get, get, hasChild, isList, isMap, isNull, isScalar, isVirtual, path, raw
-
Method Details
-
set
Sets the value of this node.- Parameters:
value- the value to set, or null to clear- Returns:
- this node for chaining
-
node
Navigates to a child node by path segments.If the path doesn't exist, returns a virtual (empty) node.
For mutable nodes, this creates the path if it doesn't exist.
- Specified by:
nodein interfaceConfigNode- Parameters:
path- the path segments (strings for map keys, integers for list indices)- Returns:
- the child node, never null
-
node
Navigates to a child node by a property path.If the path doesn't exist, returns a virtual (empty) node.
For mutable nodes, this creates the path if it doesn't exist.
- Specified by:
nodein interfaceConfigNode- Parameters:
path- thePropertyPathto navigate to- Returns:
- the child node, never null
-
setComment
Sets a comment for this node (if supported by the format).- Parameters:
lines- the comment lines, or null to remove- Returns:
- this node for chaining
-
remove
Removes this node from its parent.- Returns:
- this node for chaining
-
appendListItem
Appends a new item to this list node.If this node is not a list, it will be converted to one.
- Returns:
- the new list item node
-