public interface MediaType extends Constructible, Extensible
Each Media Type Object provides a schema and examples for the media type identified by its key.
Modifier and Type | Method and Description |
---|---|
MediaType |
addEncoding(String key,
Encoding encodingItem)
Adds an Encoding item to the encoding property of a MediaType instance.
|
MediaType |
addExample(String key,
Example example)
Adds an example item to the examples map of a MediaType instance.
|
MediaType |
encoding(Map<String,Encoding> encoding)
Sets encoding property of a MediaType instance to the given map object.
|
MediaType |
example(Object example)
Sets the example property of a MediaType instance to the given value.
|
MediaType |
examples(Map<String,Example> examples)
Sets the examples field of a MediaType instance to the given map object.
|
Map<String,Encoding> |
getEncoding()
Returns the encoding property from a MediaType instance.
|
Object |
getExample()
Returns the example property from a MediaType instance.
|
Map<String,Example> |
getExamples()
Returns the collection of examples from a MediaType instance.
|
Schema |
getSchema()
Returns the schema property from a MediaType instance.
|
MediaType |
schema(Schema schema)
Sets the schema field of a MediaType instance to the given schema object.
|
void |
setEncoding(Map<String,Encoding> encoding)
Sets encoding property of a MediaType instance to the given map object.
|
void |
setExample(Object example)
Sets the example property of a MediaType instance to the given value.
|
void |
setExamples(Map<String,Example> examples)
Sets the examples field of a MediaType instance to the given map object.
|
void |
setSchema(Schema schema)
Sets the schema field of a MediaType instance to the given schema object.
|
addExtension, getExtensions, setExtensions
Schema getSchema()
void setSchema(Schema schema)
schema
- the schema defining the type used for the request bodyMediaType schema(Schema schema)
schema
- the schema defining the type used for the request bodyMap<String,Example> getExamples()
void setExamples(Map<String,Example> examples)
examples
- examples of the media typeMediaType examples(Map<String,Example> examples)
examples
- examples of the media typeMediaType addExample(String key, Example example)
key
- any unique name to identify the example objectexample
- an example of a media typeObject getExample()
void setExample(Object example)
example
- an example of the media typeMediaType example(Object example)
example
- an example of the media typeMap<String,Encoding> getEncoding()
void setEncoding(Map<String,Encoding> encoding)
encoding
- a map between property names and their encoding informationMediaType encoding(Map<String,Encoding> encoding)
encoding
- a map between property names and their encoding informationCopyright © 2017–2018 Eclipse MicroProfile. All rights reserved.