Class PrettyTree
java.lang.Object
org.opendaylight.yangtools.concepts.PrettyTree
- Direct Known Subclasses:
NormalizedNodePrettyTree
A capture of a tree-like construct, which can be formatted into a pretty-printed tree. The string can be acquired
via
get()
.
This concept is purposefully designed as an abstract class which defers its toString()
to get()
, as
it allows convenient and light-weight use with logging:
PrettyTreeAware treeLike;
LOG.debug("Tree is {}", treeLike.prettyTree());
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static final void
appendIndent
(StringBuilder sb, int depth) Append a number of spaces equivalent to specified tree nesting depth into the specifiedStringBuilder
.abstract void
appendTo
(StringBuilder sb, int depth) Format this object into specifiedStringBuilder
starting at specified initial depth.@NonNull String
get()
final @NonNull String
toString()
-
Constructor Details
-
PrettyTree
public PrettyTree()
-
-
Method Details
-
get
-
toString
-
appendTo
Format this object into specifiedStringBuilder
starting at specified initial depth.- Parameters:
sb
- TargetStringBuilder
depth
- Initial nesting depth- Throws:
NullPointerException
- ifsb
is nullIllegalArgumentException
- ifdepth
is negative
-
appendIndent
Append a number of spaces equivalent to specified tree nesting depth into the specifiedStringBuilder
.- Parameters:
sb
- TargetStringBuilder
depth
- Nesting depth- Throws:
NullPointerException
- ifsb
is nullIllegalArgumentException
- ifdepth
is negative
-