public class UriPathTemplate extends Object
{
, }
), which can be expanded to produce an actual URI.Constructor and Description |
---|
UriPathTemplate(String uriPattern)
Creates a new
UriPathTemplate from the given uriPattern . |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
match(String uri)
Matches the template against the given
uri returning a map of path parameters
extracted from the uri, keyed by the names in the template. |
boolean |
matches(String uri)
Tests the given
uri against this template, returning true if the
uri matches the template, false otherwise. |
public UriPathTemplate(String uriPattern)
UriPathTemplate
from the given uriPattern
.uriPattern
- The pattern to be used by the templatepublic boolean matches(String uri)
uri
against this template, returning true
if the
uri matches the template, false
otherwise.uri
- The uri to matchtrue
if there's a match, false
otherwisepublic Map<String,Object> match(String uri)
uri
returning a map of path parameters
extracted from the uri, keyed by the names in the template. If the uri does not match,
or there are no path parameters, an empty map is returned.uri
- The uri to matchnull
.Copyright © 2017. All rights reserved.