| Modifier and Type | Method and Description |
|---|---|
Router<T> |
build()
Create a new
Router that will route requests to all endpoints registered with route(java.lang.String, java.lang.String, T). |
Router.Builder<T> |
optionalTrailingSlash(boolean optional)
Set trailing slash matching to be optional or not.
|
Router.Builder<T> |
route(Route route,
T target)
Register a route.
|
Router.Builder<T> |
route(String method,
String path,
T target)
Register a routing path and method.
|
public Router<T> build()
Router that will route requests to all endpoints registered with route(java.lang.String, java.lang.String, T).public Router.Builder<T> route(String method, String path, T target)
method - A method that should be accepted for the route.path - The path of the route.target - A routing target that will be returned when requests are successfully routed to
this route.public Router.Builder<T> route(Route route, T target)
route - The route to register.target - A routing target that will be returned when requests are successfully routed
to this route.public Router.Builder<T> optionalTrailingSlash(boolean optional)
/foo may be routed
to /foo/ and conversely /bar/ may be routed to /bar.optional - true if trailing slashes should be disregarded, false if
trailing slashes should be strictly routed.Copyright © 2015. All Rights Reserved.