Class MediaRanges
 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 ) ]
See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final MediaRangesRepresents an empty media ranges object.
- 
Constructor SummaryConstructorsConstructorDescriptionMediaRanges(String value) Constructor.MediaRanges(HeaderElement[] e) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionforEachRange(Consumer<MediaRange> action) Performs an action on the media ranges that make up this object.getRange(int index) Returns theMediaRangeat the specified index.booleanhasSubtypePart(String part) Convenience method for searching through all of the subtypes of all the media ranges in this header for the presence of a subtype fragment.intGiven a list of media types, returns the best match for thisAccept header.static MediaRangesReturns a parsedAccept header value.toList()Returns the media ranges that make up this object.toString()
- 
Field Details- 
EMPTYRepresents an empty media ranges object.
 
- 
- 
Constructor Details- 
MediaRangesConstructor.- Parameters:
- value- The- Accept header value.
 
- 
MediaRangesConstructor.- Parameters:
- e- The parsed header value.
 
 
- 
- 
Method Details- 
ofReturns a parsedAccept header value.- Parameters:
- value- The raw- Accept header value.
- Returns:
- A parsed Accept header value.
 
- 
matchGiven a list of media types, returns the best match for thisAccept header.Note that fuzzy matching is allowed on the media types where the Accept header may contain additional subtype parts.
 For example, given identical q-values and anAccept value of"text/json+activity" , the media type"text/json" will match if"text/json+activity" or"text/activity+json" isn't found.
 The purpose for this is to allow serializers to match when artifacts such asid properties are present in the header.- Parameters:
- mediaTypes- The media types to match against.
- Returns:
- The index into the array of the best match, or -1 if no suitable matches could be found.
 
- 
getRangeReturns theMediaRangeat the specified index.- Parameters:
- index- The index position of the media range.
- Returns:
- The MediaRangeat the specified index ornull if the index is out of range.
 
- 
hasSubtypePartConvenience method for searching through all of the subtypes of all the media ranges in this header for the presence of a subtype fragment.For example, given the header "text/json+activity" , callinghasSubtypePart(returns"activity" )true .- Parameters:
- part- The media type subtype fragment.
- Returns:
- true if subtype fragment exists.
 
- 
toListReturns the media ranges that make up this object.- Returns:
- The media ranges that make up this object.
 
- 
forEachRangePerforms an action on the media ranges that make up this object.- Parameters:
- action- The action to perform.
- Returns:
- This object.
 
- 
toString
 
-