Class QValueParser


  • public class QValueParser
    extends java.lang.Object
    Utility class for parsing headers that accept q values
    Author:
    Stuart Douglas
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.util.List<QValueParser.QValueResult>> parse​(java.util.List<java.lang.String> headers)
      Parses a set of headers that take q values to determine the most preferred one.
      • Methods inherited from class java.lang.Object

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

      • parse

        public static java.util.List<java.util.List<QValueParser.QValueResult>> parse​(java.util.List<java.lang.String> headers)
        Parses a set of headers that take q values to determine the most preferred one. It returns the result in the form of a sorted list of list, with every element in the list having the same q value. This means the highest priority items are at the front of the list. The container should use its own internal preferred ordering to determinately pick the correct item to use
        Parameters:
        headers - The headers
        Returns:
        The q value results