Package org.apache.juneau
Class MediaRange
java.lang.Object
org.apache.juneau.MediaType
org.apache.juneau.MediaRange
- All Implemented Interfaces:
Comparable<MediaType>
Describes a single type used in content negotiation between an HTTP client and server, as described in
Section 14.1 and 14.7 of RFC2616 (the HTTP/1.1 specification).
See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionforEachExtension
(Consumer<NameValuePair> action) Performs an action on the optional set of custom extensions defined for this type.Returns the optional set of custom extensions defined for this type.Returns the'q' (quality) value for this type, as described in Section 3.9 of RFC2616.toString()
Methods inherited from class org.apache.juneau.MediaType
compareTo, equals, forEachParameter, forEachSubType, getParameter, getParameters, getSubType, getSubTypes, getType, hashCode, hasSubType, isMetaSubtype, match, match, of, of, ofAll
-
Constructor Details
-
MediaRange
Constructor.- Parameters:
e
- The parsed media range element.
-
-
Method Details
-
getQValue
Returns the'q' (quality) value for this type, as described in Section 3.9 of RFC2616.The quality value is a float between
0.0 (unacceptable) and1.0 (most acceptable).If 'q' value doesn't make sense for the context (e.g. this range was extracted from a
"content-*" header, as opposed to"accept-*" header, its value will always be"1" .- Returns:
- The 'q' value for this type, never
null .
-
getExtensions
Returns the optional set of custom extensions defined for this type.Values are lowercase and never
null .- Returns:
- The optional list of extensions, never
null .
-
forEachExtension
Performs an action on the optional set of custom extensions defined for this type.Values are lowercase and never
null .- Parameters:
action
- The action to perform.- Returns:
- This object.
-
toString
-