@BeanIgnore public class MediaType extends Object implements Comparable<MediaType>
Modifier and Type | Field and Description |
---|---|
static MediaType |
CSV
Reusable predefined media type
|
static MediaType |
HTML
Reusable predefined media type
|
static MediaType |
JSON
Reusable predefined media type
|
static MediaType |
MSGPACK
Reusable predefined media type
|
static MediaType |
N3
Reusable predefined media type
|
static MediaType |
NTRIPLE
Reusable predefined media type
|
static MediaType |
PLAIN
Reusable predefined media type
|
static MediaType |
RDF
Reusable predefined media type
|
static MediaType |
RDFABBREV
Reusable predefined media type
|
static MediaType |
TURTLE
Reusable predefined media type
|
static MediaType |
UON
Reusable predefined media type
|
static MediaType |
URLENCODING
Reusable predefined media type
|
static MediaType |
XML
Reusable predefined media type
|
static MediaType |
XMLSOAP
Reusable predefined media type
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MediaType o) |
boolean |
equals(Object o) |
static MediaType |
forString(String s)
Returns the media type for the specified string.
|
static MediaType[] |
forStrings(String... s)
Same as
forString(String) but allows you to construct an array of |
Map<String,Set<String>> |
getParameters()
Returns the additional parameters on this media type.
|
String |
getSubType()
Returns the
|
List<String> |
getSubTypes()
Returns the subtypes broken down by fragments delimited by
|
String |
getType()
Returns the
|
int |
hashCode() |
boolean |
hasSubType(String st)
Returns
|
boolean |
isMeta()
Returns
|
int |
match(MediaType o,
boolean allowExtraSubTypes)
Returns a match metric against the specified media type where a larger number represents a better match.
|
String |
toString() |
public static final MediaType URLENCODING
public static MediaType forString(String s)
s
- The media type string.
Will be lowercased.
Returns public static MediaType[] forStrings(String... s)
forString(String)
but allows you to construct an array of s
- The media type strings.public final String getType()
public final String getSubType()
public final boolean hasSubType(String st)
st
- The subtype string.
Case is ignored.public final List<String> getSubTypes()
For example, the media type [
public final boolean isMeta()
public final int match(MediaType o, boolean allowExtraSubTypes)
This media type can contain
The comparison media type must not.
JsonSerializer
(SimpleJsonSerializer
(o
- The media type to compare with.allowExtraSubTypes
- If public final Map<String,Set<String>> getParameters()
For example, given the media type string {level:[
.
public final int compareTo(MediaType o)
compareTo
in interface Comparable<MediaType>
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.