Class MediaType
java.lang.Object
org.infinispan.commons.dataconversion.MediaType
@ProtoTypeId(12)
@SerializeWith(MediaTypeExternalizer.class)
public final class MediaType
extends Object
Represent a content type with optional parameters.
- Since:
- 9.2
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MediaType
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed in 14.0.static final String
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed in 14.0.static final MediaType
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed with ISPN-9622static final MediaType
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed with ISPN-9622static final String
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed with ISPN-9622static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, without replacement.static final String
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, without replacement.static final MediaType
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final String
static final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final MediaType
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static MediaType
fromExtension
(String name) static MediaType
fromString
(String tree) getParameter
(String name) getType()
double
int
hashCode()
boolean
boolean
boolean
isBinary()
boolean
boolean
static MediaType
Deprecated, for removal: This API element is subject to removal in a future version.replaced byfromString(java.lang.String)
Parse a comma separated list of media type trees.toString()
toStringExcludingParam
(String... params) Deprecated, for removal: This API element is subject to removal in a future version.UsegetParameters()
andgetTypeSubtype()
to build a custom String representation.withCharset
(Charset charset) withClassType
(Class<?> clazz) withEncoding
(String enc) withParameter
(String name, String value) withParameters
(Map<String, String> parameters)
-
Field Details
-
APPLICATION_OPENMETRICS_TYPE
- See Also:
-
APPLICATION_JAVASCRIPT_TYPE
- See Also:
-
APPLICATION_JSON_TYPE
- See Also:
-
APPLICATION_OCTET_STREAM_TYPE
- See Also:
-
APPLICATION_OBJECT_TYPE
- See Also:
-
APPLICATION_PDF_TYPE
- See Also:
-
APPLICATION_RTF_TYPE
- See Also:
-
APPLICATION_SERIALIZED_OBJECT_TYPE
- See Also:
-
APPLICATION_XML_TYPE
- See Also:
-
APPLICATION_YAML_TYPE
- See Also:
-
APPLICATION_ZIP_TYPE
- See Also:
-
APPLICATION_JBOSS_MARSHALLING_TYPE
- See Also:
-
APPLICATION_PROTOSTREAM_TYPE
- See Also:
-
APPLICATION_UNKNOWN_TYPE
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, without replacement.- See Also:
-
WWW_FORM_URLENCODED_TYPE
- See Also:
-
IMAGE_GIF_TYPE
- See Also:
-
IMAGE_JPEG_TYPE
- See Also:
-
IMAGE_PNG_TYPE
- See Also:
-
MULTIPART_FORM_DATA_TYPE
- See Also:
-
TEXT_CSS_TYPE
- See Also:
-
TEXT_CSV_TYPE
- See Also:
-
TEXT_PLAIN_TYPE
- See Also:
-
TEXT_HTML_TYPE
- See Also:
-
TEXT_EVENT_STREAM_TYPE
- See Also:
-
APPLICATION_INFINISPAN_MARSHALLING_TYPE
@Deprecated(forRemoval=true, since="11.0") public static final String APPLICATION_INFINISPAN_MARSHALLING_TYPEDeprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed with ISPN-9622- See Also:
-
APPLICATION_INFINISPAN_BINARY_TYPE
@Deprecated(forRemoval=true, since="11.0") public static final String APPLICATION_INFINISPAN_BINARY_TYPEDeprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed in 14.0. No longer used for BINARY storage.- See Also:
-
MATCH_ALL_TYPE
- See Also:
-
APPLICATION_OPENMETRICS
-
APPLICATION_JAVASCRIPT
-
APPLICATION_JSON
-
APPLICATION_OCTET_STREAM
-
APPLICATION_OBJECT
-
APPLICATION_SERIALIZED_OBJECT
-
APPLICATION_XML
-
APPLICATION_YAML
-
APPLICATION_PROTOSTREAM
-
APPLICATION_JBOSS_MARSHALLING
-
APPLICATION_INFINISPAN_MARSHALLED
@Deprecated(forRemoval=true, since="11.0") public static final MediaType APPLICATION_INFINISPAN_MARSHALLEDDeprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed with ISPN-9622 -
APPLICATION_WWW_FORM_URLENCODED
-
IMAGE_PNG
-
MULTIPART_FORM_DATA
-
TEXT_PLAIN
-
TEXT_CSS
-
TEXT_CSV
-
TEXT_HTML
-
IMAGE_GIF
-
IMAGE_JPEG
-
TEXT_EVENT_STREAM
-
APPLICATION_INFINISPAN_BINARY
@Deprecated(forRemoval=true, since="11.0") public static final MediaType APPLICATION_INFINISPAN_BINARYDeprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed in 14.0. No longer used for BINARY storage. -
APPLICATION_PDF
-
APPLICATION_RTF
-
APPLICATION_ZIP
-
APPLICATION_INFINISPAN_MARSHALLING
@Deprecated(forRemoval=true, since="11.0") public static final MediaType APPLICATION_INFINISPAN_MARSHALLINGDeprecated, for removal: This API element is subject to removal in a future version.Since 11.0, will be removed with ISPN-9622 -
APPLICATION_UNKNOWN
Deprecated, for removal: This API element is subject to removal in a future version.Since 11.0, without replacement. -
MATCH_ALL
-
BYTE_ARRAY_TYPE
Deprecated, for removal: This API element is subject to removal in a future version. -
HEX
- See Also:
-
BASE_64
- See Also:
-
-
Constructor Details
-
MediaType
-
MediaType
-
MediaType
-
MediaType
-
-
Method Details
-
parse
Deprecated, for removal: This API element is subject to removal in a future version.replaced byfromString(java.lang.String)
-
fromString
-
parseList
Parse a comma separated list of media type trees. -
fromExtension
-
match
-
matchesAll
public boolean matchesAll() -
getTypeSubtype
-
withoutParameters
-
getWeight
public double getWeight() -
getCharset
-
getClassType
-
withClassType
-
withEncoding
-
getEncoding
-
hasStringType
public boolean hasStringType() -
equals
-
hashCode
public int hashCode() -
getType
-
getSubType
-
hasParameters
public boolean hasParameters() -
getParameter
-
getParameters
-
withParameters
-
withCharset
-
withParameter
-
toStringExcludingParam
Deprecated, for removal: This API element is subject to removal in a future version.UsegetParameters()
andgetTypeSubtype()
to build a custom String representation. -
isBinary
public boolean isBinary()- Returns:
- true if the MediaType's java type is a byte array.
-
toString
-