|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.core.MediaType
org.glassfish.jersey.message.internal.AcceptableMediaType
public class AcceptableMediaType
An acceptable media type.
| Field Summary |
|---|
| Fields inherited from interface org.glassfish.jersey.message.internal.Qualified |
|---|
QUALITY_PARAMETER_NAME |
| Constructor Summary | |
|---|---|
AcceptableMediaType(String type,
String subtype)
Create new acceptable media type instance with a default quality factor value. |
|
AcceptableMediaType(String type,
String subtype,
int quality,
Map<String,String> parameters)
Create new acceptable media type instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Compares obj to this media type to see if they are the same by comparing
type, subtype and parameters. |
int |
getQuality()
Get quality factor value (in [ppt]). |
int |
hashCode()
Generate a hash code from the type, subtype and parameters. |
static AcceptableMediaType |
valueOf(HttpHeaderReader reader)
Create new acceptable media type instance from the supplied HTTP header reader. |
| Methods inherited from class javax.ws.rs.core.MediaType |
|---|
getParameters, getSubtype, getType, isCompatible, isWildcardSubtype, isWildcardType, toString, valueOf, withCharset |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AcceptableMediaType(String type,
String subtype)
default quality factor value.
type - the primary type, null is equivalent to
MediaType.MEDIA_TYPE_WILDCARDsubtype - the subtype, null is equivalent to
MediaType.MEDIA_TYPE_WILDCARD
public AcceptableMediaType(String type,
String subtype,
int quality,
Map<String,String> parameters)
type - the primary type, null is equivalent to
MediaType.MEDIA_TYPE_WILDCARDsubtype - the subtype, null is equivalent to
MediaType.MEDIA_TYPE_WILDCARDquality - quality factor value in [ppt]. See Qualified.parameters - a map of media type parameters, null is the same as an
empty map.| Method Detail |
|---|
public int getQuality()
Qualified
getQuality in interface Qualified
public static AcceptableMediaType valueOf(HttpHeaderReader reader)
throws ParseException
HTTP header reader.
reader - HTTP header reader.
ParseException - in case the input data parsing failed.public boolean equals(Object obj)
MediaTypeobj to this media type to see if they are the same by comparing
type, subtype and parameters. Note that the case-sensitivity of parameter
values is dependent on the semantics of the parameter name, see
HTTP/1.1.
This method assumes that values are case-sensitive.
Note that the equals(...) implementation does not perform
a class equality check (this.getClass() == obj.getClass()). Therefore
any class that extends from MediaType class and needs to override
one of the equals(...) and MediaType.hashCode() methods must
always override both methods to ensure the contract between
Object.equals(java.lang.Object) and Object.hashCode() does
not break.
equals in class MediaTypeobj - the object to compare to.
public int hashCode()
MediaTypeMediaType.equals(java.lang.Object) implementation does not perform
a class equality check (this.getClass() == obj.getClass()). Therefore
any class that extends from MediaType class and needs to override
one of the MediaType.equals(Object) and hashCode() methods must
always override both methods to ensure the contract between
Object.equals(java.lang.Object) and Object.hashCode() does
not break.
hashCode in class MediaType
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||