Interface Handler

    • Method Detail

      • create

        static <T> Handler create​(Class<T> entityType,
                                  Handler.EntityHandler<T> entityHandler)
        Creates new instance of the Handler for the entity representing HTTP request content. See ServerRequest for more details how response can be represented as a java type.

        Created handler forwards any error created during entity read or conversion to the standard error handling (ServerRequest.next(Throwable)).

        Type Parameters:
        T - a type of the entity
        Parameters:
        entityType - a java type of the entity
        entityHandler - an entity handler to handle request entity
        Returns:
        new Handler instance
      • create

        static <T> Handler create​(Class<T> entityType,
                                  Handler.EntityHandler<T> entityHandler,
                                  ErrorHandler<Throwable> entityReadErrorHandler)
        Creates new instance of the Handler for the entity representing HTTP request content. See ServerRequest for more details how response can be represented as a java type.
        Type Parameters:
        T - a type of the entity
        Parameters:
        entityType - a java type of the entity
        entityHandler - an entity handler to handle request entity
        entityReadErrorHandler - an error handler to handle state when entity cannot be read or convert to the requested type
        Returns:
        new Handler instance