Class FkTypes

  • All Implemented Interfaces:
    Fork

    public final class FkTypes
    extends Object
    implements Fork
    Fork by types accepted by "Accept" HTTP header.

    The class is immutable and thread-safe.

    Since:
    0.6
    See Also:
    RsFork
    • Constructor Detail

      • FkTypes

        public FkTypes​(String list,
                       Response resp)
        Ctor.
        Parameters:
        list - List of types
        resp - Response to return
      • FkTypes

        public FkTypes​(String list,
                       Take tke)
        Ctor.
        Parameters:
        list - List of types
        tke - The take to use to build the response to return
    • 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