Package org.junit.jupiter.api
Class MediaType
java.lang.Object
org.junit.jupiter.api.MediaType
- Direct Known Subclasses:
MediaType
Represents a media type as defined by
RFC 2045.
WARNING: This type should not be extended by third parties.
- Since:
- 5.14
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MediaTypeTheapplication/jsonmedia type.static final MediaTypeTheapplication/octet-streammedia type.static final MediaTypeTheimage/jpegmedia type.static final MediaTypeTheimage/pngmedia type.static final MediaTypeThetext/plainmedia type.static final MediaTypeThetext/plain; charset=UTF-8media type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaTypeCreate a media type with the given type and subtype.static MediaTypeCreate a media type with the given type, subtype, and charset.final booleanfinal inthashCode()static MediaTypeParse the given media type value.final StringtoString()Returns a string representation of this media type.
-
Field Details
-
TEXT_PLAIN
Thetext/plainmedia type. -
TEXT_PLAIN_UTF_8
Thetext/plain; charset=UTF-8media type. -
APPLICATION_JSON
Theapplication/jsonmedia type. -
APPLICATION_OCTET_STREAM
Theapplication/octet-streammedia type. -
IMAGE_JPEG
Theimage/jpegmedia type. -
IMAGE_PNG
Theimage/pngmedia type.
-
-
Constructor Details
-
MediaType
-
MediaType
-
-
Method Details
-
parse
Parse the given media type value.Must be valid according to RFC 2045.
- Parameters:
value- the media type value to parse; nevernullor blank- Returns:
- the parsed media type
-
create
Create a media type with the given type and subtype.- Parameters:
type- the type; nevernullor blanksubtype- the subtype; nevernullor blank- Returns:
- the media type
-
create
Create a media type with the given type, subtype, and charset.- Parameters:
type- the type; nevernullor blanksubtype- the subtype; nevernullor blankcharset- the charset; nevernull- Returns:
- the media type
-
toString
Returns a string representation of this media type. -
equals
-
hashCode
public final int hashCode()
-