public class FixedContentNegotiationStrategy extends java.lang.Object implements ContentNegotiationStrategy
ContentNegotiationStrategy
that returns a fixed content type.Modifier and Type | Field and Description |
---|---|
private java.util.List<MediaType> |
contentType |
private static Log |
logger |
Constructor and Description |
---|
FixedContentNegotiationStrategy(MediaType contentType)
Create an instance with the given content type.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
resolveMediaTypes(NativeWebRequest request)
Resolve the given request to a list of media types.
|
private static final Log logger
private final java.util.List<MediaType> contentType
public FixedContentNegotiationStrategy(MediaType contentType)
public java.util.List<MediaType> resolveMediaTypes(NativeWebRequest request)
ContentNegotiationStrategy
resolveMediaTypes
in interface ContentNegotiationStrategy
request
- the current requestnull
)