Interface MediaType

All Known Implementing Classes:
XContentType

public interface MediaType
Abstracts a Media Type and a format parameter. Media types are used as values on Content-Type and Accept headers format is an URL parameter, specifies response media type.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a corresponding format for a MediaType.
    Returns a subtype part of a MediaType.
    Returns a type part of a MediaType i.e.
    default String
    returns a string representation of a media type.
  • Method Details

    • type

      String type()
      Returns a type part of a MediaType i.e. application for application/json
    • subtype

      String subtype()
      Returns a subtype part of a MediaType. i.e. json for application/json
    • format

      String format()
      Returns a corresponding format for a MediaType. i.e. json for application/json media type Can differ from the MediaType's subtype i.e plain/text has a subtype of text but format is txt
    • typeWithSubtype

      default String typeWithSubtype()
      returns a string representation of a media type.