public class RouteResult<T> extends Object
Router
.
Original code:
https://github.com/sinetja/netty-router/blob/2.2.0/src/main/java/io/netty/handler/codec/http/router/RouteResult.java
Result of calling Router.route(HttpMethod, String)
.
Constructor and Description |
---|
RouteResult(String uri,
String decodedPath,
Map<String,String> pathParams,
Map<String,List<String>> queryParams,
T target)
The maps will be wrapped in Collections.unmodifiableMap.
|
Modifier and Type | Method and Description |
---|---|
String |
decodedPath()
Returns the decoded request path.
|
String |
param(String name)
Extracts the param in
pathParams first, then falls back to the first matching
param in queryParams . |
List<String> |
params(String name)
Extracts all params in
pathParams and queryParams matching the name. |
Map<String,String> |
pathParams()
Returns all params embedded in the request path.
|
String |
queryParam(String name)
Extracts the first matching param in
queryParams . |
Map<String,List<String>> |
queryParams()
Returns all params in the query part of the request URI.
|
T |
target() |
String |
uri()
Returns the original request URI.
|
public String uri()
public String decodedPath()
public Map<String,List<String>> queryParams()
public T target()
public String queryParam(String name)
queryParams
.null
if there's no matchpublic String param(String name)
pathParams
first, then falls back to the first matching
param in queryParams
.null
if there's no matchCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.