Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.treeCompoundNode

CompoundNode

interface CompoundNode<N : Node>

A Node that combines multiple other nodes into a single node.

A compound node may have 0.n children. Children are added by calling the accept method.

Accepted children must follow a few invariants. See Node for more information.

There are no general-purpose way of accessing the children after they have been accepted. Instead, this node should be considered as representing the children itself, as a single unit. Subtypes may decide to provide such a feature, however.

Inheritors

Functions

accept

abstract fun accept(node: N)

Adds a new Node into the current node.

acceptAll

fun <N : Node> CompoundNode<N>.acceptAll(nodes: Iterable<N>)

Adds any number of nodes into this one.