java.lang.Object
org.junit.jupiter.api.extension.MediaType
Represents a media type as defined by
RFC 2045.
- Since:
- 5.12
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MediaType
Theapplication/json
media type.static final MediaType
Theapplication/json; charset=UTF-8
media type.static final MediaType
Theapplication/octet-stream
media type.static final MediaType
Theimage/jpeg
media type.static final MediaType
Theimage/png
media type.static final MediaType
Thetext/plain
media type.static final MediaType
Thetext/plain; charset=UTF-8
media type. -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaType
Create a media type with the given type and subtype.static MediaType
Create a media type with the given type, subtype, and charset.boolean
int
hashCode()
static MediaType
Parse the given media type value.toString()
Returns string representation of this media type.
-
Field Details
-
TEXT_PLAIN
Thetext/plain
media type. -
TEXT_PLAIN_UTF_8
Thetext/plain; charset=UTF-8
media type. -
APPLICATION_JSON
Theapplication/json
media type. -
APPLICATION_JSON_UTF_8
Theapplication/json; charset=UTF-8
media type. -
APPLICATION_OCTET_STREAM
Theapplication/octet-stream
media type. -
IMAGE_JPEG
Theimage/jpeg
media type. -
IMAGE_PNG
Theimage/png
media type.
-
-
Method Details
-
parse
Parse the given media type value.Must be valid according to RFC 2045.
- Parameters:
value
- the media type value to parse; nevernull
- Returns:
- the parsed media type
- Throws:
PreconditionViolationException
- if the value is not a valid media type
-
create
Create a media type with the given type and subtype.- Parameters:
type
- the type; nevernull
subtype
- the subtype; nevernull
- Returns:
- the media type
-
create
Create a media type with the given type, subtype, and charset.- Parameters:
type
- the type; nevernull
subtype
- the subtype; nevernull
charset
- the charset; nevernull
- Returns:
- the media type
-
toString
Returns string representation of this media type. -
equals
-
hashCode
public int hashCode()
-