Package org.apache.solr.common.util
Class PathTrie<T>
- java.lang.Object
-
- org.apache.solr.common.util.PathTrie<T>
-
public class PathTrie<T> extends Object
A utility class to efficiently parse/store/lookup hierarchical paths which are templatized like /collections/{collection}/shards/{shard}/{replica}
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PathTrie.Node
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attachValueToNode(PathTrie.Node node, T o)
Attaches the provided object to the PathTrie nodestatic List<String>
getPathSegments(String path)
void
insert(String path, Map<String,String> replacements, T o)
void
insert(List<String> parts, Map<String,String> replacements, T o)
T
lookup(String path, Map<String,String> templateValues)
T
lookup(String path, Map<String,String> templateValues, Set<String> paths)
T
lookup(List<String> path, Map<String,String> templateValues)
T
remove(List<String> path)
static void
replaceTemplates(List<String> parts, Map<String,String> replacements)
static String
templateName(String templateStr)
-
-
-
Method Detail
-
replaceTemplates
public static void replaceTemplates(List<String> parts, Map<String,String> replacements)
-
attachValueToNode
protected void attachValueToNode(PathTrie.Node node, T o)
Attaches the provided object to the PathTrie nodeThe default implementation overwrites any existing values, but this can be overwritten by subclasses.
-
-