Interface HttpMediaTypeAccessor.HttpMediaTypeProvider<EXC extends Exception>

Type Parameters:
EXC - The Exception to be thrown in case conversion failed. Throw a RuntimeException in order to make this method unchecked.
All Known Subinterfaces:
HttpMediaType
All Known Implementing Classes:
ContentType, MediaType
Enclosing interface:
HttpMediaTypeAccessor

public static interface HttpMediaTypeAccessor.HttpMediaTypeProvider<EXC extends Exception>
A provider interface provides a "toSomething(?)" method which converts a given instance into something else. The HttpMediaTypeAccessor.HttpMediaTypeProvider converts something like a MediaType to a Media-Type's String representation.
  • Method Summary

    Modifier and Type
    Method
    Description
    A provider interface provides a "toSomething(?)"
  • Method Details

    • toHttpMediaType

      String toHttpMediaType() throws EXC
      A provider interface provides a "toSomething(?)" method which converts a given instance into something else. Returns the HTTP media type: It consists of the Media-Top-Level-Type and the Media-Subtype as well as some (optional) suffixed parameters all being concatenated in an HTTP valid manner, such as: "application/json;charset=UTF-8".
      Returns:
      The HTTP header Media-Type as of the IANA specification.
      Throws:
      EXC - Thrown in case providing the type as String failed.