Class MediaType

java.lang.Object
org.junit.jupiter.api.MediaType
org.junit.jupiter.api.extension.MediaType

@Deprecated(since="5.14", forRemoval=true) @API(status=DEPRECATED, since="5.14") public final class MediaType extends MediaType
Deprecated, for removal: This API element is subject to removal in a future version.
Use MediaType instead.
Represents a media type as defined by RFC 2045.
Since:
5.12
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MediaType
    Deprecated, for removal: This API element is subject to removal in a future version.
    The application/json media type.
    static final MediaType
    Deprecated.
    Use APPLICATION_JSON instead.
    static final MediaType
    Deprecated, for removal: This API element is subject to removal in a future version.
    The application/octet-stream media type.
    static final MediaType
    Deprecated, for removal: This API element is subject to removal in a future version.
    The image/jpeg media type.
    static final MediaType
    Deprecated, for removal: This API element is subject to removal in a future version.
    The image/png media type.
    static final MediaType
    Deprecated, for removal: This API element is subject to removal in a future version.
    The text/plain media type.
    static final MediaType
    Deprecated, for removal: This API element is subject to removal in a future version.
    The text/plain; charset=UTF-8 media type.
  • Method Summary

    Modifier and Type
    Method
    Description
    static MediaType
    create(String type, String subtype)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a media type with the given type and subtype.
    static MediaType
    create(String type, String subtype, Charset charset)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a media type with the given type, subtype, and charset.
    static MediaType
    parse(String value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parse the given media type value.

    Methods inherited from class MediaType

    equals, hashCode, toString

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • TEXT_PLAIN

      public static final MediaType TEXT_PLAIN
      Deprecated, for removal: This API element is subject to removal in a future version.
      The text/plain media type.
    • TEXT_PLAIN_UTF_8

      public static final MediaType TEXT_PLAIN_UTF_8
      Deprecated, for removal: This API element is subject to removal in a future version.
      The text/plain; charset=UTF-8 media type.
    • APPLICATION_JSON

      public static final MediaType APPLICATION_JSON
      Deprecated, for removal: This API element is subject to removal in a future version.
      The application/json media type.
    • APPLICATION_JSON_UTF_8

      @Deprecated(since="5.14") @API(status=DEPRECATED, since="5.14") public static final MediaType APPLICATION_JSON_UTF_8
      Deprecated.
      Use APPLICATION_JSON instead.
      The application/json; charset=UTF-8 media type.
    • APPLICATION_OCTET_STREAM

      public static final MediaType APPLICATION_OCTET_STREAM
      Deprecated, for removal: This API element is subject to removal in a future version.
      The application/octet-stream media type.
    • IMAGE_JPEG

      public static final MediaType IMAGE_JPEG
      Deprecated, for removal: This API element is subject to removal in a future version.
      The image/jpeg media type.
    • IMAGE_PNG

      public static final MediaType IMAGE_PNG
      Deprecated, for removal: This API element is subject to removal in a future version.
      The image/png media type.
  • Method Details

    • parse

      public static MediaType parse(String value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parse the given media type value.

      Must be valid according to RFC 2045.

      Parameters:
      value - the media type value to parse; never null or blank
      Returns:
      the parsed media type
      Throws:
      org.junit.platform.commons.PreconditionViolationException - if the value is not a valid media type
    • create

      public static MediaType create(String type, String subtype)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a media type with the given type and subtype.
      Parameters:
      type - the type; never null or blank
      subtype - the subtype; never null or blank
      Returns:
      the media type
    • create

      public static MediaType create(String type, String subtype, Charset charset)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a media type with the given type, subtype, and charset.
      Parameters:
      type - the type; never null or blank
      subtype - the subtype; never null or blank
      charset - the charset; never null
      Returns:
      the media type