forked from akka/akka-http
/
MediaRange.java
39 lines (32 loc) · 982 Bytes
/
MediaRange.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.http.javadsl.model;
import java.util.Map;
/**
* Represents an Http media-range. A media-range either matches a single media-type
* or it matches all media-types of a given main-type. Each range can specify a qValue
* or other parameters.
*/
public abstract class MediaRange {
/**
* Returns the main-type this media-range matches.
*/
public abstract String mainType();
/**
* Returns the qValue of this media-range.
*/
public abstract float qValue();
/**
* Checks if this range matches a given media-type.
*/
public abstract boolean matches(MediaType mediaType);
/**
* Returns a Map of the parameters of this media-range.
*/
public abstract Map<String, String> getParams();
/**
* Returns a copy of this instance with a changed qValue.
*/
public abstract MediaRange withQValue(float qValue);
}