public class BasicStringRangeArrayHeader extends BasicHeader
Accept-Encoding: compress;q=0.5, gzip;q=1.0
Constructor and Description |
---|
BasicStringRangeArrayHeader(String name,
Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
StringRanges |
asRanges()
Returns the list of the types ranges that make up this header.
|
StringRange |
getRange(int index)
Returns the
MediaRange at the specified index. |
List<StringRange> |
getRanges()
Returns the string ranges that make up this object.
|
String |
getValue() |
int |
match(List<String> names)
Given a list of media types, returns the best match for this string range header.
|
static BasicStringRangeArrayHeader |
of(String name,
Object value)
Convenience creator.
|
static BasicStringRangeArrayHeader |
of(String name,
Supplier<?> value)
Convenience creator using supplier.
|
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public BasicStringRangeArrayHeader(String name, Object value)
name
- The parameter name.value
- The parameter value.
String
- Converted using StringRanges.of(String)
.
Supplier
of anything on this list.
public static BasicStringRangeArrayHeader of(String name, Object value)
value
- The parameter value.
String
- Converted using StringRanges.of(String)
.
StringRanges
- Left as-is.
BasicLongHeader
object.public static BasicStringRangeArrayHeader of(String name, Supplier<?> value)
Header value is re-evaluated on each call to getValue()
.
value
- The parameter value supplier.
String
- Converted using StringRanges.of(String)
.
StringRanges
- Left as-is.
BasicLongHeader
object.public String getValue()
getValue
in interface NameValuePair
getValue
in class BasicHeader
public StringRanges asRanges()
The types ranges in the list are sorted by their q-value in descending order.
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.