True when this media-type is not character-based.
True when this media-type is not character-based.
Java API
Java API
True when this media-type is generally compressible.
The main-type of this media-type.
Java API
Java API
The sub-type of this media-type.
Creates a media-range from this media-type with a given qValue.
JAVA API
Constructs a ContentTypeRange
from this instance and the given charset.
Constructs a ContentTypeRange
from this instance and the given charset.
truncates Double qValue to float and returns a new instance with this qValue set
truncates Double qValue to float and returns a new instance with this qValue set
(mediaType: MediaRange).isApplication
(mediaType: MediaRange).isAudio
(mediaType: MediaRange).isImage
(mediaType: MediaRange).isMessage
(mediaType: MediaRange).isMultipart
(mediaType: MediaRange).isText
(mediaType: MediaRange).isVideo
(mediaType: MediaRange).mainType()
(mediaType: MediaRange).params
(mediaType: MediaRange).value
Returns a copy of this instance with the params replaced by the given ones.
Returns a copy of this instance with the params replaced by the given ones.
If the given map contains a "q" value the qValue
member is (also) updated.
(mediaType: MediaRange).withParams(params)
truncates Double qValue to float and returns a new instance with this qValue set
truncates Double qValue to float and returns a new instance with this qValue set
(mediaType: MediaRange).withQValue(qValue)
(mediaType: MediaRange).withQValue(qValue)
A MediaType describes the type of the content of an HTTP message entity.
While knowledge of the MediaType alone suffices for being able to properly interpret binary content this is not generally the case for non-binary (i.e. character-based) content, which also requires the definition of a specific character encoding (HttpCharset). Therefore MediaType instances are frequently encountered as a member of a ContentType, which groups a MediaType with a potentially required HttpCharset to hold everything required for being able to interpret an HttpEntity.
MediaTypes come in three basic forms:
1. Binary: These do not need an additional HttpCharset to be able to form a ContentType. Therefore they can be implicitly converted to the latter.
2. WithOpenCharset: Most character-based MediaTypes are of this form, which can be combined with all HttpCharset instances to form a ContentType.
3. WithFixedCharset: Some character-based MediaTypes prescribe a single, clearly defined charset and as such, similarly to binary MediaTypes, do not require the addition of an HttpCharset instances to form a ContentType. The most prominent example is probably
application/json
which must always be UTF-8 encoded. Like binary MediaTypesWithFixedCharset
types can be implicitly converted to a ContentType.Not for user extension.