Class TreeNode
java.lang.Object
ru.vyarus.dropwizard.guice.debug.util.TreeNode
Tree structure used for pretty console tree render. Tree rendered with one tab border. Subtrees separated by
empty line.
- Since:
- 18.07.2016
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd child node.booleanvoidrender(StringBuilder res) Renders tree to provided builder.
-
Constructor Details
-
TreeNode
Creates new node.- Parameters:
name- node nameargs- string format arguments
-
-
Method Details
-
child
- Parameters:
name- node nameargs- string format arguments- Returns:
- child node instance, already attached to current node
-
child
Add child node. Useful for situations when node could be appear empty (due to builder specifics) and empty nodes must be avoided. In other caseschild(String, Object...)is simpler to use.- Parameters:
node- node to add
-
hasChildren
public boolean hasChildren()- Returns:
- true when node is subtree, false otherwise
-
render
Renders tree to provided builder.- Parameters:
res- target builder
-