| Modifier and Type | Method and Description |
|---|---|
Optional<Charset> |
charset()
Returns the charset of this media type, or null if this media type doesn't specify a charset.
|
Optional<Charset> |
charset(Optional<Charset> defaultValue)
Returns the charset of this media type, or
defaultValue if either this media type
doesn't specify a charset, of it its charset is unsupported by the current runtime. |
boolean |
equals(Object other) |
int |
hashCode() |
static MediaType |
parse(String string)
Returns a media type for
string. |
String |
subtype()
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
|
String |
toString()
Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in a
Content-Type header.
|
String |
type()
Returns the high-level media type, such as "text", "image", "audio", "video", or "application".
|
public static MediaType parse(String string)
string.IllegalArgumentException - if string is not a well-formed media type.public Optional<Charset> charset()
public Optional<Charset> charset(Optional<Charset> defaultValue)
defaultValue if either this media type
doesn't specify a charset, of it its charset is unsupported by the current runtime.public String subtype()
public String toString()
public String type()
Copyright © 2011–2019 Everit Kft.. All rights reserved.