Package io.undertow.util
Class PathTemplate
- java.lang.Object
-
- io.undertow.util.PathTemplate
-
- All Implemented Interfaces:
Comparable<PathTemplate>
public class PathTemplate extends Object implements Comparable<PathTemplate>
Represents a parsed web socket path template.This class can be compared to other path templates, with templates that are considered lower have a higher priority, and should be checked first.
This comparison can also be used to check for semantically equal paths, if a.compareTo(b) == 0 then the two paths are equivalent, which will generally result in a deployment exception.
- Author:
- Stuart Douglas
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(PathTemplate o)
static PathTemplate
create(String inputPath)
boolean
equals(Object o)
String
getBase()
Set<String>
getParameterNames()
String
getTemplateString()
int
hashCode()
boolean
matches(String path, Map<String,String> pathParameters)
Check if the given uri matches the template.String
toString()
-
-
-
Method Detail
-
create
public static PathTemplate create(String inputPath)
-
matches
public boolean matches(String path, Map<String,String> pathParameters)
Check if the given uri matches the template. If so then it will return true and place the value of any path parameters into the given map.Note the map may be modified even if the match in unsuccessful, however in this case it will be emptied before the method returns
- Parameters:
path
- The request path, relative to the context rootpathParameters
- The path parameters map to fill out- Returns:
- true if the URI is a match
-
compareTo
public int compareTo(PathTemplate o)
- Specified by:
compareTo
in interfaceComparable<PathTemplate>
-
getBase
public String getBase()
-
getTemplateString
public String getTemplateString()
-
-