Class Match


  • public class Match
    extends java.lang.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 Detail

      • getParameters

        public java.util.Map<java.lang.String,​java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getAllMatches

        public static java.util.List<Match> getAllMatches​(java.lang.String requestPath,
                                                          java.util.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​(java.lang.String path1,
                                           java.lang.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.