public final class MediaType
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
java.nio.charset.Charset |
charset()
Returns the charset of this media type, or null if this media type doesn't specify a charset.
|
java.nio.charset.Charset |
charset(java.nio.charset.Charset defaultValue)
Returns the charset of this media type, or
defaultValue if this media type doesn't
specify a charset. |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
static MediaType |
parse(java.lang.String string)
Returns a media type for
string, or null if string is not a well-formed media
type. |
java.lang.String |
subtype()
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
|
java.lang.String |
toString()
Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in a
Content-Type header.
|
java.lang.String |
type()
Returns the high-level media type, such as "text", "image", "audio", "video", or
"application".
|
public static MediaType parse(java.lang.String string)
string, or null if string is not a well-formed media
type.public java.lang.String type()
public java.lang.String subtype()
public java.nio.charset.Charset charset()
public java.nio.charset.Charset charset(java.nio.charset.Charset defaultValue)
defaultValue if this media type doesn't
specify a charset.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2016. All Rights Reserved.