public class MediaType extends Object
Modifier and Type | Field and Description |
---|---|
static MediaType |
APPLICATION_JAVASCRIPT |
static MediaType |
APPLICATION_JSON |
static MediaType |
APPLICATION_RDF_XML |
static MediaType |
APPLICATION_XML |
static MediaType |
NONE |
static MediaType |
STAR_STAR |
static MediaType |
TEXT_HTML |
static MediaType |
TEXT_JAVASCRIPT |
static MediaType |
TEXT_PLAIN |
static MediaType |
TEXT_TURTLE |
static MediaType |
TEXT_XML |
Constructor and Description |
---|
MediaType(String A,
String B)
Initialise this MediaType with the given type and subtype and
a Q value of 1.
|
MediaType(String A,
String B,
float Q)
Initialise this MediaType with the given type, subtype, and
Q-value.
|
MediaType(String A,
String B,
float Q,
String params) |
MediaType(String A,
String B,
String params) |
Modifier and Type | Method and Description |
---|---|
static MediaType |
accept(List<MediaType> types,
String canHandle)
Answer one of the media types described in
canHandle
that are accepted by the earliest one of types . |
boolean |
accepts(MediaType s)
This MediaType accepts s if the types and subtypes match.
|
static MediaType |
decodeType(String one)
Answer the media type described by T/S[; q=Q] in the
string
one . |
static List<MediaType> |
decodeTypes(String a)
Answer a list of all the media types described in the
comma-separated list in the string
a . |
boolean |
equals(Object other)
Answer true iff
other is a MediaType with the same
type and subtype |
String |
getSubtype()
Answer the subtype field of this MediaType.
|
String |
getType()
Answer the type field of this MediaType.
|
int |
hashCode()
Answer a plausible hash code for this MediaType based on the
hash codes of the type and subtype.
|
static List<MediaType> |
mediaType(Enumeration<String> e)
Answer a list of all the media types described in the
elements of
e . |
String |
toFullString()
Answer the string type/subType; q=Q.
|
String |
toString()
Answer the string type/subType, ignoring the Q-value.
|
public static final MediaType NONE
public static final MediaType STAR_STAR
public static final MediaType TEXT_XML
public static final MediaType TEXT_HTML
public static final MediaType TEXT_PLAIN
public static final MediaType APPLICATION_JSON
public static final MediaType APPLICATION_XML
public static final MediaType TEXT_TURTLE
public static final MediaType APPLICATION_RDF_XML
public static final MediaType TEXT_JAVASCRIPT
public static final MediaType APPLICATION_JAVASCRIPT
public MediaType(String A, String B, float Q)
public String getType()
public String getSubtype()
public int hashCode()
public boolean equals(Object other)
other
is a MediaType with the same
type and subtypepublic boolean accepts(MediaType s)
public String toString()
public String toFullString()
public static MediaType accept(List<MediaType> types, String canHandle)
canHandle
that are accepted by the earliest one of types
.public static List<MediaType> mediaType(Enumeration<String> e)
e
.public static List<MediaType> decodeTypes(String a)
a
.Copyright © 2014. All Rights Reserved.