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
`static class` `PathTemplateMatcher.PathMatchResult<T>`

### Constructor Summary

Constructors
Constructor and Description
`PathTemplateMatcher()`

### Method Summary

All Methods Instance Methods Concrete Methods
`PathTemplateMatcher<T>` `add(PathTemplate template, T value)`
`PathTemplateMatcher<T>` `add(String pathTemplate, T value)`
`PathTemplateMatcher<T>` `addAll(PathTemplateMatcher<T> pathTemplateMatcher)`
`T` `get(String template)`
`Set<PathTemplate>` `getPathTemplates()`
`PathTemplateMatcher.PathMatchResult<T>` `match(String path)`
`PathTemplateMatcher<T>` `remove(String pathTemplate)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PathTemplateMatcher

    public PathTemplateMatcher()

### 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)

#### get

    public T get(String template)