Class MediaType
- java.lang.Object
-
- org.infinispan.commons.dataconversion.MediaType
-
@ProtoTypeId(128) @SerializeWith(MediaTypeExternalizer.class) public final class MediaType extends java.lang.Object
Represent a content type with optional parameters.- Since:
- 9.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMediaType.MediaTypeExternalizer
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static MediaTypefromString(java.lang.String tree)java.nio.charset.CharsetgetCharset()java.lang.StringgetClassType()java.util.Optional<java.lang.String>getParameter(java.lang.String name)java.util.Map<java.lang.String,java.lang.String>getParameters()java.lang.StringgetSubType()java.lang.StringgetType()java.lang.StringgetTypeSubtype()doublegetWeight()inthashCode()booleanhasParameters()booleanhasStringType()booleanmatch(MediaType other)booleanmatchesAll()static MediaTypeparse(java.lang.String str)Deprecated.replaced byfromString(java.lang.String)static java.util.stream.Stream<MediaType>parseList(java.lang.String mediaTypeList)Parse a comma separated list of media type trees.java.lang.StringtoString()java.lang.StringtoStringExcludingParam(java.lang.String... params)MediaTypewithCharset(java.nio.charset.Charset charset)MediaTypewithClassType(java.lang.Class<?> clazz)MediaTypewithoutParameters()MediaTypewithParameter(java.lang.String name, java.lang.String value)MediaTypewithParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
-
-
-
Field Detail
-
APPLICATION_JSON_TYPE
public static final java.lang.String APPLICATION_JSON_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_OCTET_STREAM_TYPE
public static final java.lang.String APPLICATION_OCTET_STREAM_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_OBJECT_TYPE
public static final java.lang.String APPLICATION_OBJECT_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_PDF_TYPE
public static final java.lang.String APPLICATION_PDF_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_RTF_TYPE
public static final java.lang.String APPLICATION_RTF_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_SERIALIZED_OBJECT_TYPE
public static final java.lang.String APPLICATION_SERIALIZED_OBJECT_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_XML_TYPE
public static final java.lang.String APPLICATION_XML_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_ZIP_TYPE
public static final java.lang.String APPLICATION_ZIP_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_JBOSS_MARSHALLING_TYPE
public static final java.lang.String APPLICATION_JBOSS_MARSHALLING_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_PROTOSTREAM_TYPE
public static final java.lang.String APPLICATION_PROTOSTREAM_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_UNKNOWN_TYPE
public static final java.lang.String APPLICATION_UNKNOWN_TYPE
- See Also:
- Constant Field Values
-
WWW_FORM_URLENCODED_TYPE
public static final java.lang.String WWW_FORM_URLENCODED_TYPE
- See Also:
- Constant Field Values
-
IMAGE_GIF_TYPE
public static final java.lang.String IMAGE_GIF_TYPE
- See Also:
- Constant Field Values
-
IMAGE_JPEG_TYPE
public static final java.lang.String IMAGE_JPEG_TYPE
- See Also:
- Constant Field Values
-
IMAGE_PNG_TYPE
public static final java.lang.String IMAGE_PNG_TYPE
- See Also:
- Constant Field Values
-
TEXT_CSS_TYPE
public static final java.lang.String TEXT_CSS_TYPE
- See Also:
- Constant Field Values
-
TEXT_CSV_TYPE
public static final java.lang.String TEXT_CSV_TYPE
- See Also:
- Constant Field Values
-
TEXT_PLAIN_TYPE
public static final java.lang.String TEXT_PLAIN_TYPE
- See Also:
- Constant Field Values
-
TEXT_HTML_TYPE
public static final java.lang.String TEXT_HTML_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_INFINISPAN_MARSHALLING_TYPE
public static final java.lang.String APPLICATION_INFINISPAN_MARSHALLING_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_INFINISPAN_BINARY_TYPE
public static final java.lang.String APPLICATION_INFINISPAN_BINARY_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_PROTOSTUFF_TYPE
public static final java.lang.String APPLICATION_PROTOSTUFF_TYPE
- See Also:
- Constant Field Values
-
APPLICATION_KRYO_TYPE
public static final java.lang.String APPLICATION_KRYO_TYPE
- See Also:
- Constant Field Values
-
MATCH_ALL_TYPE
public static final java.lang.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
-
parse
@Deprecated public static MediaType parse(java.lang.String str)
Deprecated.replaced byfromString(java.lang.String)
-
fromString
@ProtoFactory public static MediaType fromString(java.lang.String tree)
-
parseList
public static java.util.stream.Stream<MediaType> parseList(java.lang.String mediaTypeList)
Parse a comma separated list of media type trees.
-
match
public boolean match(MediaType other)
-
matchesAll
public boolean matchesAll()
-
getTypeSubtype
public java.lang.String getTypeSubtype()
-
withoutParameters
public MediaType withoutParameters()
-
getWeight
public double getWeight()
-
getCharset
public java.nio.charset.Charset getCharset()
-
getClassType
public java.lang.String getClassType()
-
withClassType
public MediaType withClassType(java.lang.Class<?> clazz)
-
hasStringType
public boolean hasStringType()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getType
public java.lang.String getType()
-
getSubType
public java.lang.String getSubType()
-
hasParameters
public boolean hasParameters()
-
getParameter
public java.util.Optional<java.lang.String> getParameter(java.lang.String name)
-
getParameters
public java.util.Map<java.lang.String,java.lang.String> getParameters()
-
withParameters
public MediaType withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
-
withCharset
public MediaType withCharset(java.nio.charset.Charset charset)
-
withParameter
public MediaType withParameter(java.lang.String name, java.lang.String value)
-
toStringExcludingParam
public java.lang.String toStringExcludingParam(java.lang.String... params)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-