Class MediaType
- java.lang.Object
-
- org.infinispan.commons.dataconversion.MediaType
-
@SerializeWith(MediaTypeExternalizer.class) public final class MediaType extends Object
Represent a content type with optional parameters.- Since:
- 9.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MediaType.MediaTypeExternalizer
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static MediaType
fromString(String mediaType)
Charset
getCharset()
String
getClassType()
Optional<String>
getParameter(String name)
Map<String,String>
getParameters()
String
getSubType()
String
getType()
String
getTypeSubtype()
double
getWeight()
int
hashCode()
boolean
hasParameters()
boolean
hasStringType()
boolean
match(MediaType other)
boolean
matchesAll()
static MediaType
parse(String str)
static Stream<MediaType>
parseList(String mediaTypeList)
String
toString()
String
toStringExcludingParam(String... params)
MediaType
withCharset(Charset charset)
MediaType
withClassType(Class<?> clazz)
MediaType
withoutParameters()
MediaType
withParameter(String name, String value)
MediaType
withParameters(Map<String,String> parameters)
-
-
-
Field Detail
-
APPLICATION_JSON_TYPE
public static final String APPLICATION_JSON_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_OCTET_STREAM_TYPE
public static final String APPLICATION_OCTET_STREAM_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_OBJECT_TYPE
public static final String APPLICATION_OBJECT_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_PDF_TYPE
public static final String APPLICATION_PDF_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_RTF_TYPE
public static final String APPLICATION_RTF_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_SERIALIZED_OBJECT_TYPE
public static final String APPLICATION_SERIALIZED_OBJECT_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_XML_TYPE
public static final String APPLICATION_XML_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_ZIP_TYPE
public static final String APPLICATION_ZIP_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_JBOSS_MARSHALLING_TYPE
public static final String APPLICATION_JBOSS_MARSHALLING_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_PROTOSTREAM_TYPE
public static final String APPLICATION_PROTOSTREAM_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_UNKNOWN_TYPE
public static final String APPLICATION_UNKNOWN_TYPE
- See Also:
- Constant Field Values
-
WWW_FORM_URLENCODED_TYPE
public static final String WWW_FORM_URLENCODED_TYPE
- See Also:
- Constant Field Values
-
IMAGE_GIF_TYPE
public static final String IMAGE_GIF_TYPE
- See Also:
- Constant Field Values
-
IMAGE_JPEG_TYPE
public static final String IMAGE_JPEG_TYPE
- See Also:
- Constant Field Values
-
IMAGE_PNG_TYPE
public static final String IMAGE_PNG_TYPE
- See Also:
- Constant Field Values
-
TEXT_CSS_TYPE
public static final String TEXT_CSS_TYPE
- See Also:
- Constant Field Values
-
TEXT_CSV_TYPE
public static final String TEXT_CSV_TYPE
- See Also:
- Constant Field Values
-
TEXT_PLAIN_TYPE
public static final String TEXT_PLAIN_TYPE
- See Also:
- Constant Field Values
-
TEXT_HTML_TYPE
public static final String TEXT_HTML_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_INFINISPAN_MARSHALLING_TYPE
public static final String APPLICATION_INFINISPAN_MARSHALLING_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_INFINISPAN_BINARY_TYPE
public static final String APPLICATION_INFINISPAN_BINARY_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_PROTOSTUFF_TYPE
public static final String APPLICATION_PROTOSTUFF_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_KRYO_TYPE
public static final String APPLICATION_KRYO_TYPE
- See Also:
- Constant Field Values
-
MATCH_ALL_TYPE
public static final String MATCH_ALL_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_JSON
public static MediaType APPLICATION_JSON
-
APPLICATION_OCTET_STREAM
public static MediaType APPLICATION_OCTET_STREAM
-
APPLICATION_OBJECT
public static MediaType APPLICATION_OBJECT
-
APPLICATION_SERIALIZED_OBJECT
public static MediaType APPLICATION_SERIALIZED_OBJECT
-
APPLICATION_XML
public static MediaType APPLICATION_XML
-
APPLICATION_PROTOSTREAM
public static MediaType APPLICATION_PROTOSTREAM
-
APPLICATION_JBOSS_MARSHALLING
public static MediaType APPLICATION_JBOSS_MARSHALLING
-
APPLICATION_INFINISPAN_MARSHALLED
public static MediaType APPLICATION_INFINISPAN_MARSHALLED
-
APPLICATION_WWW_FORM_URLENCODED
public static MediaType APPLICATION_WWW_FORM_URLENCODED
-
IMAGE_PNG
public static MediaType IMAGE_PNG
-
TEXT_PLAIN
public static MediaType TEXT_PLAIN
-
TEXT_CSS
public static MediaType TEXT_CSS
-
TEXT_CSV
public static MediaType TEXT_CSV
-
TEXT_HTML
public static MediaType TEXT_HTML
-
IMAGE_GIF
public static MediaType IMAGE_GIF
-
IMAGE_JPEG
public static MediaType IMAGE_JPEG
-
APPLICATION_PROTOSTUFF
public static MediaType APPLICATION_PROTOSTUFF
-
APPLICATION_KRYO
public static MediaType APPLICATION_KRYO
-
APPLICATION_INFINISPAN_BINARY
public static MediaType APPLICATION_INFINISPAN_BINARY
-
APPLICATION_PDF
public static MediaType APPLICATION_PDF
-
APPLICATION_RTF
public static MediaType APPLICATION_RTF
-
APPLICATION_ZIP
public static MediaType APPLICATION_ZIP
-
APPLICATION_INFINISPAN_MARSHALLING
public static MediaType APPLICATION_INFINISPAN_MARSHALLING
-
APPLICATION_UNKNOWN
public static MediaType APPLICATION_UNKNOWN
-
MATCH_ALL
public static MediaType MATCH_ALL
-
-
Method Detail
-
match
public boolean match(MediaType other)
-
matchesAll
public boolean matchesAll()
-
getTypeSubtype
public String getTypeSubtype()
-
withoutParameters
public MediaType withoutParameters()
-
getWeight
public double getWeight()
-
getCharset
public Charset getCharset()
-
getClassType
public String getClassType()
-
hasStringType
public boolean hasStringType()
-
getType
public String getType()
-
getSubType
public String getSubType()
-
hasParameters
public boolean hasParameters()
-
-