Class Match

java.lang.Object
org.glassfish.tyrus.core.uri.Match

public class Match extends Object
Defines a match on an endpoint. The match is either exact, or is not exact. If the match is not exact, it means that some of the path segments on the endpoint are variables. In this case, the Match object carries the indices of the variable segments in the endpoint path, the map of the parameter names and values.
Author:
dannycoward
  • Method Details

    • getParameters

      public Map<String,String> getParameters()
      Get map of parameter names-value pairs.
      Returns:
      map of parameter names-value pairs.
    • getEndpointWrapper

      public TyrusEndpointWrapper getEndpointWrapper()
      Get endpoint wrapper.
      Returns:
      endpoint wrapper.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAllMatches

      public static List<Match> getAllMatches(String requestPath, Set<TyrusEndpointWrapper> endpoints, DebugContext debugContext)
      Return a list of all endpoints with path matching the request path. The endpoints are in order of match preference, best match first.
      Parameters:
      requestPath - request path.
      endpoints - endpoints.
      debugContext - debug context.
      Returns:
      a list of all endpoints with path matching the request path. The endpoints are in order of match preference, best match first.
    • isEquivalent

      public static boolean isEquivalent(String path1, String path2)
      Check for equivalent paths.
      Parameters:
      path1 - path to be checked.
      path2 - path to be checked.
      Returns:
      true when provided path are equivalent, false otherwise.