A map to assist describing the media types for an operation's parameter or response.
| Modifier and Type | Method and Description |
|---|---|
| public Content | Returns: the current Content instancethe name of a media type e.g. application/json. name, 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. 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. |
| public default MediaType | Returns: the corresponding media type or null.the name of a media type e.g. application/json. name)Returns a media type for a given name. |
| public Map | |
| public default boolean | Returns: a boolean to indicate if the media type is present or not.the name of a media type e.g. application/json. name)Check whether a media type is present in the map. |
| public void | removeMediaType(String
a path name that will be removed. name)Removes the given MediaType for this Content by its name. |
| public void | setMediaTypes(Map<String, MediaType>
a map containing the list of media types. Keys are name of a media type e.g. application/json. mediaTypes)Set the media types map to this Content |
| addMediaType | back to summary |
|---|---|
| public 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. | |
| getMediaType | back to summary |
|---|---|
| public default MediaType getMediaType(String name) Returns a media type for a given name. This is a convenience method for | |
| getMediaTypes | back to summary |
|---|---|
| public Map Returns a copy map (potentially immutable) of media types. | |
| hasMediaType | back to summary |
|---|---|
| public default boolean hasMediaType(String name) Check whether a media type is present in the map. This is a convenience method for
| |
| removeMediaType | back to summary |
|---|---|
| public void removeMediaType(String name) Removes the given MediaType for this Content by its name.
| |
| setMediaTypes | back to summary |
|---|---|
| public void setMediaTypes(Map<String, MediaType> mediaTypes) Set the media types map to this Content | |