Interface Handler

  • 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 Handler
    A functional interface to proceed any operation. May be used to provide click handler or any other runnable action.

    Handlers can be composed using the andThen(Handler) method.

    • Field Detail

      • NOP_HANDLER

        static final Handler NOP_HANDLER
        A handler that does nothing.
    • Method Detail

      • apply

        void apply()
        Called when the handler should be applied.
      • compose

        default Handler compose​(Handler before)
        Returns a composed handler that first applies the before handler, and then applies this handler. If evaluation of either handler throws an exception, it is relayed to the caller of the composed handler.
        Parameters:
        before - the handler to apply before this handler is applied
        Returns:
        a composed handler that first applies the before handler and then applies this handler
        Throws:
        NullPointerException - if before is null
        See Also:
        andThen(Handler)