public interface Content extends Constructible
A map to assist describing the media types for an operation's parameter or response.
Modifier and Type | Method and Description |
---|---|
Content |
addMediaType(java.lang.String name,
MediaType mediaType)
Adds the MediaType for this Content, where the key is the name of the MediaType and the value is the object that
describes the content passed into or returned from an operation.
|
default MediaType |
getMediaType(java.lang.String name)
Returns a media type for a given name.
|
java.util.Map<java.lang.String,MediaType> |
getMediaTypes()
Returns a copy map (potentially immutable) of media types.
|
default boolean |
hasMediaType(java.lang.String name)
Check whether a media type is present in the map.
|
void |
removeMediaType(java.lang.String name)
Removes the given MediaType for this Content by its name.
|
void |
setMediaTypes(java.util.Map<java.lang.String,MediaType> mediaTypes)
Set the media types map to this Content
|
Content addMediaType(java.lang.String name, MediaType mediaType)
name
- the name of a media type e.g. application/json.mediaType
- an object that describes the content passed into or returned from an operation. null values will be
rejected (implementation will throw an exception) or ignored.void removeMediaType(java.lang.String name)
name
- a path name that will be removed.java.util.Map<java.lang.String,MediaType> getMediaTypes()
void setMediaTypes(java.util.Map<java.lang.String,MediaType> mediaTypes)
mediaTypes
- a map containing the list of media types. Keys are name of a media type e.g. application/json.default boolean hasMediaType(java.lang.String name)
getMediaTypes().containsKey(name)
name
- the name of a media type e.g. application/json.default MediaType getMediaType(java.lang.String name)
getMediaTypes().get(name)
name
- the name of a media type e.g. application/json.