Interface Content
- All Superinterfaces:
Constructible
,Map<String,
MediaType>
Content
A map to assist describing the media types for an operation's parameter or response.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddMediaType
(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.boolean
containsKey
(Object key) Deprecated.since 1.1Deprecated.since 1.1default MediaType
getMediaType
(String name) Returns a media type for a given name.Returns a copy map (potentially immutable) of media types.default boolean
hasMediaType
(String name) Check whether a media type is present in the map.Deprecated.since 1.1void
Deprecated.since 1.1Deprecated.since 1.1void
removeMediaType
(String name) Removes the given MediaType for this Content by its name.void
setMediaTypes
(Map<String, MediaType> mediaTypes) Set the media types map to this ContentMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Method Details
-
addMediaType
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.- Parameters:
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.- Returns:
- the current Content instance
-
removeMediaType
Removes the given MediaType for this Content by its name.- Parameters:
name
- a path name that will be removed.
-
getMediaTypes
Returns a copy map (potentially immutable) of media types.- Returns:
- all items
-
setMediaTypes
Set the media types map to this Content- Parameters:
mediaTypes
- a map containing the list of media types. Keys are name of a media type e.g. application/json.
-
hasMediaType
Check whether a media type is present in the map. This is a convenience method forgetMediaTypes().containsKey(name)
- Parameters:
name
- the name of a media type e.g. application/json.- Returns:
- a boolean to indicate if the media type is present or not.
-
getMediaType
Returns a media type for a given name. This is a convenience method forgetMediaTypes().get(name)
- Parameters:
name
- the name of a media type e.g. application/json.- Returns:
- the corresponding media type or null.
-
get
Deprecated.since 1.1In the next version,Content
will no longer extendsMap
, this method will no longer be present. UsegetMediaType(String)
instead. -
containsKey
Deprecated.since 1.1In the next version,Content
will no longer extendsMap
, this method will no longer be present. UsehasMediaType(String)
instead.- Specified by:
containsKey
in interfaceMap<String,
MediaType>
-
put
Deprecated.since 1.1In the next version,Content
will no longer extendsMap
, this method will no longer be present. UseaddMediaType(String, MediaType)
instead. -
putAll
Deprecated.since 1.1In the next version,Content
will no longer extendsMap
, this method will no longer be present. UsesetMediaTypes(Map)
instead. -
remove
Deprecated.since 1.1In the next version,Content
will no longer extendsMap
, this method will no longer be present. UseremoveMediaType(String)
instead.
-