- All Superinterfaces:
BiConsumer<ServerRequest,
ServerResponse>
- All Known Subinterfaces:
AccessLogEntry
- All Known Implementing Classes:
AbstractLogEntry
,CorsSupport
,HeaderLogEntry
,HostLogEntry
,JsonService
,RequestLineLogEntry
,RequestPredicate.ConditionalHandler
,SecurityHandler
,SizeLogEntry
,StatusLogEntry
,TimestampLogEntry
,TimeTakenLogEntry
,UserIdLogEntry
,UserLogEntry
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ServerRequest req, ServerResponse res) static <T> Handler
create
(Class<T> entityType, Handler.EntityHandler<T> entityHandler) Creates new instance of theHandler
for the entity representing HTTP request content.static <T> Handler
create
(Class<T> entityType, Handler.EntityHandler<T> entityHandler, ErrorHandler<Throwable> entityReadErrorHandler) Creates new instance of theHandler
for the entity representing HTTP request content.Methods inherited from interface java.util.function.BiConsumer
andThen
-
Method Details
-
accept
- Specified by:
accept
in interfaceBiConsumer<ServerRequest,
ServerResponse> - Parameters:
req
- an HTTP server request.res
- an HTTP server response.
-
create
Creates new instance of theHandler
for the entity representing HTTP request content. SeeServerRequest
for more details how response can be represented as a java type.Created handler forwards any error created during entity read or conversion to the standard error handling (
ServerRequest.next(Throwable)
).- Type Parameters:
T
- a type of the entity- Parameters:
entityType
- a java type of the entityentityHandler
- an entity handler to handle request entity- Returns:
- new
Handler
instance
-
create
static <T> Handler create(Class<T> entityType, Handler.EntityHandler<T> entityHandler, ErrorHandler<Throwable> entityReadErrorHandler) Creates new instance of theHandler
for the entity representing HTTP request content. SeeServerRequest
for more details how response can be represented as a java type.- Type Parameters:
T
- a type of the entity- Parameters:
entityType
- a java type of the entityentityHandler
- an entity handler to handle request entityentityReadErrorHandler
- an error handler to handle state when entity cannot be read or convert to the requested type- Returns:
- new
Handler
instance
-