public class EntityLinkTree extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityLinkTree.EntityLinkNode |
protected static class |
EntityLinkTree.Scope |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,EntityLinkInfo> |
entityLinks |
protected boolean |
needsRefresh |
protected Map<EntityLinkTree.Scope,EntityLinkTree.EntityLinkNode> |
nodeMap |
| Constructor and Description |
|---|
EntityLinkTree(Collection<? extends EntityLinkInfo> entityLinks) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEntityLink(EntityLinkInfo entityLink)
Add an entity link to the tree
|
protected static Map<EntityLinkTree.Scope,EntityLinkTree.EntityLinkNode> |
createNodeMap(Collection<? extends EntityLinkInfo> entityLinks) |
static EntityLinkTree |
createTree(Collection<? extends EntityLinkInfo> entityLinks)
Create an entity link tree from the given
entityLinks. |
EntityLinkTree.EntityLinkNode |
get(String scopeId,
String scopeType)
Get the node with the given scope parameters
|
protected Map<EntityLinkTree.Scope,EntityLinkTree.EntityLinkNode> |
getNodeMap() |
EntityLinkTree.EntityLinkNode |
getRoot()
Get the root of the tree.
|
boolean |
hasNode(String scopeId,
String scopeType)
Check if the tree has a node for the given scope parameters
|
protected final Map<String,EntityLinkInfo> entityLinks
protected final Map<EntityLinkTree.Scope,EntityLinkTree.EntityLinkNode> nodeMap
protected boolean needsRefresh
public EntityLinkTree(Collection<? extends EntityLinkInfo> entityLinks)
public EntityLinkTree.EntityLinkNode get(String scopeId, String scopeType)
scopeId - the scope idscopeType - the scope typepublic boolean hasNode(String scopeId, String scopeType)
scopeId - the scope idscopeType - the scope typetrue if the true has a node for the given treepublic void addEntityLink(EntityLinkInfo entityLink)
entityLink - the entity link to be addedpublic EntityLinkTree.EntityLinkNode getRoot()
protected Map<EntityLinkTree.Scope,EntityLinkTree.EntityLinkNode> getNodeMap()
protected static Map<EntityLinkTree.Scope,EntityLinkTree.EntityLinkNode> createNodeMap(Collection<? extends EntityLinkInfo> entityLinks)
public static EntityLinkTree createTree(Collection<? extends EntityLinkInfo> entityLinks)
entityLinks.
The links should represent all links for the same root scope.
i.e. retrieved via EntityLinkService.findEntityLinksWithSameRootScopeForScopeIdAndScopeType(String, String, String)entityLinks - all entity links with the same root scope