public class FixedContentNegotiationStrategy extends Object implements ContentNegotiationStrategy
ContentNegotiationStrategy
that returns a fixed content type.MEDIA_TYPE_ALL_LIST
Constructor and Description |
---|
FixedContentNegotiationStrategy(List<MediaType> contentTypes)
Constructor with an ordered List of default
MediaType 's to return
for use in applications that support a variety of content types. |
FixedContentNegotiationStrategy(MediaType contentType)
Constructor with a single default
MediaType . |
Modifier and Type | Method and Description |
---|---|
List<MediaType> |
getContentTypes()
Return the configured list of media types.
|
List<MediaType> |
resolveMediaTypes(NativeWebRequest request)
Resolve the given request to a list of media types.
|
public FixedContentNegotiationStrategy(MediaType contentType)
MediaType
.public FixedContentNegotiationStrategy(List<MediaType> contentTypes)
MediaType
's to return
for use in applications that support a variety of content types.
Consider appending MediaType.ALL
at the end if destinations
are present which do not support any of the other default media types.
public List<MediaType> resolveMediaTypes(NativeWebRequest request)
ContentNegotiationStrategy
resolveMediaTypes
in interface ContentNegotiationStrategy
request
- the current requestContentNegotiationStrategy.MEDIA_TYPE_ALL_LIST
if none
were requested.