Package org.jdrupes.httpcodec.types
Class MediaRange
java.lang.Object
org.jdrupes.httpcodec.types.ParameterizedValue<MediaBase.MediaTypePair>
org.jdrupes.httpcodec.types.MediaBase
org.jdrupes.httpcodec.types.MediaRange
- All Implemented Interfaces:
Comparable<MediaRange>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for the (immutable) parameterized type.static classNested classes/interfaces inherited from class org.jdrupes.httpcodec.types.MediaBase
MediaBase.MediaTypePair, MediaBase.MediaTypePairConverterNested classes/interfaces inherited from class org.jdrupes.httpcodec.types.ParameterizedValue
ParameterizedValue.ParameterizedValueConverter<T>, ParameterizedValue.ParamValueConverterBase<P extends ParameterizedValue<U>,U> -
Field Summary
FieldsFields inherited from class org.jdrupes.httpcodec.types.ParameterizedValue
WEIGHT_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionMediaRange(String type, String subtype) Create a new object with the given type and subtype.Create a new object with the given type, subtype and parameters.MediaRange(MediaBase.MediaTypePair type, Map<String, String> parameters) Create a new object with the given type and parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaRange.Builderbuilder()Creates a new builder for a media type.intcompareTo(MediaRange other) booleanChecks if the given media type falls within this range.Methods inherited from class org.jdrupes.httpcodec.types.MediaBase
subtype, topLevelTypeMethods inherited from class org.jdrupes.httpcodec.types.ParameterizedValue
equals, hashCode, parameter, parameters, toString, value
-
Field Details
-
ALL_MEDIA
-
-
Constructor Details
-
MediaRange
Create a new object with the given type and subtype.- Parameters:
type- the top-level typesubtype- the subtype
-
MediaRange
Create a new object with the given type, subtype and parameters.- Parameters:
type- the top-level typesubtype- the subtypeparameters- the parameters
-
MediaRange
Create a new object with the given type and parameters.- Parameters:
type- the typeparameters- the parameters
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<MediaRange>
-
matches
Checks if the given media type falls within this range.- Parameters:
type- the type to check- Returns:
- the result
-
builder
Creates a new builder for a media type.- Returns:
- the builder
-