TextTreeGenericOps

izumi.fundamentals.platform.strings.TextTree.TextTreeGenericOps
final implicit class TextTreeGenericOps[T](target: TextTree[T])

Core operations for TextTree

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def as[W](implicit conv: T => W): TextTree[W]

Convert tree values using an implicit conversion

Convert tree values using an implicit conversion

Attributes

def dump: String

Render tree to string using .toString on values

Render tree to string using .toString on values

Attributes

def flatten: TextTree[T]

Flatten nested Node structures into a single-level Node

Flatten nested Node structures into a single-level Node

Attributes

def foreach(f: T => Unit): Unit

Apply a side-effecting function to all typed values

Apply a side-effecting function to all typed values

Attributes

def isEmpty: Boolean

Check if tree is empty (no values and only empty text)

Check if tree is empty (no values and only empty text)

Attributes

def last: Option[Char]

Get the last character from string nodes, if any

Get the last character from string nodes, if any

Attributes

def map[U](f: T => U): TextTree[U]

Transform all typed values in the tree

Transform all typed values in the tree

Attributes

def mapRender(f: T => String): String

Render tree to string, converting values with provided function

Render tree to string, converting values with provided function

Attributes

def nonEmpty: Boolean

Check if tree is non-empty

Check if tree is non-empty

Attributes

def rawChunks: Seq[String]

Get a list of string nodes (values ingored)

Get a list of string nodes (values ingored)

Attributes

def render(implicit ev: T =:= Nothing): String

Render tree to string (only for trees without typed values)

Render tree to string (only for trees without typed values)

Attributes

def shift(pad: Int): TextTree[T]

Wrap tree in Shift node to indent by specified spaces when rendering

Wrap tree in Shift node to indent by specified spaces when rendering

Attributes

def stripMargin(marginChar: Char): TextTree[T]

Strip margin from string nodes using custom margin character

Strip margin from string nodes using custom margin character

Attributes

Strip margin from string nodes using default '|' margin character

Strip margin from string nodes using default '|' margin character

Attributes

def trim: TextTree[T]

Wrap tree in Trim node to trim whitespace when rendering

Wrap tree in Trim node to trim whitespace when rendering

Attributes

def values: Seq[T]

Extract all typed values from the tree

Extract all typed values from the tree

Attributes