Interface HttpMediaTypeAccessor.HttpMediaTypeProvider<EXC extends java.lang.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:
    ContentType, HttpMediaType
    All Known Implementing Classes:
    ContentTypeImpl, MediaType
    Enclosing interface:
    HttpMediaTypeAccessor


    public static interface HttpMediaTypeAccessor.HttpMediaTypeProvider<EXC extends java.lang.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 Detail

      • toHttpMediaType

        java.lang.String toHttpMediaType​()
                                  throws EXC extends java.lang.Exception
        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.
        EXC extends java.lang.Exception