@BeanIgnore public final class StringRange extends Object implements Comparable<StringRange>
Similar in concept to MediaTypeRange
except instead of media types (e.g.
An example of a type range is a value in an
Modifier and Type | Method and Description |
---|---|
int |
compareTo(StringRange o)
Compares two MediaRanges for equality.
|
boolean |
equals(Object o)
Returns
|
Map<String,Set<String>> |
getExtensions()
Returns the optional set of custom extensions defined for this type.
|
Float |
getQValue()
Returns the
|
String |
getType()
Returns the type enclosed by this type range.
|
int |
hashCode()
Returns a hash based on this instance's
|
boolean |
matches(String type)
Checks if the specified type matches this range.
|
static StringRange[] |
parse(String value)
Parses a header such as an
|
String |
toString()
Provides a string representation of this media range, suitable for use as an
|
public static StringRange[] parse(String value)
The syntax expected to be found in the referenced
Accept-Encoding = "Accept-Encoding" ":" 1#( codings [ ";" "q" "=" qvalue ] ) codings = ( content-coding | "*" )
Examples of its use are:
Accept-Encoding: compress, gzip Accept-Encoding: Accept-Encoding: * Accept-Encoding: compress;q=0.5, gzip;q=1.0 Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
value
- The value to parse.
If public String getType()
public Float getQValue()
The quality value is a float between
If 'q' value doesn't make sense for the context (e.g. this range was extracted from a
public Map<String,Set<String>> getExtensions()
Values are lowercase and never
public String toString()
The literal text generated will be all lowercase.
public boolean equals(Object o)
public int hashCode()
public int compareTo(StringRange o)
The values are first compared according to
compareTo
in interface Comparable<StringRange>
o
- The range to compare to. Never Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.