public final class MediaType extends Object
| Modifier and Type | Field and Description |
|---|---|
static MediaType |
APPLICATION_X_WWW_FORM_URLENCODED
.
|
static MediaType |
MULTIPART_FORM_DATA_MEDIA_TYPE
.
|
static MediaType |
TEXT_CSS
.
|
static MediaType |
TEXT_HTML
.
|
static MediaType |
TEXT_JAVASCRIPT
.
|
| Modifier and Type | Method and Description |
|---|---|
static MediaType |
create(String mediaTypeName)
Create a media type object by parsing a media type name.
|
static MediaType |
create(String typeName,
String subtypeName)
Create a media type object by using the provided type name and subtype name.
|
static MediaType |
create(TypeDef type,
SubtypeDef subtype)
Create a media type object using the provided type and subtype objects.
|
boolean |
equals(Object obj) |
SubtypeDef |
getSubtype() |
TypeDef |
getType() |
String |
getValue()
Returns the value which is a concatenation ofthe type name, a slash char and the subtype name.
|
int |
hashCode() |
String |
toString() |
public static final MediaType TEXT_HTML
public static final MediaType TEXT_JAVASCRIPT
public static final MediaType TEXT_CSS
public static final MediaType APPLICATION_X_WWW_FORM_URLENCODED
public static final MediaType MULTIPART_FORM_DATA_MEDIA_TYPE
public static MediaType create(String mediaTypeName) throws IllegalArgumentException
mediaTypeName - the media type name valueIllegalArgumentException - if the argument is null or is not validpublic static MediaType create(String typeName, String subtypeName) throws IllegalArgumentException
typeName - the type namesubtypeName - the subtype nameIllegalArgumentException - if any argument is null or not validpublic static MediaType create(TypeDef type, SubtypeDef subtype) throws IllegalArgumentException
type - the typesubtype - the subtypeIllegalArgumentException - if any argument is nullpublic TypeDef getType()
public SubtypeDef getSubtype()
public String getValue()
Copyright © 2025 JBoss by Red Hat. All Rights Reserved.