1 module hunt.http.routing.Router;
2 
3 import hunt.http.routing.Matcher;
4 import hunt.http.routing.RoutingContext;
5 
6 import hunt.http.HttpMethod;
7 
8 import hunt.collection.List;
9 import hunt.collection.Set;
10 
11 import hunt.util.Common;
12 
13 
14 /**
15  * 
16  */
17 interface Router : Comparable!Router {
18 
19     int getId();
20 
21     bool isEnable();
22 
23     Set!(Matcher.MatchType) getMatchTypes();
24 
25     Router path(string url);
26 
27     Router paths(string[] urlList);
28 
29     Router pathRegex(string regex);
30 
31     Router method(string method);
32 
33     Router method(HttpMethod httpMethod);
34 
35     Router get(string url);
36 
37     Router post(string url);
38 
39     Router put(string url);
40 
41     Router del(string url);
42 
43     Router consumes(string contentType);
44 
45     Router produces(string accept);
46 
47     Router handler(RouteHandler handler);
48 
49     Router handler(RoutingHandler handler);
50 
51     void handle(RoutingContext context);
52 
53     Router enable();
54 
55     Router disable();
56 
57     // int opCmp(Router o);
58 }