Class FkContentType

  • All Implemented Interfaces:
    Fork

    public final class FkContentType
    extends Object
    implements Fork
    Fork by Content-type accepted by "Content-Type" HTTP header.

    The class is immutable and thread-safe.

    Since:
    1.0
    See Also:
    RsFork
    • Constructor Detail

      • FkContentType

        public FkContentType​(String atype,
                             Response response)
        Ctor.
        Parameters:
        atype - Accepted type
        response - Response to return
      • FkContentType

        public FkContentType​(String atype,
                             Take take)
        Ctor.
        Parameters:
        atype - Accepted type
        take - Take to handle the request dynamically.
    • Method Detail

      • route

        public Opt<Response> route​(Request req)
                            throws Exception
        Description copied from interface: Fork
        Process this request or ignore it.
        Specified by:
        route in interface Fork
        Parameters:
        req - Request
        Returns:
        Non-empty list of responses if it was processed
        Throws:
        Exception - If fails