|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.servlets.post.impl.helper.MediaRangeList.MediaRange
public class MediaRangeList.MediaRange
A code MediaRange
represents an entry in a MediaRangeList
.
The MediaRange
consists of a supertype
and a subtype
,
optionally a quality factor parameter q
and other arbitrary parameters.
Constructor Summary | |
---|---|
MediaRangeList.MediaRange(String exp)
Constructs a MediaRange from a String expression. |
Method Summary | |
---|---|
int |
compareTo(MediaRangeList.MediaRange o)
|
boolean |
equals(Object obj)
|
boolean |
equals(String s)
|
String |
getParameter(String key)
|
Map<String,String> |
getParameters()
|
double |
getQ()
Get the value of the quality factor parameter ( q ). |
String |
getSubtype()
|
String |
getSupertype()
|
boolean |
matchesAll()
Returns true if this is a catch-all media range (*/* ). |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MediaRangeList.MediaRange(String exp)
MediaRange
from a String
expression.
exp
- The String
to constuct the MediaRange
from. The string is
expected to be on the form ( "*/*"
| ( type "/" "*" )
| ( type "/" subtype )
) *( ";" parameter )text/html;q=0.8
text/html
text/html;level=3
text/html;level=3;q=0.7
text/*
*/*
*
), then the subtype component
must also be wildcard.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 |
---|
public boolean matchesAll()
true
if this is a catch-all media range (*/*
).
true
if this range is a catch-all media range, false
otherwisepublic String getParameter(String key)
public String getSupertype()
public String getSubtype()
public double getQ()
q
).
public Map<String,String> getParameters()
public int compareTo(MediaRangeList.MediaRange o)
compareTo
in interface Comparable<MediaRangeList.MediaRange>
public boolean equals(Object obj)
equals
in class Object
public boolean equals(String s)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |