public interface MediaType extends Parametrized
MediaTypes are equal if their main and subtype are equal (using case-insensitive comparison). So parameters like charset are
not taken into account for comparison. Also #hashCode() must return a values that's computed as
return type().toLower(Locale.ENGLISH).hashCode()*31 + subType.toLower(Locale.ENGLISH).hashCode();
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
charset(java.lang.String defaultCharset)
Returns the value of the charset parameter of this content type.
|
java.lang.String |
mainType()
Returns the main type.
|
java.lang.String |
subType()
Returns the sub-type of this content type.
|
java.lang.String |
type()
Returns the content type in the form
<maintype>/<subtype>. |
firstParameter, hasParameter, parametersjava.lang.String type()
<maintype>/<subtype>.java.lang.String mainType()
java.lang.String subType()
java.lang.String charset(java.lang.String defaultCharset)
defaultCharset - The charset to return if no charset parameter is present.defaultCharset