public class MediaRange extends Object
Constructor and Description |
---|
MediaRange(org.apache.tika.mime.MediaType type,
double q) |
Modifier and Type | Method and Description |
---|---|
double |
match(org.apache.tika.mime.MediaType type,
org.apache.tika.mime.MediaTypeRegistry registry)
Matches the media range against the specified media type.
|
static MediaRange |
parse(String range,
org.apache.tika.mime.MediaTypeRegistry registry) |
String |
toString() |
public static MediaRange parse(String range, org.apache.tika.mime.MediaTypeRegistry registry)
public double match(org.apache.tika.mime.MediaType type, org.apache.tika.mime.MediaTypeRegistry registry)
The "derived" quality value if computed from the specified q value (0 to 1) by subtracting 1/10000 in case the subtype in the range is "*", or 2/10000 if case both type and subtype are. This takes care of the precedence specified in RFC 7231, Section 5.3.2.
type
- type to matchregistry
- media type registry0.0
for "no match", the derived quality value if matchCopyright © 2012–2020 The Apache Software Foundation. All rights reserved.