@@ -494,6 +494,7 @@ Builder defaultStatusHandler(Predicate<HttpStatusCode> statusPredicate,
494
494
495
495
/**
496
496
* Contract for specifying the URI for a request.
497
+ *
497
498
* @param <S> a self reference to the spec type
498
499
*/
499
500
interface UriSpec <S extends RequestHeadersSpec <?>> {
@@ -537,6 +538,7 @@ interface UriSpec<S extends RequestHeadersSpec<?>> {
537
538
538
539
/**
539
540
* Contract for specifying request headers leading up to the exchange.
541
+ *
540
542
* @param <S> a self reference to the spec type
541
543
*/
542
544
interface RequestHeadersSpec <S extends RequestHeadersSpec <S >> {
@@ -730,6 +732,7 @@ interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
730
732
* @param exchangeFunction the function to handle the response with
731
733
* @param <T> the type the response will be transformed to
732
734
* @return the value returned from the exchange function, never {@code null}
735
+ * @since 6.2.6
733
736
*/
734
737
default <T > T exchangeForRequiredValue (RequiredValueExchangeFunction <T > exchangeFunction ) {
735
738
return exchangeForRequiredValue (exchangeFunction , true );
@@ -791,12 +794,14 @@ default <T> T exchangeForRequiredValue(RequiredValueExchangeFunction<T> exchange
791
794
* {@code exchangeFunction} is invoked, {@code false} to keep it open
792
795
* @param <T> the type the response will be transformed to
793
796
* @return the value returned from the exchange function, never {@code null}
797
+ * @since 6.2.6
794
798
*/
795
799
<T > T exchangeForRequiredValue (RequiredValueExchangeFunction <T > exchangeFunction , boolean close );
796
800
797
801
798
802
/**
799
803
* Defines the contract for {@link #exchange(ExchangeFunction)}.
804
+ *
800
805
* @param <T> the type the response will be transformed to
801
806
*/
802
807
@ FunctionalInterface
@@ -814,6 +819,8 @@ interface ExchangeFunction<T> {
814
819
815
820
/**
816
821
* Variant of {@link ExchangeFunction} returning a non-null required value.
822
+ *
823
+ * @since 6.2.6
817
824
* @param <T> the type the response will be transformed to
818
825
*/
819
826
@ FunctionalInterface
@@ -826,6 +833,7 @@ interface RequiredValueExchangeFunction<T> extends ExchangeFunction<T> {
826
833
* @return the exchanged value, never {@code null}
827
834
* @throws IOException in case of I/O errors
828
835
*/
836
+ @ Override
829
837
T exchange (HttpRequest clientRequest , ConvertibleClientHttpResponse clientResponse ) throws IOException ;
830
838
}
831
839
@@ -849,7 +857,6 @@ interface ConvertibleClientHttpResponse extends ClientHttpResponse {
849
857
* @return the body, or {@code null} if no response body was available
850
858
*/
851
859
<T > @ Nullable T bodyTo (ParameterizedTypeReference <T > bodyType );
852
-
853
860
}
854
861
}
855
862
@@ -1029,6 +1036,7 @@ interface ErrorHandler {
1029
1036
1030
1037
/**
1031
1038
* Contract for specifying request headers and URI for a request.
1039
+ *
1032
1040
* @param <S> a self reference to the spec type
1033
1041
*/
1034
1042
interface RequestHeadersUriSpec <S extends RequestHeadersSpec <S >> extends UriSpec <S >, RequestHeadersSpec <S > {
@@ -1041,5 +1049,4 @@ interface RequestHeadersUriSpec<S extends RequestHeadersSpec<S>> extends UriSpec
1041
1049
interface RequestBodyUriSpec extends RequestBodySpec , RequestHeadersUriSpec <RequestBodySpec > {
1042
1050
}
1043
1051
1044
-
1045
1052
}
0 commit comments