Package com.helger.commons.hierarchy
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 Summary
Modifier and TypeMethodDescriptionICommonsCollection<? extends CHILDTYPE> getAllChildren(CHILDTYPE aCurrent) Get the children of the passed object.intgetChildCount(CHILDTYPE aCurrent) default booleanhasChildren(CHILDTYPE aCurrent) Check if an item has children.default booleanhasNoChildren(CHILDTYPE aCurrent) Check if an item has no children.
-
Method Details
-
hasChildren
Check if an item has children.- Parameters:
aCurrent- The object to determine the children of. Nonullor non-nullconstraint possible.- Returns:
trueif this item has children,falseotherwise.
-
hasNoChildren
Check if an item has no children.- Parameters:
aCurrent- The object to determine the children of. Nonullor non-nullconstraint possible.- Returns:
trueif this item has no children,falseotherwise.
-
getChildCount
- Parameters:
aCurrent- The object to determine the children count of. Nonullor non-nullconstraint possible.- Returns:
- The number of contained direct children. Always ≥ 0.
-
getAllChildren
Get the children of the passed object.- Parameters:
aCurrent- The object to determine the children of. Nonullor non-nullconstraint possible.- Returns:
- The child objects, or
nullif there are no children. Ifnullis passed, the resolver is expected to return any possible top level (root) elements. This method may NOT returnnullif the call tohasChildren(Object)with the same object returnedtrue.
-