TreeFormatter

public final class TreeFormatter(source)

An indentation and tree formatter utility class.

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
public final Unit append(String line, Boolean lastChild)
public final Unit append(String line)

Appends a line to the tree with indentation.

Link copied to clipboard
public final Unit indent()

Indents the following lines by 1.

public final Unit indent(Function1<TreeFormatter, Unit> function)

Indents all code ran inside function by 1, then resets the indentation to the previous one.

Link copied to clipboard
public String toString()
Link copied to clipboard
public final Unit unindent()

Unindents the following lines by 1.