Class MediaRangeList.MediaRange

    • Constructor Detail

      • MediaRange

        public MediaRange​(String exp)
        Constructs a MediaRange from a String expression.
        exp - The String to construct the MediaRange from. The string is expected to be on the form ( "*/*" | ( type "/" "*" ) | ( type "/" subtype ) ) *( ";" parameter )
        as specified by RFC 2616, section 14.1.


        • text/html;q=0.8
        • text/html
        • text/html;level=3
        • text/html;level=3;q=0.7
        • text/*
        • */*
        Note that if the supertype component is wildcard (*), then the subtype component must also be wildcard.

        The quality factor parameter must be between 0 and 1, inclusive (see RFC 2616 section 3.9). If the expression does not contain a q parameter, the MediaRange is given a default quality factor of 1.

        IllegalArgumentException - if exp can not be parsed to a valid media range
        NullPointerException - if exp is null
    • Method Detail

      • matchesAll

        public boolean matchesAll()
        Returns true if this is a catch-all media range (*/*).
        true if this range is a catch-all media range, false otherwise
      • getSupertype

        public String getSupertype()
      • getSubtype

        public String getSubtype()
      • getQ

        public double getQ()
        Get the value of the quality factor parameter (q).
        the quality factor
      • equals

        public boolean equals​(String s)