26
26
27
27
import org .springframework .core .ParameterizedTypeReference ;
28
28
import org .springframework .core .ResolvableType ;
29
+ import org .springframework .core .ResolvableTypeProvider ;
29
30
import org .springframework .core .io .buffer .DataBuffer ;
30
31
import org .springframework .http .HttpEntity ;
31
32
import org .springframework .http .HttpHeaders ;
32
33
import org .springframework .http .MediaType ;
33
34
import org .springframework .http .codec .multipart .Part ;
35
+ import org .springframework .lang .NonNull ;
34
36
import org .springframework .lang .Nullable ;
35
37
import org .springframework .util .Assert ;
36
38
import org .springframework .util .LinkedMultiValueMap ;
@@ -272,13 +274,13 @@ public HttpEntity<?> build() {
272
274
* @param <T> the type contained in the publisher
273
275
* @param <P> the publisher
274
276
*/
275
- public static final class PublisherEntity <T , P extends Publisher <T >> extends HttpEntity <P > {
277
+ public static final class PublisherEntity <T , P extends Publisher <T >> extends HttpEntity <P >
278
+ implements ResolvableTypeProvider {
276
279
277
280
private final ResolvableType resolvableType ;
278
281
279
-
280
- private PublisherEntity (@ Nullable MultiValueMap <String , String > headers , P publisher ,
281
- ResolvableType resolvableType ) {
282
+ PublisherEntity (
283
+ @ Nullable MultiValueMap <String , String > headers , P publisher , ResolvableType resolvableType ) {
282
284
283
285
super (publisher , headers );
284
286
Assert .notNull (publisher , "'publisher' must not be null" );
@@ -289,6 +291,8 @@ private PublisherEntity(@Nullable MultiValueMap<String, String> headers, P publi
289
291
/**
290
292
* Return the element type for the {@code Publisher} body.
291
293
*/
294
+ @ Override
295
+ @ NonNull
292
296
public ResolvableType getResolvableType () {
293
297
return this .resolvableType ;
294
298
}
0 commit comments