T
- - the type of value being stored/associated with each resource type entry added to the tree.public class ResourceTypeTree<T>
extends java.lang.Object
Constructor and Description |
---|
ResourceTypeTree(ResourceResolver adminResolver) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the resource type hierarchy that has been built.
|
boolean |
contains(java.lang.String resourceType) |
T |
get(java.lang.String resourceType)
Gets the specific value added for a given specific resource type.
|
java.util.List<java.util.Map.Entry<java.lang.String,T>> |
getChildren(java.lang.String resourceType)
Retrieves a list of all the children entries for a resource type based on the resource type hierarchy.
|
T |
getClosest(java.lang.String resourceType)
Gets the most closest matched value for a given resource type.
|
java.util.Collection<java.util.Map.Entry<java.lang.String,T>> |
getParents(java.lang.String resourceType)
Retrieves a list of all the parent entries for a resource type based on the resource type hierarchy.
|
void |
put(java.lang.String resourceType,
T value)
Adds the given resource type and value to the resource type trees.
|
void |
remove(java.lang.String resourceType)
Removes the given resource type (if present) from the resource type trees built up.
|
void |
setAdminResolver(ResourceResolver adminResolver) |
public ResourceTypeTree(ResourceResolver adminResolver)
adminResolver
- an instance of the ResourceResolver
with administrative privileges that will be
used to compare resource types.public void setAdminResolver(ResourceResolver adminResolver)
adminResolver
- an instance of the ResourceResolver
with administrative privileges that will be
used to compare resource types.public boolean contains(java.lang.String resourceType)
resourceType
- the resource type to search for.public void put(java.lang.String resourceType, T value)
resourceType
- resource type to add.value
- value to associate with the resource type.public void remove(java.lang.String resourceType)
resourceType
- resource type to remove.public T getClosest(java.lang.String resourceType)
resourceType
- resource type to search forpublic T get(java.lang.String resourceType)
resourceType
- the resource type to search for.public java.util.List<java.util.Map.Entry<java.lang.String,T>> getChildren(java.lang.String resourceType)
resourceType
- the resource type for which parents will be found.public java.util.Collection<java.util.Map.Entry<java.lang.String,T>> getParents(java.lang.String resourceType)
resourceType
- the resource type for which parents will be found.public void clear()
Copyright © 2010 - 2020 Adobe. All Rights Reserved