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 voidappendIndent(StringBuilder sb, int depth) Append a number of spaces equivalent to specified tree nesting depth into the specifiedStringBuilder.abstract voidappendTo(StringBuilder sb, int depth) Format this object into specifiedStringBuilderstarting at specified initial depth.@NonNull Stringget()final @NonNull StringtoString()
-
Constructor Details
-
PrettyTree
public PrettyTree()
-
-
Method Details
-
get
-
toString
-
appendTo
Format this object into specifiedStringBuilderstarting at specified initial depth.- Parameters:
sb- TargetStringBuilderdepth- Initial nesting depth- Throws:
NullPointerException- ifsbis nullIllegalArgumentException- ifdepthis negative
-
appendIndent
Append a number of spaces equivalent to specified tree nesting depth into the specifiedStringBuilder.- Parameters:
sb- TargetStringBuilderdepth- Nesting depth- Throws:
NullPointerException- ifsbis nullIllegalArgumentException- ifdepthis negative
-