Java org.springframework.http MediaType fields, constructors, methods, implement or subclass

Example usage for Java org.springframework.http MediaType fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.springframework.http MediaType.

The text is from its open source code.

Subclass

org.springframework.http.MediaType has subclasses.
Click this link to see all its subclasses.

Field

MediaTypeALL
Public constant media type that includes all media ranges (i.e.
StringALL_VALUE
A String equivalent of MediaType#ALL .
MediaTypeAPPLICATION_ATOM_XML
Public constant media type for application/atom+xml .
StringAPPLICATION_ATOM_XML_VALUE
A String equivalent of MediaType#APPLICATION_ATOM_XML .
MediaTypeAPPLICATION_FORM_URLENCODED
Public constant media type for application/x-www-form-urlencoded .
StringAPPLICATION_FORM_URLENCODED_VALUE
A String equivalent of MediaType#APPLICATION_FORM_URLENCODED .
MediaTypeAPPLICATION_JSON
Public constant media type for application/json .
StringAPPLICATION_JSON_VALUE
A String equivalent of MediaType#APPLICATION_JSON .
MediaTypeAPPLICATION_JSON_UTF8
Public constant media type for application/json;charset=UTF-8 .
StringAPPLICATION_JSON_UTF8_VALUE
A String equivalent of MediaType#APPLICATION_JSON_UTF8 .
MediaTypeAPPLICATION_OCTET_STREAM
Public constant media type for application/octet-stream .
StringAPPLICATION_OCTET_STREAM_VALUE
A String equivalent of MediaType#APPLICATION_OCTET_STREAM .
MediaTypeAPPLICATION_PDF
Public constant media type for application/pdf .
StringAPPLICATION_PDF_VALUE
A String equivalent of MediaType#APPLICATION_PDF .
MediaTypeAPPLICATION_STREAM_JSON
Public constant media type for application/stream+json .
MediaTypeAPPLICATION_XHTML_XML
Public constant media type for application/xhtml+xml .
StringAPPLICATION_XHTML_XML_VALUE
A String equivalent of MediaType#APPLICATION_XHTML_XML .
MediaTypeAPPLICATION_XML
Public constant media type for application/xml .
StringAPPLICATION_XML_VALUE
A String equivalent of MediaType#APPLICATION_XML .
MediaTypeIMAGE_GIF
Public constant media type for image/gif .
StringIMAGE_GIF_VALUE
A String equivalent of MediaType#IMAGE_GIF .
MediaTypeIMAGE_JPEG
Public constant media type for image/jpeg .
StringIMAGE_JPEG_VALUE
A String equivalent of MediaType#IMAGE_JPEG .
MediaTypeIMAGE_PNG
Public constant media type for image/png .
StringIMAGE_PNG_VALUE
A String equivalent of MediaType#IMAGE_PNG .
MediaTypeMULTIPART_FORM_DATA
Public constant media type for multipart/form-data .
StringMULTIPART_FORM_DATA_VALUE
A String equivalent of MediaType#MULTIPART_FORM_DATA .
MediaTypeTEXT_EVENT_STREAM
Public constant media type for text/event-stream .
StringTEXT_EVENT_STREAM_VALUE
A String equivalent of MediaType#TEXT_EVENT_STREAM .
MediaTypeTEXT_HTML
Public constant media type for text/html .
StringTEXT_HTML_VALUE
A String equivalent of MediaType#TEXT_HTML .
MediaTypeTEXT_PLAIN
Public constant media type for text/plain .
StringTEXT_PLAIN_VALUE
A String equivalent of MediaType#TEXT_PLAIN .
MediaTypeTEXT_XML
Public constant media type for text/xml .
StringTEXT_XML_VALUE
A String equivalent of MediaType#TEXT_XML .
ComparatorQUALITY_VALUE_COMPARATOR
Comparator used by #sortByQualityValue(List) .
ComparatorSPECIFICITY_COMPARATOR
Comparator used by #sortBySpecificity(List) .

Constructor

MediaType(String type, String subtype)
Create a new MediaType for the given primary type and subtype.
MediaType(MediaType other, Charset charset)
Copy-constructor that copies the type, subtype and parameters of the given MediaType , and allows to set the specified character set.
MediaType(MediaType other, @Nullable Map parameters)
Copy-constructor that copies the type and subtype of the given MediaType , and allows for different parameters.
MediaType(String type, String subtype, Charset charset)
Create a new MediaType for the given type, subtype, and character set.
MediaType(String type, String subtype, double qualityValue)
Create a new MediaType for the given type, subtype, and quality value.
MediaType(String type, String subtype, @Nullable Map parameters)
Create a new MediaType for the given type, subtype, and parameters.
MediaType(String type)
Create a new MediaType for the given primary type.

Method

ListasMediaTypes(List mimeTypes)
Re-create the given mime types as media types.
MediaTypecopyQualityValue(MediaType mediaType)
Return a replica of this instance with the quality value of the given MediaType .
booleanequals(@Nullable Object other)
CharsetgetCharset()
Return the character set, as indicated by a charset parameter, if any.
StringgetParameter(String name)
Return a generic parameter value, given a parameter name.
MapgetParameters()
Return all generic parameter values.
doublegetQualityValue()
Return the quality factor, as indicated by a q parameter, if any.
StringgetSubtype()
Return the subtype.
StringgetType()
Return the primary type.
booleanincludes(@Nullable MediaType other)
Indicate whether this MediaType includes the given media type.
booleanisCompatibleWith(@Nullable MediaType other)
Indicate whether this MediaType is compatible with the given media type.
booleanisConcrete()
Indicates whether this MIME Type is concrete, i.e.
booleanisWildcardSubtype()
Indicates whether the #getSubtype() subtype is the wildcard character * or the wildcard character followed by a suffix (e.g.
booleanisWildcardType()
Indicates whether the #getType() type is the wildcard character * or not.
MediaTypeparseMediaType(String mediaType)
Parse the given String into a single MediaType .
ListparseMediaTypes(@Nullable String mediaTypes)
Parse the comma-separated string into a list of MediaType objects.
ListparseMediaTypes(@Nullable List mediaTypes)
Parse the given list of (potentially) comma-separated strings into a list of MediaType objects.
MediaTyperemoveQualityValue()
Return a replica of this instance with its quality value removed.
voidsortByQualityValue(List mediaTypes)
Sorts the given list of MediaType objects by quality value.
voidsortBySpecificity(List mediaTypes)
Sorts the given list of MediaType objects by specificity.
voidsortBySpecificityAndQuality(List mediaTypes)
Sorts the given list of MediaType objects by specificity as the primary criteria and quality value the secondary.
StringtoString()
StringtoString(Collection mediaTypes)
Return a string representation of the given list of MediaType objects.
MediaTypevalueOf(String value)
Parse the given String value into a MediaType object, with this method name following the 'valueOf' naming convention (as supported by org.springframework.core.convert.ConversionService .