Class AcceptableMediaType
java.lang.Object
jakarta.ws.rs.core.MediaType
org.glassfish.jersey.message.internal.AcceptableMediaType
- All Implemented Interfaces:
Qualified
An acceptable media type.
- Author:
- Paul Sandoz, Marek Potociar
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<AcceptableMediaType>
Comparator for collections of acceptable media types.Fields inherited from class jakarta.ws.rs.core.MediaType
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 Summary
ConstructorDescriptionAcceptableMediaType
(String type, String subtype) Create new acceptable media type instance with adefault quality factor
value.Create new acceptable media type instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Get quality factor value (in [ppt]).int
hashCode()
static AcceptableMediaType
Create new acceptable media type instance from the suppliedmedia type
.static AcceptableMediaType
valueOf
(HttpHeaderReader reader) Create new acceptable media type instance from the suppliedHTTP header reader
.Methods inherited from class jakarta.ws.rs.core.MediaType
getParameters, getSubtype, getType, isCompatible, isWildcardSubtype, isWildcardType, toString, valueOf, withCharset
-
Field Details
-
COMPARATOR
Comparator for collections of acceptable media types.
-
-
Constructor Details
-
AcceptableMediaType
Create new acceptable media type instance with adefault quality factor
value.- Parameters:
type
- the primary type,null
is equivalent toMediaType.MEDIA_TYPE_WILDCARD
subtype
- the subtype, null is equivalent toMediaType.MEDIA_TYPE_WILDCARD
-
AcceptableMediaType
Create new acceptable media type instance.- Parameters:
type
- the primary type,null
is equivalent toMediaType.MEDIA_TYPE_WILDCARD
subtype
- the subtype,null
is equivalent toMediaType.MEDIA_TYPE_WILDCARD
quality
- quality factor value in [ppt]. SeeQualified
.parameters
- a map of media type parameters,null
is the same as an empty map.
-
-
Method Details
-
getQuality
public int getQuality()Description copied from interface:Qualified
Get quality factor value (in [ppt]).- Specified by:
getQuality
in interfaceQualified
- Returns:
- quality factor value.
-
valueOf
Create new acceptable media type instance from the suppliedHTTP header reader
.- Parameters:
reader
- HTTP header reader.- Returns:
- new acceptable media type instance.
- Throws:
ParseException
- in case the input data parsing failed.
-
valueOf
Create new acceptable media type instance from the suppliedmedia type
.- Parameters:
mediaType
- general-purpose media type.- Returns:
- new acceptable media type instance.
- Throws:
ParseException
- in case the quality parameter parsing failed.
-
equals
-
hashCode
public int hashCode()
-