public final class MediaType
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
asString() |
Formats the media type as it should appear in an HTTP
Content-Type header. |
boolean |
equals(java.lang.Object o) |
|
int |
hashCode() |
|
static MediaType |
mediaType(java.lang.String type,
java.lang.String subType) |
Factory method for generating a media type with the given top-level type and subtype, and no parameters.
|
static MediaType |
mediaType(Type type,
SubType subType,
java.lang.Iterable<Parameter> parameters) |
Factory method for generating a media type with the given top-level type, subtype, and parameters.
|
static MediaType |
mediaType(Type type,
SubType subType,
Parameter... parameters) |
Factory method for generating a media type with the given top-level type, subtype, and parameters.
|
static MediaType |
mediaType(Type type,
SubType subType,
Parameters parameters) |
Factory method for generating a media type with the given top-level type, subtype, and parameters.
|
Parameters |
parameters() |
The parameters of this media type.
|
SubType |
subType() |
The subtype of this media type.
|
java.lang.String |
toString() |
|
Type |
type() |
The (top level) type of this media type.
|
public static MediaType mediaType(java.lang.String type, java.lang.String subType)
type
- the String
representation of the top-level type.subType
- the String
representation of the sub type.MediaType
representing the given top-level type and sub type.public static MediaType mediaType(Type type, SubType subType, Parameter... parameters)
type
- the top-level type.subType
- the sub type.parameters
- the parameters.MediaType
representing the given top-level type, sub type, and parameters.public static MediaType mediaType(Type type, SubType subType, java.lang.Iterable<Parameter> parameters)
type
- the top-level type.subType
- the sub type.parameters
- the parameters.MediaType
representing the given top-level type, sub type, and parameters.public static MediaType mediaType(Type type, SubType subType, Parameters parameters)
type
- the top-level type.subType
- the sub type.parameters
- the parameters.MediaType
representing the given top-level type, sub type, and parameters.public Type type()
public SubType subType()
public Parameters parameters()
public java.lang.String asString()
Content-Type
header.Content-Type
header.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object