class DefaultServerWebExchangeBuilder extends java.lang.Object implements ServerWebExchange.Builder
ServerWebExchange.Builder
.Modifier and Type | Class and Description |
---|---|
private static class |
DefaultServerWebExchangeBuilder.MutativeDecorator
An immutable wrapper of an exchange returning property overrides -- given
to the constructor -- or original values otherwise.
|
Modifier and Type | Field and Description |
---|---|
private ServerWebExchange |
delegate |
private <any> |
principalMono |
private ServerHttpRequest |
request |
private ServerHttpResponse |
response |
Constructor and Description |
---|
DefaultServerWebExchangeBuilder(ServerWebExchange delegate) |
Modifier and Type | Method and Description |
---|---|
ServerWebExchange |
build()
Build a
ServerWebExchange decorator with the mutated properties. |
ServerWebExchange.Builder |
principal(<any> principalMono)
Set the
Mono<Principal> to return for this exchange. |
ServerWebExchange.Builder |
request(java.util.function.Consumer<ServerHttpRequest.Builder> consumer)
Configure a consumer to modify the current request using a builder.
|
ServerWebExchange.Builder |
request(ServerHttpRequest request)
Set the request to use especially when there is a need to override
ServerHttpRequest methods. |
ServerWebExchange.Builder |
response(ServerHttpResponse response)
Set the response to use.
|
private final ServerWebExchange delegate
private ServerHttpRequest request
private ServerHttpResponse response
private <any> principalMono
DefaultServerWebExchangeBuilder(ServerWebExchange delegate)
public ServerWebExchange.Builder request(java.util.function.Consumer<ServerHttpRequest.Builder> consumer)
ServerWebExchange.Builder
Effectively this:
exchange.mutate().request(builder-> builder.method(HttpMethod.PUT)); // vs... ServerHttpRequest request = exchange.getRequest().mutate() .method(HttpMethod.PUT) .build(); exchange.mutate().request(request);
request
in interface ServerWebExchange.Builder
ServerHttpRequest.mutate()
public ServerWebExchange.Builder request(ServerHttpRequest request)
ServerWebExchange.Builder
ServerHttpRequest
methods. To simply mutate request properties
see ServerWebExchange.Builder.request(Consumer)
instead.request
in interface ServerWebExchange.Builder
ServerHttpRequestDecorator
public ServerWebExchange.Builder response(ServerHttpResponse response)
ServerWebExchange.Builder
response
in interface ServerWebExchange.Builder
ServerHttpResponseDecorator
public ServerWebExchange.Builder principal(<any> principalMono)
ServerWebExchange.Builder
Mono<Principal>
to return for this exchange.principal
in interface ServerWebExchange.Builder
public ServerWebExchange build()
ServerWebExchange.Builder
ServerWebExchange
decorator with the mutated properties.build
in interface ServerWebExchange.Builder