java.lang.Object
ch.tocco.nice2.optional.qualification.impl.util.entities.TreeHelper

public class TreeHelper extends Object
  • Method Details

    • findInRoot

      public static <I, R> Optional<R> findInRoot(I input, Function<I,R> dataFunction, Function<I,I> parentFunction)
      tries to load data for some input, and falls back up the tree if nothing could be found
      Type Parameters:
      I - the class of the nodes
      R - the class of the data
      Parameters:
      input - the starting node
      dataFunction - a function that loads some data
      parentFunction - a function the loads the parent of a node
      Returns:
      an Optional containing the first non-null value in the tree