@Override public HttpServerRoutes route(Predicate<? super HttpServerRequest> condition, BiFunction<? super HttpServerRequest, ? super HttpServerResponse, ? extends Publisher<Void>> handler) { Objects.requireNonNull(condition, "condition"); Objects.requireNonNull(handler, "handler"); if (condition instanceof HttpPredicate) { handlers.add(new HttpRouteHandler(condition, handler, (HttpPredicate) condition)); } else { handlers.add(new HttpRouteHandler(condition, handler, null)); } return this; }
@Override public HttpServerRoutes route(Predicate<? super HttpServerRequest> condition, BiFunction<? super HttpServerRequest, ? super HttpServerResponse, ? extends Publisher<Void>> handler) { Objects.requireNonNull(condition, "condition"); Objects.requireNonNull(handler, "handler"); if (condition instanceof HttpPredicate) { handlers.add(new HttpRouteHandler(condition, handler, (HttpPredicate) condition)); } else { handlers.add(new HttpRouteHandler(condition, handler, null)); } return this; }