Modifier and Type | Method and Description |
---|---|
List<MediaType> |
filter(List<MediaType> types)
Filter the accepted types and keep the most specifics media types.
|
Optional<MediaType> |
first(List<MediaType> candidates)
Given:
|
Optional<MediaType> |
first(MediaType candidate)
Given:
|
boolean |
matches(List<MediaType> candidates)
Given:
|
boolean |
matches(MediaType candidate)
Given:
|
public boolean matches(MediaType candidate)
text/html, application/xhtml; */ *
matches(text/html) // true through text/html matches(application/json) // true through */ *
candidate
- A candidate media type. Required.public boolean matches(List<MediaType> candidates)
text/html, application/xhtml; */ *
matches(text/html) // true through text/html matches(application/json) // true through */ *
candidates
- One ore more candidates media type. Required.public Optional<MediaType> first(MediaType candidate)
text/html, application/xhtml; */ *
first(text/html) // returns text/html first(application/json) // returns application/json
candidate
- A candidate media type. Required.public Optional<MediaType> first(List<MediaType> candidates)
text/html, application/xhtml; */ *
first(text/html) // returns text/html first(application/json) // returns application/json
candidates
- One ore more candidates media type. Required.public List<MediaType> filter(List<MediaType> types)
text/html, application/xhtml; */ *
filter(text/html) // returns text/html first(application/json) // returns application/json filter(text/html, application/json) // returns text/html and application/json
types
- A types to filterCopyright © 2015. All rights reserved.