-
public final class Validate.Request
-
-
Field Summary
Fields Modifier and Type Field Description private final ServerRequestrequestprivate final Function0<ObjectMapper>objectMapperFactory
-
Constructor Summary
Constructors Constructor Description Request(ServerRequest request, Function0<ObjectMapper> objectMapperFactory)
-
Method Summary
Modifier and Type Method Description final <T extends Any> Mono<ServerResponse>withBody(Class<T> bodyType, Function1<T, Mono<ServerResponse>> handler)Validates a request with body of type bodyType. final <T extends Any> Mono<ServerResponse>withBody(Class<T> bodyType, Function1<String, T> readValue, Function1<T, Mono<ServerResponse>> handler)Validates a request with body of type bodyType. final <T extends Any> Mono<ServerResponse>withBody(Function1<T, Mono<ServerResponse>> handler)Reified inline version of the Request.withBody function. final <T extends Any> ServerResponseawaitBody(Class<T> bodyType, Function1<String, T> readValue, SuspendFunction1<T, ServerResponse> handler)Validates a request with body of type bodyType . final ServerRequestgetRequest()final Function0<ObjectMapper>getObjectMapperFactory()-
-
Method Detail
-
withBody
final <T extends Any> Mono<ServerResponse> withBody(Class<T> bodyType, Function1<T, Mono<ServerResponse>> handler)
Validates a request with body of type bodyType. If validation succeeds, the handler is called to return a response
-
withBody
final <T extends Any> Mono<ServerResponse> withBody(Class<T> bodyType, Function1<String, T> readValue, Function1<T, Mono<ServerResponse>> handler)
Validates a request with body of type bodyType. If validation succeeds, the readValue function is used to transform the string body to bodyType, and the handler is called to return a response
-
withBody
final <T extends Any> Mono<ServerResponse> withBody(Function1<T, Mono<ServerResponse>> handler)
Reified inline version of the Request.withBody function.
- Parameters:
handler- handler function.
-
awaitBody
final <T extends Any> ServerResponse awaitBody(Class<T> bodyType, Function1<String, T> readValue, SuspendFunction1<T, ServerResponse> handler)
Validates a request with body of type bodyType . If validation succeeds, the handler is called to return a response. It's a suspended alternative to a withBody method.
-
getRequest
final ServerRequest getRequest()
-
getObjectMapperFactory
final Function0<ObjectMapper> getObjectMapperFactory()
-
-
-
-