1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
25
25
26
26
import org .springframework .core .ParameterizedTypeReference ;
27
27
import org .springframework .core .ResolvableType ;
28
+ import org .springframework .core .ResolvableTypeProvider ;
28
29
import org .springframework .http .HttpEntity ;
29
30
import org .springframework .http .HttpHeaders ;
30
31
import org .springframework .http .MediaType ;
32
+ import org .springframework .lang .NonNull ;
31
33
import org .springframework .lang .Nullable ;
32
34
import org .springframework .util .Assert ;
33
35
import org .springframework .util .LinkedMultiValueMap ;
@@ -263,13 +265,13 @@ public HttpEntity<?> build() {
263
265
* @param <T> the type contained in the publisher
264
266
* @param <P> the publisher
265
267
*/
266
- public static final class PublisherEntity <T , P extends Publisher <T >> extends HttpEntity <P > {
268
+ public static final class PublisherEntity <T , P extends Publisher <T >> extends HttpEntity <P >
269
+ implements ResolvableTypeProvider {
267
270
268
271
private final ResolvableType resolvableType ;
269
272
270
-
271
- private PublisherEntity (@ Nullable MultiValueMap <String , String > headers , P publisher ,
272
- ResolvableType resolvableType ) {
273
+ PublisherEntity (
274
+ @ Nullable MultiValueMap <String , String > headers , P publisher , ResolvableType resolvableType ) {
273
275
274
276
super (publisher , headers );
275
277
Assert .notNull (publisher , "'publisher' must not be null" );
@@ -280,6 +282,8 @@ private PublisherEntity(@Nullable MultiValueMap<String, String> headers, P publi
280
282
/**
281
283
* Return the element type for the {@code Publisher} body.
282
284
*/
285
+ @ Override
286
+ @ NonNull
283
287
public ResolvableType getResolvableType () {
284
288
return this .resolvableType ;
285
289
}
0 commit comments