object MediaRange extends Serializable

Source
MediaRange.scala
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MediaRange
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. implicit val ordering: Ordering[MediaRange]

    Ordering for MediaRanges, in order of highest priority to lowest priority.

    Ordering for MediaRanges, in order of highest priority to lowest priority.

    The reason it is highest to lowest instead of lowest to highest is to ensure sorting is stable, so if two media ranges have the same ordering weight, they will not change order.

    Ordering rules for MediaRanges:

    First compare by qValue, default to 1. Higher means higher priority. Then compare the media type. If they are not the same, then the least specific (ie, if one is *) has a lower priority, otherwise if they have same priority. Then compare the sub media type. If they are the same, the one with the more parameters has a higher priority. Otherwise the least specific has the lower priority, otherwise they have the same priority.

  2. def preferred(acceptableRanges: Seq[MediaRange], availableMediaTypes: Seq[String]): Option[String]

    Given a list of acceptable media ranges, find the preferred media type in the list of available media types.

    Given a list of acceptable media ranges, find the preferred media type in the list of available media types.

    Note: the media types in the list should be without parameters, e.g. text/html not text/html;charset=utf-8

  3. object parse

    Function and extractor object for parsing media ranges.