Move instance methods before static methods

This commit is contained in:
Arjen Poutsma 2016-09-16 18:20:32 +02:00
parent c57beef95e
commit de3e07b320
3 changed files with 49 additions and 48 deletions

View File

@ -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 {
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}.

View File

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

View File

@ -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> {
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.