Skip to content

NodeBuilder

abstract class NodeBuilder<K : Any, V, Self : NodeBuilder<K, V, Self>>(val id: K)

A node's own payload builder for tree - subclass for a concrete V; only build is abstract. Self is the concrete subclass itself, so every node(id) { ... } block's receiver exposes that subclass's own fields rather than just this base class's.

Constructors

NodeBuilder

constructor(id: K)

Properties

id

val id: K

Functions

build

abstract fun build(): V

Finalizes whatever this builder accumulated into the actual payload TreeNode.data ends up holding.

children

fun children(block: TreeScope<K, V, Self>.() -> Unit)

Declares this node's own children via nested TreeScope.node calls. Callable more than once.

dependsOn

fun dependsOn(node: TreeNode<K, V>)

Adds node as an extra prerequisite of this node.

fun dependsOn(id: K)

Adds the node registered under id as an extra prerequisite - may name a node declared anywhere else in the same tree call.