(Supplier<HttpHandler> handler)
| 42 | public abstract class Route implements HttpHandler, Routable { |
| 43 | |
| 44 | public HttpHandler fallbackTo(Supplier<HttpHandler> handler) { |
| 45 | Require.nonNull("Handler", handler); |
| 46 | return req -> { |
| 47 | if (matches(req)) { |
| 48 | return Route.this.execute(req); |
| 49 | } |
| 50 | return Require.state("Handler", handler.get()).nonNull().execute(req); |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public final HttpResponse execute(HttpRequest req) { |