Class TreePrinter
- java.lang.Object
-
- org.ametys.cms.search.advanced.utils.TreePrinter
-
public final class TreePrinter extends Object
Helper toprint
a tree for debug purposes.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> String
print(AbstractTreeNode<T> tree)
Prints the given tree
Use for debug purposes only.static <T> String
print(AbstractTreeNode<T> tree, Function<T,String> leafStringifier)
Prints the given tree
Use for debug purposes only.
-
-
-
Method Detail
-
print
public static <T> String print(AbstractTreeNode<T> tree)
Prints the given tree
Use for debug purposes only.- Type Parameters:
T
- the type of the values of the leaves of the tree.- Parameters:
tree
- The tree to print- Returns:
- The string representing the tree
-
print
public static <T> String print(AbstractTreeNode<T> tree, Function<T,String> leafStringifier)
Prints the given tree
Use for debug purposes only.- Type Parameters:
T
- the type of the values of the leaves of the tree.- Parameters:
tree
- The tree to printleafStringifier
- The function to transform a leaf value to a readable String- Returns:
- The string representing the tree
-
-