Modifier and Type | Field and Description |
---|---|
static Comparator<QualitySourceMediaType> |
COMPARATOR
Comparator for lists of quality source media types.
|
APPLICATION_ATOM_XML, APPLICATION_ATOM_XML_TYPE, APPLICATION_FORM_URLENCODED, APPLICATION_FORM_URLENCODED_TYPE, APPLICATION_JSON, APPLICATION_JSON_PATCH_JSON, APPLICATION_JSON_PATCH_JSON_TYPE, APPLICATION_JSON_TYPE, APPLICATION_OCTET_STREAM, APPLICATION_OCTET_STREAM_TYPE, APPLICATION_SVG_XML, APPLICATION_SVG_XML_TYPE, APPLICATION_XHTML_XML, APPLICATION_XHTML_XML_TYPE, APPLICATION_XML, APPLICATION_XML_TYPE, CHARSET_PARAMETER, MEDIA_TYPE_WILDCARD, MULTIPART_FORM_DATA, MULTIPART_FORM_DATA_TYPE, SERVER_SENT_EVENTS, SERVER_SENT_EVENTS_TYPE, TEXT_HTML, TEXT_HTML_TYPE, TEXT_PLAIN, TEXT_PLAIN_TYPE, TEXT_XML, TEXT_XML_TYPE, WILDCARD, WILDCARD_TYPE
Constructor and Description |
---|
QualitySourceMediaType(String type,
String subtype)
Create new quality source media type instance with a
default quality factor value. |
QualitySourceMediaType(String type,
String subtype,
int quality,
Map<String,String> parameters)
Create new quality source media type instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getQuality()
Get quality source factor value (in [ppt]).
|
static int |
getQualitySource(javax.ws.rs.core.MediaType mediaType)
Extract quality source information from the supplied
MediaType value. |
int |
hashCode() |
String |
toString() |
static QualitySourceMediaType |
valueOf(HttpHeaderReader reader)
Create new quality source media type instance from the supplied
HTTP header reader . |
public static final Comparator<QualitySourceMediaType> COMPARATOR
public QualitySourceMediaType(String type, String subtype)
default quality factor
value.type
- the primary type, null
is equivalent to
MediaType.MEDIA_TYPE_WILDCARD
subtype
- the subtype, null
is equivalent to
MediaType.MEDIA_TYPE_WILDCARD
public QualitySourceMediaType(String type, String subtype, int quality, Map<String,String> parameters)
type
- the primary type, null
is equivalent to
MediaType.MEDIA_TYPE_WILDCARD
subtype
- the subtype, null
is equivalent to
MediaType.MEDIA_TYPE_WILDCARD
quality
- quality source factor value in [ppt]. See Qualified
.parameters
- a map of media type parameters, null
is the same as an
empty map.public int getQuality()
getQuality
in interface Qualified
public static QualitySourceMediaType valueOf(HttpHeaderReader reader) throws ParseException
HTTP header reader
.reader
- HTTP header reader.ParseException
- in case the input data parsing failed.public static int getQualitySource(javax.ws.rs.core.MediaType mediaType) throws IllegalArgumentException
MediaType
value.
If no quality source parameter is present in the media type, default quality
is returned.mediaType
- media type.default quality
,
if no quality source parameter is present.IllegalArgumentException
- in case the quality source parameter value could not be parsed.public boolean equals(Object obj)
equals
in class javax.ws.rs.core.MediaType
public int hashCode()
hashCode
in class javax.ws.rs.core.MediaType
public String toString()
toString
in class javax.ws.rs.core.MediaType
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.