Package org.apache.juneau.rest.util
Class UrlPathMatch
java.lang.Object
org.apache.juneau.rest.util.UrlPathMatch
Represents a URL path pattern match.
For example, given the pattern "/foo/{bar}/*" and the path "/foo/123/baz/qux" , this match gives
you a map containing "{bar:123}" and a remainder string containing "baz/qux" .
See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
UrlPathMatch
(String path, int matchedParts, String[] keys, String[] values) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the part of the URL that the pattern matched against.Returns the remainder of the path after the pattern match has been made.Returns the remainder of the URL after the pattern was matched.getVars()
Returns a map of the path variables and values.boolean
Returnstrue if any of the variable values are blank.boolean
hasVars()
Returnstrue if this match contains one or more variables.toString()
-
Constructor Details
-
UrlPathMatch
Constructor.- Parameters:
path
- The path being matched against. Can benull .matchedParts
- The number of parts that were matched against the path.keys
- The variable keys. Can benull .values
- The variable values. Can benull .
-
-
Method Details
-
getVars
Returns a map of the path variables and values.- Returns:
- An unmodifiable map of variable keys/values.
Returns an empty map if no variables were found in the path.
-
hasVars
Returnstrue if this match contains one or more variables.- Returns:
true if this match contains one or more variables.
-
hasEmptyVars
Returnstrue if any of the variable values are blank.- Returns:
true if any of the variable values are blank.
-
getRemainder
Returns the remainder of the path after the pattern match has been made.Same as {#link
getSuffix()
but trims the leading slash if there is one.- Returns:
- The remainder of the path after the pattern match has been made.
-
getSuffix
Returns the remainder of the URL after the pattern was matched.- Returns:
- The remainder of the URL after the pattern was matched.
Can benull if nothing remains to be matched.
Otherwise, always starts with'/' .
-
getPrefix
Returns the part of the URL that the pattern matched against.- Returns:
- The part of the URL that the pattern matched against.
Can benull if nothing matched.
Otherwise, always starts with'/' .
-
toString
-