Class 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 Detail

      • 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 root
        pathParameters - The path parameters map to fill out
        Returns:
        true if the URI is a match
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getBase

        public String getBase()
      • getTemplateString

        public String getTemplateString()
      • getParameterNames

        public Set<String> getParameterNames()