Skip to content

Commit 1d754d1

Browse files
committed
Refactor rename HttpClient.converters() to HttpClient.bodyAdapter() with deprecation
1 parent de95cd2 commit 1d754d1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

client/src/main/java/io/avaje/http/client/DHttpClientContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public HttpClientRequest request() {
9595
}
9696

9797
@Override
98-
public BodyAdapter converters() {
98+
public BodyAdapter bodyAdapter() {
9999
return bodyAdapter;
100100
}
101101

client/src/main/java/io/avaje/http/client/HttpClient.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,22 @@ static Builder builder() {
6666
HttpClientRequest request();
6767

6868
/**
69+
* Deprecated - migrate to {@link #bodyAdapter()}.
70+
* <p>
6971
* Return the body adapter used by the client context.
7072
* <p>
7173
* This is the body adapter used to convert request and response
7274
* bodies to java types. For example using Jackson with JSON payloads.
7375
*/
74-
BodyAdapter converters();
76+
@Deprecated
77+
default BodyAdapter converters() {
78+
return bodyAdapter();
79+
}
80+
81+
/**
82+
* Return the BodyAdapter that this client is using.
83+
*/
84+
BodyAdapter bodyAdapter();
7585

7686
/**
7787
* Return the current aggregate metrics.

0 commit comments

Comments
 (0)