-
-
Method Summary
Modifier and Type Method Description static MediaTypeparse(String string)Returns a media type for {@code string}, or null if{@code string}is not a well-formed mediatype.Stringtype()Returns the high-level media type, such as "text", "image", "audio", "video", or"application". Stringsubtype()Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml". Charsetcharset()Returns the charset of this media type, or null if this media type doesn't specify a charset. Charsetcharset(@Nullable() Charset defaultValue)Returns the charset of this media type, or {@code defaultValue}if either this media typedoesn't specify a charset, of it its charset is unsupported by the current runtime.StringtoString()Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in aContent-Type header. booleanequals(@Nullable() Object other)inthashCode()-
-
Method Detail
-
parse
@Nullable() static MediaType parse(String string)
Returns a media type for
{@code string}, or null if{@code string}is not a well-formed mediatype.
-
type
String type()
Returns the high-level media type, such as "text", "image", "audio", "video", or"application".
-
subtype
String subtype()
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
-
charset
@Nullable() Charset charset()
Returns the charset of this media type, or null if this media type doesn't specify a charset.
-
charset
@Nullable() Charset charset(@Nullable() Charset defaultValue)
Returns the charset of this media type, or
{@code defaultValue}if either this media typedoesn't specify a charset, of it its charset is unsupported by the current runtime.
-
toString
String toString()
Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in aContent-Type header.
-
hashCode
int hashCode()
-
-
-
-