Interface ServletConsumer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ServletConsumer
    An operation that takes a ServletRequest and ServletResponse and returns no result. This is a specialization of BiConsumer that allows IOException to be thrown.
    Author:
    Rob Spoor
    • Method Detail

      • accept

        void accept​(ServletRequest request,
                    ServletResponse response)
             throws IOException
        Performs this operation on the given request and response.
        Parameters:
        request - The request to operate on.
        response - The response to operate on.
        Throws:
        IOException - If an I/O error occurs
      • andThen

        default ServletConsumer andThen​(ServletConsumer after)
        Returns a composed ServletConsumer that performs, in sequence, this operation followed by the after operation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, the after operation will not be performed.
        Parameters:
        after - The operation to perform after this operation.
        Returns:
        A composed ServletConsumer that performs in sequence this operation followed by the after operation.
        Throws:
        NullPointerException - If after is null.