Interface MutableConfigNode

All Superinterfaces:
ConfigNode
All Known Implementing Classes:
YamlConfigNode

public interface MutableConfigNode extends ConfigNode
Mutable configuration node that supports modification operations.

Used during serialization to build configuration trees.

  • Method Details

    • set

      @NotNull @NotNull MutableConfigNode set(@Nullable @Nullable Object value)
      Sets the value of this node.
      Parameters:
      value - the value to set, or null to clear
      Returns:
      this node for chaining
    • node

      @NotNull @NotNull MutableConfigNode node(@NotNull @NotNull Object... path)
      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:
      node in interface ConfigNode
      Parameters:
      path - the path segments (strings for map keys, integers for list indices)
      Returns:
      the child node, never null
    • node

      @NotNull @NotNull ConfigNode node(@NotNull @NotNull PropertyPath path)
      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:
      node in interface ConfigNode
      Parameters:
      path - the PropertyPath to navigate to
      Returns:
      the child node, never null
    • setComment

      @NotNull @NotNull MutableConfigNode setComment(@Nullable @Nullable String... lines)
      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

      @NotNull @NotNull MutableConfigNode remove()
      Removes this node from its parent.
      Returns:
      this node for chaining
    • appendListItem

      @NotNull @NotNull MutableConfigNode 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