Package one.nio.http
Class PathMapper
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<java.lang.String,RequestHandler[]>
-
- one.nio.http.PathMapper
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.String,RequestHandler[]>
public class PathMapper extends java.util.HashMap<java.lang.String,RequestHandler[]>
Finds a RequestHandler by the given @Path and HTTP method. Uses an embedded HashMap for performance reasons.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PathMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String path, int[] methods, RequestHandler handler)RequestHandlerfind(java.lang.String path, int method)-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
add
public void add(java.lang.String path, int[] methods, RequestHandler handler)
-
find
public RequestHandler find(java.lang.String path, int method)
-
-