Add WebClient create() and build() static methods
This commit is contained in:
@@ -48,6 +48,10 @@ class DefaultWebClientBuilder implements WebClient.Builder {
|
||||
private MultiValueMap<String, String> defaultCookies;
|
||||
|
||||
|
||||
public DefaultWebClientBuilder() {
|
||||
this(new DefaultUriBuilderFactory());
|
||||
}
|
||||
|
||||
public DefaultWebClientBuilder(String baseUrl) {
|
||||
this(new DefaultUriBuilderFactory(baseUrl));
|
||||
}
|
||||
|
||||
@@ -117,6 +117,16 @@ public interface WebClient {
|
||||
|
||||
// Static, factory methods
|
||||
|
||||
/**
|
||||
* Shortcut for:
|
||||
* <pre class="code">
|
||||
* WebClient client = builder().build();
|
||||
* </pre>
|
||||
*/
|
||||
static WebClient create() {
|
||||
return new DefaultWebClientBuilder().build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for:
|
||||
* <pre class="code">
|
||||
@@ -128,6 +138,13 @@ public interface WebClient {
|
||||
return new DefaultWebClientBuilder(baseUrl).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a {@code WebClient} builder.
|
||||
*/
|
||||
static WebClient.Builder builder() {
|
||||
return new DefaultWebClientBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a {@code WebClient} builder with a base URI to be used as the
|
||||
* base for expanding URI templates during exchanges. The given String
|
||||
|
||||
Reference in New Issue
Block a user