diff --git a/spring-web/src/main/java/org/springframework/web/client/RestClient.java b/spring-web/src/main/java/org/springframework/web/client/RestClient.java index c330136d8f6..7973be15a31 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RestClient.java +++ b/spring-web/src/main/java/org/springframework/web/client/RestClient.java @@ -494,6 +494,7 @@ public interface RestClient { /** * Contract for specifying the URI for a request. + * * @param a self reference to the spec type */ interface UriSpec> { @@ -537,6 +538,7 @@ public interface RestClient { /** * Contract for specifying request headers leading up to the exchange. + * * @param a self reference to the spec type */ interface RequestHeadersSpec> { @@ -730,6 +732,7 @@ public interface RestClient { * @param exchangeFunction the function to handle the response with * @param the type the response will be transformed to * @return the value returned from the exchange function, never {@code null} + * @since 6.2.6 */ default T exchangeForRequiredValue(RequiredValueExchangeFunction exchangeFunction) { return exchangeForRequiredValue(exchangeFunction, true); @@ -791,12 +794,14 @@ public interface RestClient { * {@code exchangeFunction} is invoked, {@code false} to keep it open * @param the type the response will be transformed to * @return the value returned from the exchange function, never {@code null} + * @since 6.2.6 */ T exchangeForRequiredValue(RequiredValueExchangeFunction exchangeFunction, boolean close); /** * Defines the contract for {@link #exchange(ExchangeFunction)}. + * * @param the type the response will be transformed to */ @FunctionalInterface @@ -814,6 +819,8 @@ public interface RestClient { /** * Variant of {@link ExchangeFunction} returning a non-null required value. + * + * @since 6.2.6 * @param the type the response will be transformed to */ @FunctionalInterface @@ -826,6 +833,7 @@ public interface RestClient { * @return the exchanged value, never {@code null} * @throws IOException in case of I/O errors */ + @Override T exchange(HttpRequest clientRequest, ConvertibleClientHttpResponse clientResponse) throws IOException; } @@ -849,7 +857,6 @@ public interface RestClient { * @return the body, or {@code null} if no response body was available */ @Nullable T bodyTo(ParameterizedTypeReference bodyType); - } } @@ -1029,6 +1036,7 @@ public interface RestClient { /** * Contract for specifying request headers and URI for a request. + * * @param a self reference to the spec type */ interface RequestHeadersUriSpec> extends UriSpec, RequestHeadersSpec { @@ -1041,5 +1049,4 @@ public interface RestClient { interface RequestBodyUriSpec extends RequestBodySpec, RequestHeadersUriSpec { } - }