Package com.helger.commons.hierarchy
Interface IParentProvider<PARENTTYPE>
- Type Parameters:
PARENTTYPE- The type of object to get a parent from
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
This helper interface is required to build a generic tree. This is required
because the used interfaces do not provide a base interface implementing a
getParent method.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiongetParent(PARENTTYPE aCurrent) Get the parent of the passed object.static <PARENTTYPE extends IHasParent<PARENTTYPE>>
IParentProvider<PARENTTYPE>
-
Method Details
-
getParent
Get the parent of the passed object.- Parameters:
aCurrent- The object to determine the parent of. Nonullor non-nullconstraint possible.- Returns:
- The parent object, or
nullif the object has no parent.
-
parentProviderHasParent
@Nullable static <PARENTTYPE extends IHasParent<PARENTTYPE>> IParentProvider<PARENTTYPE> parentProviderHasParent()
-