public RouteResult<T> route(HttpMethod method, String uri) {
        MethodlessRouter<T> router = routers.get(method);
        if (router == null) {
            router = anyMethodRouter;
        }

        QueryStringDecoder decoder = new QueryStringDecoder(uri);
        String[] tokens = decodePathTokens(uri);

        RouteResult<T> ret = router.route(uri, decoder.path(), tokens);
        if (ret != null) {
            return new RouteResult<T>(uri, decoder.path(), ret.pathParams(), decoder.parameters(), ret.target());
        }

        if (router != anyMethodRouter) {
            ret = anyMethodRouter.route(uri, decoder.path(), tokens);
            if (ret != null) {
                return new RouteResult<T>(uri, decoder.path(), ret.pathParams(), decoder.parameters(), ret.target());
            }
        }

        if (notFound != null) {
            return new RouteResult<T>(uri, decoder.path(), Collections.<String, String>emptyMap(), decoder.parameters(), notFound);
        }

        return null;
    }
public RouteResult < T > route ( HttpMethod method , String uri ) { MethodlessRouter < T > router = routers . get ( method ) ; if ( router == null ) { router = anyMethodRouter ; } QueryStringDecoder decoder = new QueryStringDecoder ( uri ) ; String [ ] tokens = decodePathTokens ( uri ) ; RouteResult < T > ret = router . route ( uri , decoder . path ( ) , tokens ) ; if ( ret != null ) { return new RouteResult < T > ( uri , decoder . path ( ) , ret . pathParams ( ) , decoder . parameters ( ) , ret . target ( ) ) ; } if ( router != anyMethodRouter ) { ret = anyMethodRouter . route ( uri , decoder . path ( ) , tokens ) ; if ( ret != null ) { return new RouteResult < T > ( uri , decoder . path ( ) , ret . pathParams ( ) , decoder . parameters ( ) , ret . target ( ) ) ; } } if ( notFound != null ) { return new RouteResult < T > ( uri , decoder . path ( ) , Collections . < String , String > emptyMap ( ) , decoder . parameters ( ) , notFound ) ; } return null ; }
If there's no match, returns the result with {@link #notFound(Object) notFound}
as the target if it is set, otherwise returns {@code null}.