Class MediaRange

java.lang.Object
org.apache.juneau.MediaType
org.apache.juneau.MediaRange
All Implemented Interfaces:
Comparable<MediaType>

public class MediaRange extends 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:
  • Constructor Details

  • Method Details

    • getQValue

      public Float 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) and 1.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

      public String toString()
      Overrides:
      toString in class MediaType