diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Configuration.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Configuration.java index 3bfd383f10d..8081bba6c35 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Configuration.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Configuration.java @@ -34,6 +34,29 @@ import org.springframework.web.reactive.result.view.ViewResolver; */ public interface Configuration { + // Instance methods + + /** + * Supply a {@linkplain Stream stream} of {@link HttpMessageReader}s to be used for request + * body conversion. + * @return the stream of message readers + */ + Supplier>> messageReaders(); + + /** + * Supply a {@linkplain Stream stream} of {@link HttpMessageWriter}s to be used for response + * body conversion. + * @return the stream of message writers + */ + Supplier>> messageWriters(); + + /** + * Supply a {@linkplain Stream stream} of {@link ViewResolver}s to be used for view name + * resolution. + * @return the stream of view resolvers + */ + Supplier> viewResolvers(); + // Static methods /** @@ -70,29 +93,6 @@ public interface Configuration { return builder; } - // Instance methods - - /** - * Supply a {@linkplain Stream stream} of {@link HttpMessageReader}s to be used for request - * body conversion. - * @return the stream of message readers - */ - Supplier>> messageReaders(); - - /** - * Supply a {@linkplain Stream stream} of {@link HttpMessageWriter}s to be used for response - * body conversion. - * @return the stream of message writers - */ - Supplier>> messageWriters(); - - /** - * Supply a {@linkplain Stream stream} of {@link ViewResolver}s to be used for view name - * resolution. - * @return the stream of view resolvers - */ - Supplier> viewResolvers(); - /** * A mutable builder for a {@link Configuration}. diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Request.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Request.java index 13dcb378384..f13c9c58a30 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Request.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Request.java @@ -110,6 +110,7 @@ public interface Request { */ Map pathVariables(); + /** * Represents the headers of the HTTP request. * @see Request#headers() diff --git a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Response.java b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Response.java index a9fb9fd97bf..97d85c29f27 100644 --- a/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Response.java +++ b/spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Response.java @@ -46,6 +46,31 @@ import org.springframework.web.server.ServerWebExchange; */ public interface Response { + // Instance methods + + /** + * Return the status code of this response. + */ + HttpStatus statusCode(); + + /** + * Return the headers of this response. + */ + HttpHeaders headers(); + + /** + * Return the body of this response. + */ + T body(); + + /** + * Writes this response to the given web exchange. + * + * @param exchange the web exchange to write to + * @return {@code Mono} to indicate when request handling is complete + */ + Mono writeTo(ServerWebExchange exchange, Configuration configuration); + // Static builder methods /** @@ -148,31 +173,6 @@ public interface Response { return status(HttpStatus.UNPROCESSABLE_ENTITY); } - // Instance methods - - /** - * Return the status code of this response. - */ - HttpStatus statusCode(); - - /** - * Return the headers of this response. - */ - HttpHeaders headers(); - - /** - * Return the body of this response. - */ - T body(); - - /** - * Writes this response to the given web exchange. - * - * @param exchange the web exchange to write to - * @return {@code Mono} to indicate when request handling is complete - */ - Mono writeTo(ServerWebExchange exchange, Configuration configuration); - /** * Defines a builder that adds headers to the response.