@BeanIgnore public final class MediaTypeRange extends Object implements Comparable<MediaTypeRange>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MediaTypeRange 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.
|
MediaType |
getMediaType()
Returns the media type enclosed by this media range.
|
Float |
getQValue()
Returns the
|
int |
hashCode()
Returns a hash based on this instance's
|
static MediaTypeRange[] |
parse(String value)
Parses an
|
String |
toString()
Provides a string representation of this media range, suitable for use as an
|
public static MediaTypeRange[] parse(String value)
The returned media ranges are sorted such that the most acceptable media is available at ordinal position
The syntax expected to be found in the referenced
Accept = "Accept" ":" #( media-range [ accept-params ] ) media-range = ( "*\/*" | ( type "/" "*" ) | ( type "/" subtype ) ) *( ";" parameter ) accept-params = ";" "q" "=" qvalue *( accept-extension ) accept-extension = ";" token [ "=" ( token | quoted-string ) ]
value
- The value to parse.
If public MediaType getMediaType()
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(MediaTypeRange o)
The values are first compared according to
compareTo
in interface Comparable<MediaTypeRange>
o
- The range to compare to. Never Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.