T
- the id type for hierarchy entitiesI
- the id type for this specific entitypublic interface HierarchicalEntity<T extends HierarchicalEntityId,I extends T> extends Identifiable<I>
Modifier and Type | Interface and Description |
---|---|
static interface |
HierarchicalEntity.HierarchicalEntityBuilder<T extends HierarchicalEntityId,SELF extends HierarchicalEntity.HierarchicalEntityBuilder<T,SELF>>
Builder for a HierarchicalEntity instance.
|
Modifier and Type | Method and Description |
---|---|
T |
getParentId()
Returns the id of the parent entity.
|
<S extends T> |
getParentId(Class<S> expectedParentType)
Returns the first parent of the entity that is of the expected type when walking up the path from the immediate parent to the root.
|
List<? extends T> |
getPath()
Returns the path of the hierarchy to which the entity belongs.
|
T |
getRootId()
Returns the id of the root entity.
|
<S extends T> |
getTopMostParentId(Class<S> expectedParentType)
Returns the topmost parent of the entity that is of the expected type when walking up the path from the immediate parent to the root.
|
boolean |
hasParent()
Returns true if the entity has a parent.
|
getId
List<? extends T> getPath()
T getRootId()
boolean hasParent()
T getParentId()
<S extends T> S getParentId(Class<S> expectedParentType)
S
- the type of the parent classexpectedParentType
- the expected parent type<S extends T> S getTopMostParentId(Class<S> expectedParentType)
S
- the type of the parent classexpectedParentType
- the expected parent typeCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.