Interface IChildrenProvider<CHILDTYPE>

Type Parameters:
CHILDTYPE - The type of the children to retrieve.
All Known Subinterfaces:
IChildrenProviderSorted<CHILDTYPE>, IChildrenProviderWithID<KEYTYPE,CHILDTYPE>
All Known Implementing Classes:
ChildrenProviderHasChildren, ChildrenProviderHasChildrenSorted, ChildrenProviderHasChildrenSorting, ChildrenProviderHasChildrenWithID, ChildrenProviderSorting, ChildrenProviderSortingWithID

public interface IChildrenProvider<CHILDTYPE>
This interface can be used to generically resolved children of a certain object.
Author:
Philip Helger
  • Method Details

    • hasChildren

      default boolean hasChildren(CHILDTYPE aCurrent)
      Check if an item has children.
      Parameters:
      aCurrent - The object to determine the children of. No null or non- null constraint possible.
      Returns:
      true if this item has children, false otherwise.
    • hasNoChildren

      default boolean hasNoChildren(CHILDTYPE aCurrent)
      Check if an item has no children.
      Parameters:
      aCurrent - The object to determine the children of. No null or non- null constraint possible.
      Returns:
      true if this item has no children, false otherwise.
    • getChildCount

      @Nonnegative int getChildCount(CHILDTYPE aCurrent)
      Parameters:
      aCurrent - The object to determine the children count of. No null or non- null constraint possible.
      Returns:
      The number of contained direct children. Always ≥ 0.
    • getAllChildren

      @Nullable ICommonsCollection<? extends CHILDTYPE> getAllChildren(CHILDTYPE aCurrent)
      Get the children of the passed object.
      Parameters:
      aCurrent - The object to determine the children of. No null or non-null constraint possible.
      Returns:
      The child objects, or null if there are no children. If null is passed, the resolver is expected to return any possible top level (root) elements. This method may NOT return null if the call to hasChildren(Object) with the same object returned true.