Package akka.http.scaladsl.model
Class MediaRange
- java.lang.Object
-
- akka.http.javadsl.model.MediaRange
-
- akka.http.scaladsl.model.MediaRange
-
- All Implemented Interfaces:
Renderable
,WithQValue<MediaRange>
- Direct Known Subclasses:
MediaRange.One
,MediaRanges.PredefinedMediaRange
public abstract class MediaRange extends MediaRange implements Renderable, WithQValue<MediaRange>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MediaRange.One
static class
MediaRange.One$
-
Constructor Summary
Constructors Constructor Description MediaRange()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MediaRange
apply(MediaType mediaType)
static MediaRange
apply(MediaType mediaType, float qValue)
static MediaRange
custom(java.lang.String mainType, scala.collection.immutable.Map<java.lang.String,java.lang.String> params, float qValue)
java.util.Map<java.lang.String,java.lang.String>
getParams()
Java APIboolean
isApplication()
boolean
isAudio()
boolean
isImage()
boolean
isMessage()
boolean
isMultipart()
boolean
isText()
boolean
isVideo()
boolean
isWildcard()
abstract java.lang.String
mainType()
Returns the main-type this media-range matches.boolean
matches(MediaType mediaType)
Java APIabstract boolean
matches(MediaType mediaType)
abstract scala.collection.immutable.Map<java.lang.String,java.lang.String>
params()
abstract float
qValue()
Returns the qValue of this media-range.static scala.Tuple2<scala.collection.immutable.Map<java.lang.String,java.lang.String>,java.lang.Object>
splitOffQValue(scala.collection.immutable.Map<java.lang.String,java.lang.String> params, float defaultQ)
abstract java.lang.String
value()
ContentTypeRange
withCharsetRange(HttpCharsetRange charsetRange)
Constructs aContentTypeRange
from this instance and the given charset.abstract MediaRange
withParams(scala.collection.immutable.Map<java.lang.String,java.lang.String> params)
Returns a copy of this instance with the params replaced by the given ones.-
Methods inherited from class akka.http.javadsl.model.MediaRange
withQValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.http.impl.util.Renderable
render
-
Methods inherited from interface akka.http.scaladsl.model.WithQValue
withQValue, withQValue
-
-
-
-
Method Detail
-
splitOffQValue
public static scala.Tuple2<scala.collection.immutable.Map<java.lang.String,java.lang.String>,java.lang.Object> splitOffQValue(scala.collection.immutable.Map<java.lang.String,java.lang.String> params, float defaultQ)
-
custom
public static MediaRange custom(java.lang.String mainType, scala.collection.immutable.Map<java.lang.String,java.lang.String> params, float qValue)
-
apply
public static MediaRange apply(MediaType mediaType)
-
apply
public static MediaRange apply(MediaType mediaType, float qValue)
-
value
public abstract java.lang.String value()
-
mainType
public abstract java.lang.String mainType()
Description copied from class:MediaRange
Returns the main-type this media-range matches.- Specified by:
mainType
in classMediaRange
-
params
public abstract scala.collection.immutable.Map<java.lang.String,java.lang.String> params()
-
qValue
public abstract float qValue()
Description copied from class:MediaRange
Returns the qValue of this media-range.- Specified by:
qValue
in classMediaRange
-
matches
public abstract boolean matches(MediaType mediaType)
-
isApplication
public boolean isApplication()
-
isAudio
public boolean isAudio()
-
isImage
public boolean isImage()
-
isMessage
public boolean isMessage()
-
isMultipart
public boolean isMultipart()
-
isText
public boolean isText()
-
isVideo
public boolean isVideo()
-
isWildcard
public boolean isWildcard()
-
withParams
public abstract MediaRange withParams(scala.collection.immutable.Map<java.lang.String,java.lang.String> params)
Returns a copy of this instance with the params replaced by the given ones. If the given map contains a "q" value theqValue
member is (also) updated.- Parameters:
params
- (undocumented)- Returns:
- (undocumented)
-
withCharsetRange
public ContentTypeRange withCharsetRange(HttpCharsetRange charsetRange)
Constructs aContentTypeRange
from this instance and the given charset.- Parameters:
charsetRange
- (undocumented)- Returns:
- (undocumented)
-
getParams
public java.util.Map<java.lang.String,java.lang.String> getParams()
Java API- Specified by:
getParams
in classMediaRange
-
matches
public boolean matches(MediaType mediaType)
Java API- Specified by:
matches
in classMediaRange
-
-