Package io.undertow.util
Class PathTemplateMatcher<T>
- java.lang.Object
-
- io.undertow.util.PathTemplateMatcher<T>
-
public class PathTemplateMatcher<T> extends Object
Utility class that provides fast path matching of path templates. Templates are stored in a map based on the stem of the template, and matches longest stem first.TODO: we can probably do this faster using a trie type structure, but I think the current impl should perform ok most of the time
- Author:
- Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPathTemplateMatcher.PathMatchResult<T>
-
Constructor Summary
Constructors Constructor Description PathTemplateMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathTemplateMatcher<T>add(PathTemplate template, T value)PathTemplateMatcher<T>add(String pathTemplate, T value)PathTemplateMatcher<T>addAll(PathTemplateMatcher<T> pathTemplateMatcher)Tget(String template)Set<PathTemplate>getPathTemplates()PathTemplateMatcher.PathMatchResult<T>match(String path)PathTemplateMatcher<T>remove(String pathTemplate)
-
-
-
Method Detail
-
match
public PathTemplateMatcher.PathMatchResult<T> match(String path)
-
add
public PathTemplateMatcher<T> add(PathTemplate template, T value)
-
add
public PathTemplateMatcher<T> add(String pathTemplate, T value)
-
addAll
public PathTemplateMatcher<T> addAll(PathTemplateMatcher<T> pathTemplateMatcher)
-
getPathTemplates
public Set<PathTemplate> getPathTemplates()
-
remove
public PathTemplateMatcher<T> remove(String pathTemplate)
-
-