org.jboss.resteasy.util
Class WeightedMediaType

java.lang.Object
  extended by javax.ws.rs.core.MediaType
      extended by org.jboss.resteasy.util.WeightedMediaType
All Implemented Interfaces:
java.lang.Comparable<WeightedMediaType>

public class WeightedMediaType
extends MediaType
implements java.lang.Comparable<WeightedMediaType>

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
 
Fields 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_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, APPLICATION_XOP_XML, APPLICATION_XOP_XML_TYPE, MEDIA_TYPE_WILDCARD, MULTIPART_FORM_DATA, MULTIPART_FORM_DATA_TYPE, MULTIPART_RELATED, MULTIPART_RELATED_TYPE, TEXT_HTML, TEXT_HTML_TYPE, TEXT_PLAIN, TEXT_PLAIN_TYPE, TEXT_XML, TEXT_XML_TYPE, WILDCARD, WILDCARD_TYPE
 
Method Summary
 int compareTo(WeightedMediaType o)
           
 boolean equals(java.lang.Object obj)
          Compares obj to this media type to see if they are the same by comparing type, subtype and parameters.
 float getWeight()
           
 boolean isCompatible(MediaType other)
          Non-equal properties should not be compatible
static WeightedMediaType parse(MediaType tmp)
           
static WeightedMediaType valueOf(java.lang.String type)
           
 
Methods inherited from class javax.ws.rs.core.MediaType
getParameters, getSubtype, getType, hashCode, isWildcardSubtype, isWildcardType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getWeight

public float getWeight()

compareTo

public int compareTo(WeightedMediaType o)
Specified by:
compareTo in interface java.lang.Comparable<WeightedMediaType>

isCompatible

public boolean isCompatible(MediaType other)
Non-equal properties should not be compatible

Overrides:
isCompatible in class MediaType
Parameters:
other - the media type to compare with
Returns:
true if the types are compatible, false otherwise.

valueOf

public static WeightedMediaType valueOf(java.lang.String type)

parse

public static WeightedMediaType parse(MediaType tmp)

equals

public boolean equals(java.lang.Object obj)
Description copied from class: MediaType
Compares obj 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.

Overrides:
equals in class MediaType
Parameters:
obj - the object to compare to
Returns:
true if the two media types are the same, false otherwise.


Copyright © 2009. All Rights Reserved.