public interface Route<H>
Modifier and Type | Interface and Description |
---|---|
static class |
Route.DocString |
Modifier and Type | Method and Description |
---|---|
static <T> Route<AsyncHandler<T>> |
async(String method,
String uri,
AsyncHandler<T> handler) |
<K> Route<K> |
copy(String method,
String uri,
K handler,
Route.DocString docString) |
static <H> Route<H> |
create(String method,
String uri,
H handler) |
static <H> Route<H> |
create(String method,
String uri,
H handler,
Route.DocString docString) |
Optional<Route.DocString> |
docString() |
static <T> Route<AsyncHandler<T>> |
future(String method,
String uri,
ListenableFutureHandler<T> handler) |
H |
handler() |
String |
method() |
static <T> Route<AsyncHandler<T>> |
sync(String method,
String uri,
SyncHandler<T> handler) |
String |
uri() |
static <H,K> Route<K> |
with(Middleware<? super H,? extends K> m,
String method,
String uri,
H handler)
Allows creating routes with middleware and lambdas in a type-inference-proof way.
|
default Route<H> |
withDocString(String summary,
String description) |
default <K> Route<K> |
withHandler(K handler) |
default <K> Route<K> |
withMiddleware(Middleware<? super H,? extends K> middleware) |
default Route<H> |
withPrefix(String prefix) |
String method()
String uri()
H handler()
Optional<Route.DocString> docString()
default <K> Route<K> withHandler(K handler)
default <K> Route<K> withMiddleware(Middleware<? super H,? extends K> middleware)
<K> Route<K> copy(String method, String uri, K handler, @Nullable Route.DocString docString)
static <H> Route<H> create(String method, String uri, H handler, @Nullable Route.DocString docString)
static <H,K> Route<K> with(Middleware<? super H,? extends K> m, String method, String uri, H handler)
Route.create(method, uri, handler).withMiddleware(m)
,
but if the handler type isn't concrete, then Java's type inference cannot handle that option.static <T> Route<AsyncHandler<T>> async(String method, String uri, AsyncHandler<T> handler)
static <T> Route<AsyncHandler<T>> sync(String method, String uri, SyncHandler<T> handler)
static <T> Route<AsyncHandler<T>> future(String method, String uri, ListenableFutureHandler<T> handler)
Copyright © 2016. All rights reserved.