@BeanIgnore public class StringRanges extends Object
The returned ranges are sorted such that the most acceptable value is available at ordinal position
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
Constructor and Description |
---|
StringRanges(HeaderElement[] e)
Constructor.
|
StringRanges(String value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
StringRange |
getRange(int index)
Returns the
MediaRange at the specified index. |
List<StringRange> |
getRanges()
Returns the string ranges that make up this object.
|
int |
match(List<String> names)
Given a list of media types, returns the best match for this string range header.
|
static StringRanges |
of(String value)
Returns a parsed string range header value.
|
String |
toString() |
public StringRanges(String value)
value
- The string range header value.public StringRanges(HeaderElement[] e)
e
- The parsed string range header value.public static StringRanges of(String value)
value
- The raw string range header value.public int match(List<String> names)
Note that fuzzy matching is allowed on the media types where the string range header may
contain additional subtype parts.
For example, given identical q-values and an string range value of
The purpose for this is to allow serializers to match when artifacts such as
names
- The names to match against.public StringRange getRange(int index)
MediaRange
at the specified index.index
- The index position of the media range.MediaRange
at the specified index or public List<StringRange> getRanges()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.