Class AcceptLanguage


  • public class AcceptLanguage
    extends java.lang.Object
    Represents a single language entry from an Accept-Language header.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AcceptLanguage​(java.util.Locale locale, double quality)
      Constructs a new AcceptLanguage.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Locale getLocale()
      Returns the locale.
      double getQuality()
      Returns the quality value.
      static java.util.List<AcceptLanguage> parse​(java.io.StringReader input)
      Parses an Accept-Language header value.
      • Methods inherited from class java.lang.Object

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

      • AcceptLanguage

        protected AcceptLanguage​(java.util.Locale locale,
                                 double quality)
        Constructs a new AcceptLanguage.
        Parameters:
        locale - The locale of this language entry
        quality - The quality value for this language entry
    • Method Detail

      • getLocale

        public java.util.Locale getLocale()
        Returns the locale.
        Returns:
        The locale of this language entry
      • getQuality

        public double getQuality()
        Returns the quality value.
        Returns:
        The quality value of this language entry
      • parse

        public static java.util.List<AcceptLanguage> parse​(java.io.StringReader input)
                                                    throws java.io.IOException
        Parses an Accept-Language header value.
        Parameters:
        input - The StringReader containing the header value
        Returns:
        A list of AcceptLanguage entries sorted by quality
        Throws:
        java.io.IOException - If an I/O error occurs while reading the input