Class TreePrinter

java.lang.Object
org.ametys.cms.search.advanced.utils.TreePrinter

public final class TreePrinter extends Object
Helper to print a tree for debug purposes.
  • Method Details

    • 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 print
      leafStringifier - The function to transform a leaf value to a readable String
      Returns:
      The string representing the tree