Browse Source

Move instance methods before static methods

pull/1173/merge
Arjen Poutsma 9 years ago
parent
commit
de3e07b320
  1. 46
      spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Configuration.java
  2. 1
      spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Request.java
  3. 50
      spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Response.java

46
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; @@ -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<Stream<HttpMessageReader<?>>> messageReaders();
/**
* Supply a {@linkplain Stream stream} of {@link HttpMessageWriter}s to be used for response
* body conversion.
* @return the stream of message writers
*/
Supplier<Stream<HttpMessageWriter<?>>> messageWriters();
/**
* Supply a {@linkplain Stream stream} of {@link ViewResolver}s to be used for view name
* resolution.
* @return the stream of view resolvers
*/
Supplier<Stream<ViewResolver>> viewResolvers();
// Static methods
/**
@ -70,29 +93,6 @@ public interface Configuration { @@ -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<Stream<HttpMessageReader<?>>> messageReaders();
/**
* Supply a {@linkplain Stream stream} of {@link HttpMessageWriter}s to be used for response
* body conversion.
* @return the stream of message writers
*/
Supplier<Stream<HttpMessageWriter<?>>> messageWriters();
/**
* Supply a {@linkplain Stream stream} of {@link ViewResolver}s to be used for view name
* resolution.
* @return the stream of view resolvers
*/
Supplier<Stream<ViewResolver>> viewResolvers();
/**
* A mutable builder for a {@link Configuration}.

1
spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Request.java

@ -110,6 +110,7 @@ public interface Request { @@ -110,6 +110,7 @@ public interface Request {
*/
Map<String, String> pathVariables();
/**
* Represents the headers of the HTTP request.
* @see Request#headers()

50
spring-web-reactive/src/main/java/org/springframework/web/reactive/function/Response.java

@ -46,6 +46,31 @@ import org.springframework.web.server.ServerWebExchange; @@ -46,6 +46,31 @@ import org.springframework.web.server.ServerWebExchange;
*/
public interface Response<T> {
// 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<Void>} to indicate when request handling is complete
*/
Mono<Void> writeTo(ServerWebExchange exchange, Configuration configuration);
// Static builder methods
/**
@ -148,31 +173,6 @@ public interface Response<T> { @@ -148,31 +173,6 @@ public interface Response<T> {
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<Void>} to indicate when request handling is complete
*/
Mono<Void> writeTo(ServerWebExchange exchange, Configuration configuration);
/**
* Defines a builder that adds headers to the response.

Loading…
Cancel
Save