Class LocationTree.Builder<D,T>

java.lang.Object
eu.bandm.tools.location.LocationTree.Builder<D,T>
Type Parameters:
D - the type of document identifiers
T - the type of subjects
Enclosing class:
LocationTree<D,T>

public static class LocationTree.Builder<D,T> extends Object
Builder for a subtree structure.
  • Method Details

    • addLeaf

      public LocationTree.Builder<D,T> addLeaf(String label, Supplier<LocationTree<D,T>> content)
      Adds a leaf node with a proper subtree to the tree under construction.

      This method is chainable.

      Parameters:
      label - the label of the leaf
      content - a functional object that provides the proper subtree
      Returns:
      this
    • addBranch

      public LocationTree.Builder<D,T> addBranch(String label, Consumer<? super LocationTree.Builder<D,T>> branching)
      Adds a branching node to the tree under construction.

      This method is chainable.

      Parameters:
      label - the label of the branching node
      branching - a functional object that populates the branches
      Returns:
      this