- java.lang.Object
-
- io.helidon.webserver.RequestPredicate.ConditionalHandler
-
- All Implemented Interfaces:
Handler,BiConsumer<ServerRequest,ServerResponse>
- Enclosing class:
- RequestPredicate
public static class RequestPredicate.ConditionalHandler extends Object implements Handler
AHandlerthat conditionally delegates to otherHandlerinstances based on aRequestPredicate. There can be at most 2 handlers: a required one for matched requests and an optional one for requests that are not matched. If the handler for non matched requests is not provided, such request will return a404response.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.webserver.Handler
Handler.EntityHandler<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ServerRequest req, ServerResponse res)Handlerotherwise(Handler handler)Set theHandlerto use when the predicate does not match the request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiConsumer
andThen
-
-
-
-
Method Detail
-
accept
public void accept(ServerRequest req, ServerResponse res)
Description copied from interface:Handler- Specified by:
acceptin interfaceBiConsumer<ServerRequest,ServerResponse>- Specified by:
acceptin interfaceHandler- Parameters:
req- an HTTP server request.res- an HTTP server response.
-
-