public static interface Route.Decorator extends Route.Aware
{
decorator(next -> ctx -> {
long start = System.currentTimeMillis();
Object result = next.apply(ctx);
long end = System.currentTimeMillis();
System.out.println("Took: " + (end - start));
return result;
});
}
Modifier and Type | Method and Description |
---|---|
Route.Handler |
apply(Route.Handler next)
Chain the decorator within next handler.
|
default Route.Decorator |
then(Route.Decorator next)
Chain this decorator with another and produces a new decorator.
|
default Route.Handler |
then(Route.Handler next)
Chain this decorator with a handler and produces a new handler.
|
setRoute
@Nonnull Route.Handler apply(@Nonnull Route.Handler next)
next
- Next handler.@Nonnull default Route.Decorator then(@Nonnull Route.Decorator next)
next
- Next decorator.@Nonnull default Route.Handler then(@Nonnull Route.Handler next)
next
- Next handler.Copyright © 2020. All rights reserved.