Package io.micronaut.http.uri
Class UriTemplateMatcher
java.lang.Object
io.micronaut.http.uri.UriTemplateMatcher
- All Implemented Interfaces:
UriMatcher,Comparable<UriTemplateMatcher>
@Internal
public final class UriTemplateMatcher
extends Object
implements UriMatcher, Comparable<UriTemplateMatcher>
Implementation of the paths matching rfc6570.
- Since:
- 4.6.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorsConstructorDescriptionUriTemplateMatcher(String templateString) Construct a new URI template for the given template. -
Method Summary
Modifier and TypeMethodDescriptionintExpand the string with the given parameters.Match the given URI string.nest(CharSequence uriTemplate) Nests another URI template with this template.static UriTemplateMatcher/** Create a newUriTemplatefor the given URI.Returns the path string excluding any query variables.toString()@Nullable UriMatchInfoMatch the given URI string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.http.uri.UriMatcher
match
-
Constructor Details
-
UriTemplateMatcher
Construct a new URI template for the given template.- Parameters:
templateString- The template string
-
-
Method Details
-
match
Match the given URI string.- Specified by:
matchin interfaceUriMatcher- Parameters:
uri- The uRI- Returns:
- an optional match
-
tryMatch
Match the given URI string.- Parameters:
uri- The uRI- Returns:
- a match or null
-
nest
Nests another URI template with this template.- Parameters:
uriTemplate- The URI template. If it does not begin with forward slash it will automatically be appended with forward slash- Returns:
- The new URI template
-
toPathString
Returns the path string excluding any query variables.- Returns:
- The path string
-
expand
Expand the string with the given parameters.- Parameters:
parameters- The parameters- Returns:
- The expanded URI
-
compareTo
- Specified by:
compareToin interfaceComparable<UriTemplateMatcher>
-
toString
-
of
/** Create a newUriTemplatefor the given URI.- Parameters:
uri- The URI- Returns:
- The template
-