public interface Content extends Constructible, Map<String,MediaType>
A map to assist describing the media types for an operation's parameter or response.
Modifier and Type | Method and Description |
---|---|
Content |
addMediaType(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.1
|
MediaType |
get(Object key)
Deprecated.
since 1.1
|
default MediaType |
getMediaType(String name)
Returns a media type for a given name.
|
Map<String,MediaType> |
getMediaTypes()
Returns a copy map (potentially immutable) of media types.
|
default boolean |
hasMediaType(String name)
Check whether a media type is present in the map.
|
MediaType |
put(String key,
MediaType value)
Deprecated.
since 1.1
|
void |
putAll(Map<? extends String,? extends MediaType> m)
Deprecated.
since 1.1
|
MediaType |
remove(Object key)
Deprecated.
since 1.1
|
void |
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 Content
|
clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
Content addMediaType(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(String name)
name
- a path name that will be removed.Map<String,MediaType> getMediaTypes()
void setMediaTypes(Map<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(String name)
getMediaTypes().containsKey(name)
name
- the name of a media type e.g. application/json.default MediaType getMediaType(String name)
getMediaTypes().get(name)
name
- the name of a media type e.g. application/json.@Deprecated MediaType get(Object key)
Content
will no longer extends Map
, this method will no longer be present.
Use getMediaType(String)
instead.@Deprecated boolean containsKey(Object key)
Content
will no longer extends Map
, this method will no longer be present.
Use hasMediaType(String)
instead.containsKey
in interface Map<String,MediaType>
@Deprecated MediaType put(String key, MediaType value)
Content
will no longer extends Map
, this method will no longer be present.
Use addMediaType(String, MediaType)
instead.@Deprecated void putAll(Map<? extends String,? extends MediaType> m)
Content
will no longer extends Map
, this method will no longer be present.
Use setMediaTypes(Map)
instead.@Deprecated MediaType remove(Object key)
Content
will no longer extends Map
, this method will no longer be present.
Use removeMediaType(String)
instead.Copyright © 2017 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.