Class MediaTypeNegotiator


  • public final class MediaTypeNegotiator
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      scala.collection.immutable.List<MediaRange> acceptedMediaRanges()
      The media-ranges accepted by the client according to the given request headers, sorted by 1. increasing generality (i.e. most specific first) 2. decreasing q-value (only for ranges targeting a single MediaType) 3. order of appearance in the Accept header(s)
      boolean isAccepted​(MediaType mediaType)
      Determines whether the given MediaType is accepted by the client.
      float qValueFor​(MediaType mediaType)
      Returns the q-value that the client (implicitly or explicitly) attaches to the given media-type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediaTypeNegotiator

        public MediaTypeNegotiator​(scala.collection.immutable.Seq<HttpHeader> requestHeaders)
    • Method Detail

      • acceptedMediaRanges

        public scala.collection.immutable.List<MediaRange> acceptedMediaRanges()
        The media-ranges accepted by the client according to the given request headers, sorted by 1. increasing generality (i.e. most specific first) 2. decreasing q-value (only for ranges targeting a single MediaType) 3. order of appearance in the Accept header(s)
        Returns:
        (undocumented)
      • isAccepted

        public boolean isAccepted​(MediaType mediaType)
        Determines whether the given MediaType is accepted by the client.
        Parameters:
        mediaType - (undocumented)
        Returns:
        (undocumented)
      • qValueFor

        public float qValueFor​(MediaType mediaType)
        Returns the q-value that the client (implicitly or explicitly) attaches to the given media-type. See http://tools.ietf.org/html/rfc7231#section-5.3.1 for details.
        Parameters:
        mediaType - (undocumented)
        Returns:
        (undocumented)