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.
@FunctionalInterface public interface IParentProvider<PARENTTYPE>
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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description PARENTTYPEgetParent(PARENTTYPE aCurrent)Get the parent of the passed object.static <PARENTTYPE extends IHasParent<PARENTTYPE>>
IParentProvider<PARENTTYPE>parentProviderHasParent()
-
-
-
Method Detail
-
getParent
@Nullable PARENTTYPE getParent(PARENTTYPE aCurrent)
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()
-
-