Polishing
This commit is contained in:
@@ -417,26 +417,23 @@ class DefaultWebClient implements WebClient {
|
||||
|
||||
private static class DefaultResponseSpec implements ResponseSpec {
|
||||
|
||||
private static final IntPredicate STATUS_CODE_ERROR = value -> value >= 400;
|
||||
private static final IntPredicate STATUS_CODE_ERROR = (value -> value >= 400);
|
||||
|
||||
private static final StatusHandler DEFAULT_STATUS_HANDLER =
|
||||
new StatusHandler(STATUS_CODE_ERROR, ClientResponse::createException);
|
||||
|
||||
|
||||
private final Mono<ClientResponse> responseMono;
|
||||
|
||||
private final Supplier<HttpRequest> requestSupplier;
|
||||
|
||||
private final List<StatusHandler> statusHandlers = new ArrayList<>(1);
|
||||
|
||||
|
||||
DefaultResponseSpec(Mono<ClientResponse> responseMono, Supplier<HttpRequest> requestSupplier) {
|
||||
this.responseMono = responseMono;
|
||||
this.requestSupplier = requestSupplier;
|
||||
this.statusHandlers.add(DEFAULT_STATUS_HANDLER);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseSpec onStatus(Predicate<HttpStatus> statusPredicate,
|
||||
Function<ClientResponse, Mono<? extends Throwable>> exceptionFunction) {
|
||||
|
||||
@@ -101,6 +101,7 @@ final class DefaultWebClientBuilder implements WebClient.Builder {
|
||||
this.defaultUriVariables = (other.defaultUriVariables != null ?
|
||||
new LinkedHashMap<>(other.defaultUriVariables) : null);
|
||||
this.uriBuilderFactory = other.uriBuilderFactory;
|
||||
|
||||
if (other.defaultHeaders != null) {
|
||||
this.defaultHeaders = new HttpHeaders();
|
||||
this.defaultHeaders.putAll(other.defaultHeaders);
|
||||
@@ -108,13 +109,16 @@ final class DefaultWebClientBuilder implements WebClient.Builder {
|
||||
else {
|
||||
this.defaultHeaders = null;
|
||||
}
|
||||
|
||||
this.defaultCookies = (other.defaultCookies != null ?
|
||||
new LinkedMultiValueMap<>(other.defaultCookies) : null);
|
||||
this.defaultRequest = other.defaultRequest;
|
||||
this.filters = other.filters != null ? new ArrayList<>(other.filters) : null;
|
||||
this.filters = (other.filters != null ? new ArrayList<>(other.filters) : null);
|
||||
|
||||
this.connector = other.connector;
|
||||
this.strategies = other.strategies;
|
||||
this.strategiesConfigurers = other.strategiesConfigurers != null ? new ArrayList<>(other.strategiesConfigurers) : null;
|
||||
this.strategiesConfigurers = (other.strategiesConfigurers != null ?
|
||||
new ArrayList<>(other.strategiesConfigurers) : null);
|
||||
this.exchangeFunction = other.exchangeFunction;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user