Skip to content

Commit

Permalink
Polishing in DefaultWebClient
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Nov 9, 2020
1 parent 79f79e9 commit 560a504
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ private class DefaultRequestBodyUriSpec implements RequestBodyUriSpec {
this.httpMethod = httpMethod;
}


@Override
public RequestBodySpec uri(String uriTemplate, Object... uriVariables) {
attribute(URI_TEMPLATE_ATTRIBUTE, uriTemplate);
Expand Down Expand Up @@ -242,18 +243,6 @@ public DefaultRequestBodyUriSpec headers(Consumer<HttpHeaders> headersConsumer)
return this;
}

@Override
public RequestBodySpec attribute(String name, Object value) {
this.attributes.put(name, value);
return this;
}

@Override
public RequestBodySpec attributes(Consumer<Map<String, Object>> attributesConsumer) {
attributesConsumer.accept(this.attributes);
return this;
}

@Override
public DefaultRequestBodyUriSpec accept(MediaType... acceptableMediaTypes) {
getHeaders().setAccept(Arrays.asList(acceptableMediaTypes));
Expand Down Expand Up @@ -302,6 +291,18 @@ public DefaultRequestBodyUriSpec ifNoneMatch(String... ifNoneMatches) {
return this;
}

@Override
public RequestBodySpec attribute(String name, Object value) {
this.attributes.put(name, value);
return this;
}

@Override
public RequestBodySpec attributes(Consumer<Map<String, Object>> attributesConsumer) {
attributesConsumer.accept(this.attributes);
return this;
}

@Override
public RequestBodySpec context(Function<Context, Context> contextModifier) {
this.contextModifier = (this.contextModifier != null ?
Expand Down Expand Up @@ -497,12 +498,14 @@ private static class DefaultResponseSpec implements ResponseSpec {

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) {
Expand Down

0 comments on commit 560a504

Please sign in to comment.