// Path: src/main/java/cn/shiroblue/route/HttpMethod.java
// public enum HttpMethod {
//     GET, POST, PUT, PATCH, DELETE, TRACE, CONNECT, before, after
// }
// 
// Path: src/main/java/cn/shiroblue/route/RouteMatch.java
// public class RouteMatch {
//     private HttpMethod httpMethod;
// 
//     private String matchPath;
// 
//     private String url;
// 
//     private Object target;
// 
//     private Render render;
// 
//     /**
//      * @param httpMethod request method
//      * @param matchPath  route match path
//      * @param url        request url
//      * @param target     action target
//      */
//     public RouteMatch(HttpMethod httpMethod, String matchPath, String url, Object target, Render render) {
//         this.httpMethod = httpMethod;
//         this.matchPath = matchPath;
//         this.url = url;
//         this.target = target;
//         this.render = render;
//     }
// 
// 
//     public HttpMethod getHttpMethod() {
//         return httpMethod;
//     }
// 
//     public String getMatchPath() {
//         return matchPath;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     public Object getTarget() {
//         return target;
//     }
// 
//     public Render getRender() {
//         return render;
//     }
// }


import cn.shiroblue.route.HttpMethod;
import cn.shiroblue.route.RouteEntry;
import cn.shiroblue.route.RouteMatch;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
package cn.shiroblue.modules;




/**
 * Description:
 * <p>
 * ======================
 * by WhiteBlue
 * on 15/10/29
 */
public class RouteMatcher {
    private Set<RouteEntry> routes;

    public RouteMatcher() {
        this.routes = new HashSet<>();
    }

    /**
     * 清空路由表
     */
    public void clearRoutes() {
        routes.clear();
    }

    /**
     * 寻找适配组件
     *
     * @param httpMethod 请求类型
     * @param url        路径
     * @return List
     */
    public List<RouteMatch> findMatchRote(HttpMethod httpMethod, String url) {
        List<RouteMatch> matchSet = new ArrayList<>();

// Path: src/main/java/cn/shiroblue/route/HttpMethod.java
// public enum HttpMethod {
//     GET, POST, PUT, PATCH, DELETE, TRACE, CONNECT, before, after
// }
// 
// Path: src/main/java/cn/shiroblue/route/RouteMatch.java
// public class RouteMatch {
//     private HttpMethod httpMethod;
// 
//     private String matchPath;
// 
//     private String url;
// 
//     private Object target;
// 
//     private Render render;
// 
//     /**
//      * @param httpMethod request method
//      * @param matchPath  route match path
//      * @param url        request url
//      * @param target     action target
//      */
//     public RouteMatch(HttpMethod httpMethod, String matchPath, String url, Object target, Render render) {
//         this.httpMethod = httpMethod;
//         this.matchPath = matchPath;
//         this.url = url;
//         this.target = target;
//         this.render = render;
//     }
// 
// 
//     public HttpMethod getHttpMethod() {
//         return httpMethod;
//     }
// 
//     public String getMatchPath() {
//         return matchPath;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     public Object getTarget() {
//         return target;
//     }
// 
//     public Render getRender() {
//         return render;
//     }
// }


// Path: src/main/java/cn/shiroblue/modules/RouteMatcher.java
import cn.shiroblue.route.HttpMethod;
import cn.shiroblue.route.RouteEntry;
import cn.shiroblue.route.RouteMatch;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

package cn.shiroblue.modules;




/**
 * Description:
 * <p>
 * ======================
 * by WhiteBlue
 * on 15/10/29
 */
public class RouteMatcher {
    private Set<RouteEntry> routes;

    public RouteMatcher() {
        this.routes = new HashSet<>();
    }

    /**
     * 清空路由表
     */
    public void clearRoutes() {
        routes.clear();
    }

    /**
     * 寻找适配组件
     *
     * @param httpMethod 请求类型
     * @param url        路径
     * @return List
     */
    public List<RouteMatch> findMatchRote(HttpMethod httpMethod, String url) {
        List<RouteMatch> matchSet = new ArrayList<>();

        for (RouteEntry entry : this.routes) {