@@ -75,18 +75,19 @@ public class HttpRequestValues {
75
75
76
76
private final @ Nullable Object bodyValue ;
77
77
78
- private @ Nullable ParameterizedTypeReference <?> bodyValueType ;
78
+ private final @ Nullable ParameterizedTypeReference <?> bodyValueType ;
79
79
80
80
81
81
/**
82
82
* Construct {@link HttpRequestValues}.
83
- * @since 6.1
83
+ * @since 7.0
84
84
*/
85
85
protected HttpRequestValues (@ Nullable HttpMethod httpMethod ,
86
86
@ Nullable URI uri , @ Nullable UriBuilderFactory uriBuilderFactory ,
87
87
@ Nullable String uriTemplate , Map <String , String > uriVariables ,
88
- HttpHeaders headers , MultiValueMap <String , String > cookies , @ Nullable Object version ,
89
- Map <String , Object > attributes , @ Nullable Object bodyValue ) {
88
+ HttpHeaders headers , MultiValueMap <String , String > cookies ,
89
+ @ Nullable Object version , Map <String , Object > attributes ,
90
+ @ Nullable Object bodyValue , @ Nullable ParameterizedTypeReference <?> bodyValueType ) {
90
91
91
92
Assert .isTrue (uri != null || uriTemplate != null , "Neither URI nor URI template" );
92
93
@@ -100,6 +101,7 @@ protected HttpRequestValues(@Nullable HttpMethod httpMethod,
100
101
this .version = version ;
101
102
this .attributes = attributes ;
102
103
this .bodyValue = bodyValue ;
104
+ this .bodyValueType = bodyValueType ;
103
105
}
104
106
105
107
@@ -511,14 +513,9 @@ else if (uri != null) {
511
513
Map <String , Object > attributes = (this .attributes != null ?
512
514
new HashMap <>(this .attributes ) : Collections .emptyMap ());
513
515
514
- HttpRequestValues requestValues = createRequestValues (
516
+ return createRequestValues (
515
517
this .httpMethod , uri , uriBuilderFactory , uriTemplate , uriVars ,
516
- headers , cookies , this .version , attributes , bodyValue );
517
-
518
- // In 6.2.x only, temporarily work around protected methods
519
- requestValues .bodyValueType = this .bodyValueType ;
520
-
521
- return requestValues ;
518
+ headers , cookies , this .version , attributes , bodyValue , this .bodyValueType );
522
519
}
523
520
524
521
protected boolean hasParts () {
@@ -557,18 +554,18 @@ private String appendQueryParams(
557
554
558
555
/**
559
556
* Create {@link HttpRequestValues} from values passed to the {@link Builder}.
560
- * @since 6.1
557
+ * @since 7.0
561
558
*/
562
559
protected HttpRequestValues createRequestValues (
563
560
@ Nullable HttpMethod httpMethod ,
564
561
@ Nullable URI uri , @ Nullable UriBuilderFactory uriBuilderFactory , @ Nullable String uriTemplate ,
565
- Map <String , String > uriVars ,
566
- HttpHeaders headers , MultiValueMap <String , String > cookies , @ Nullable Object version ,
567
- Map < String , Object > attributes , @ Nullable Object bodyValue ) {
562
+ Map <String , String > uriVars , HttpHeaders headers , MultiValueMap < String , String > cookies ,
563
+ @ Nullable Object version , Map <String , Object > attributes ,
564
+ @ Nullable Object bodyValue , @ Nullable ParameterizedTypeReference <?> bodyValueType ) {
568
565
569
566
return new HttpRequestValues (
570
567
this .httpMethod , uri , uriBuilderFactory , uriTemplate ,
571
- uriVars , headers , cookies , version , attributes , bodyValue );
568
+ uriVars , headers , cookies , version , attributes , bodyValue , bodyValueType );
572
569
}
573
570
}
574
571
0 commit comments