Class AcceptableMediaType
java.lang.Object
javax.ws.rs.core.MediaType
org.glassfish.jersey.message.internal.AcceptableMediaType
- All Implemented Interfaces:
Qualified
An acceptable media type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<AcceptableMediaType> Comparator for collections of acceptable media types.private final intFields inherited from class javax.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
ConstructorsModifierConstructorDescriptionAcceptableMediaType(String type, String subtype) Create new acceptable media type instance with adefault quality factorvalue.Create new acceptable media type instance.private -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGet quality factor value (in [ppt]).inthashCode()static AcceptableMediaTypevalueOf(javax.ws.rs.core.MediaType mediaType) Create new acceptable media type instance from the suppliedmedia type.static AcceptableMediaTypevalueOf(HttpHeaderReader reader) Create new acceptable media type instance from the suppliedHTTP header reader.Methods inherited from class javax.ws.rs.core.MediaType
getParameters, getSubtype, getType, isCompatible, isWildcardSubtype, isWildcardType, toString, valueOf, withCharset
-
Field Details
-
COMPARATOR
Comparator for collections of acceptable media types. -
q
private final int q
-
-
Constructor Details
-
AcceptableMediaType
Create new acceptable media type instance with adefault quality factorvalue.- Parameters:
type- the primary type,nullis equivalent toMediaType.MEDIA_TYPE_WILDCARDsubtype- the subtype, null is equivalent toMediaType.MEDIA_TYPE_WILDCARD
-
AcceptableMediaType
Create new acceptable media type instance.- Parameters:
type- the primary type,nullis equivalent toMediaType.MEDIA_TYPE_WILDCARDsubtype- the subtype,nullis equivalent toMediaType.MEDIA_TYPE_WILDCARDquality- quality factor value in [ppt]. SeeQualified.parameters- a map of media type parameters,nullis the same as an empty map.
-
AcceptableMediaType
-
-
Method Details
-
getQuality
public int getQuality()Description copied from interface:QualifiedGet quality factor value (in [ppt]).- Specified by:
getQualityin 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
public static AcceptableMediaType valueOf(javax.ws.rs.core.MediaType mediaType) throws ParseException 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
- Overrides:
equalsin classjavax.ws.rs.core.MediaType
-
hashCode
public int hashCode()- Overrides:
hashCodein classjavax.ws.rs.core.MediaType
-