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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Handler
    A handler that does nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Handler
    Returns a composed handler that first executes this handler's apply() method and then the apply() method of the given handler.
    void
    Called when the handler should be applied.
    default Handler
    compose(Handler before)
    Returns a composed handler that first applies the before handler, and then applies this handler.
  • Field Details

    • NOP_HANDLER

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

    • apply

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

      default Handler andThen(Handler after)
      Returns a composed handler that first executes this handler's apply() method and then the apply() method of the given handler.
      See Also:
    • 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: