Each Media Type Object provides a schema and examples for the media type identified by its key.
| Modifier and Type | Method and Description |
|---|---|
| public MediaType | Returns: the current MediaType instancea property name in the schema key, Encoding an encoding definition to apply to the schema property. null values will be rejected (implementation
will throw an exception) or ignored. encodingItem)Adds an Encoding item to the encoding property of a MediaType instance. |
| public MediaType | Returns: the current MediaType instanceany unique name to identify the example object key, Example an example of a media type. null values will be rejected (implementation will throw an exception) or
ignored. example)Adds an example item to the examples map of a MediaType instance. |
| public default MediaType | |
| public default MediaType | |
| public default MediaType | |
| public Map | Returns: a copy Map (potentially immutable) between a property name and its encoding informationReturns the encoding property from a MediaType instance. |
| public Object | Returns: an example of the media typeReturns the example property from a MediaType instance. |
| public Map | Returns: a copy Map (potentially immutable) of examples of the media typeReturns the collection of examples from a MediaType instance. |
| public Schema | Returns: the schema defining the type used for the request bodyReturns the schema property from a MediaType instance. |
| public void | removeEncoding(String
a property name in the schema key)Removes an Encoding item to the encoding property of a MediaType instance. |
| public void | removeExample(String
any unique name to identify the example object key)Removes an example item to the examples map of a MediaType instance. |
| public default MediaType | |
| public void | setEncoding(Map<String, Encoding>
a map between property names and their encoding information encoding)Sets encoding property of a MediaType instance to the given map object. |
| public void | setExample(Object
an example of the media type example)Sets the example property of a MediaType instance to the given value. |
| public void | setExamples(Map<String, Example>
examples of the media type examples)Sets the examples field of a MediaType instance to the given map object. |
| public void |
| addEncoding | back to summary |
|---|---|
| public MediaType addEncoding(String key, Encoding encodingItem) Adds an Encoding item to the encoding property of a MediaType instance. | |
| addExample | back to summary |
|---|---|
| public MediaType addExample(String key, Example example) Adds an example item to the examples map of a MediaType instance. The example object should match the media type and specified schema if present. | |
| encoding | back to summary |
|---|---|
| public default MediaType encoding(Map<String, Encoding> encoding) Sets encoding property of a MediaType instance to the given map object. | |
| example | back to summary |
|---|---|
| public default MediaType example(Object example) Sets the example property of a MediaType instance to the given value. The example object should be in the correct format as specified by the media type. The example object is mutually exclusive of the examples object. | |
| examples | back to summary |
|---|---|
| public default MediaType examples(Map<String, Example> examples) Sets the examples field of a MediaType instance to the given map object. Each example object should match the media type and specified schema if present. The example object is mutually exclusive of the examples object. | |
| getEncoding | back to summary |
|---|---|
| public Map Returns the encoding property from a MediaType instance. | |
| getExample | back to summary |
|---|---|
| public Object getExample() Returns the example property from a MediaType instance.
| |
| getExamples | back to summary |
|---|---|
| public Map Returns the collection of examples from a MediaType instance. | |
| getSchema | back to summary |
|---|---|
| public Schema getSchema() Returns the schema property from a MediaType instance.
| |
| removeEncoding | back to summary |
|---|---|
| public void removeEncoding(String key) Removes an Encoding item to the encoding property of a MediaType instance.
| |
| removeExample | back to summary |
|---|---|
| public void removeExample(String key) Removes an example item to the examples map of a MediaType instance. The example object should match the media type and specified schema if present.
| |
| schema | back to summary |
|---|---|
| public default MediaType schema(Schema schema) Sets the schema field of a MediaType instance to the given schema object. | |
| setEncoding | back to summary |
|---|---|
| public void setEncoding(Map<String, Encoding> encoding) Sets encoding property of a MediaType instance to the given map object. | |
| setExample | back to summary |
|---|---|
| public void setExample(Object example) Sets the example property of a MediaType instance to the given value. The example object should be in the correct format as specified by the media type. The example object is mutually exclusive of the examples object.
| |
| setExamples | back to summary |
|---|---|
| public void setExamples(Map<String, Example> examples) Sets the examples field of a MediaType instance to the given map object. Each example object should match the media type and specified schema if present. The example object is mutually exclusive of the examples object. | |
| setSchema | back to summary |
|---|---|
| public void setSchema(Schema schema) Sets the schema field of a MediaType instance to the given schema object.
| |