Skip to content

Commit b5adf8d

Browse files
committed
Consistent ordering of WebClient.Builder methods
1 parent 7427884 commit b5adf8d

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,17 @@ public WebClient.Builder exchangeFunction(ExchangeFunction exchangeFunction) {
194194
return this;
195195
}
196196

197+
@Override
198+
public WebClient.Builder apply(Consumer<WebClient.Builder> builderConsumer) {
199+
builderConsumer.accept(this);
200+
return this;
201+
}
202+
203+
@Override
204+
public WebClient.Builder clone() {
205+
return new DefaultWebClientBuilder(this);
206+
}
207+
197208
@Override
198209
public WebClient build() {
199210
ExchangeFunction exchange = initExchangeFunction();
@@ -246,15 +257,4 @@ else if (this.connector != null) {
246257
}
247258
}
248259

249-
@Override
250-
public WebClient.Builder clone() {
251-
return new DefaultWebClientBuilder(this);
252-
}
253-
254-
@Override
255-
public WebClient.Builder apply(Consumer<WebClient.Builder> builderConsumer) {
256-
builderConsumer.accept(this);
257-
return this;
258-
}
259-
260260
}

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,23 +302,22 @@ interface Builder {
302302
*/
303303
Builder exchangeFunction(ExchangeFunction exchangeFunction);
304304

305-
/**
306-
* Clone this {@code WebClient.Builder}.
307-
*/
308-
Builder clone();
309-
310305
/**
311306
* Apply the given {@code Consumer} to this builder instance.
312307
* <p>This can be useful for applying pre-packaged customizations.
313308
* @param builderConsumer the consumer to apply
314309
*/
315310
Builder apply(Consumer<Builder> builderConsumer);
316311

312+
/**
313+
* Clone this {@code WebClient.Builder}.
314+
*/
315+
Builder clone();
316+
317317
/**
318318
* Builder the {@link WebClient} instance.
319319
*/
320320
WebClient build();
321-
322321
}
323322

324323

0 commit comments

Comments
 (0)