Interface ExceptionRunnable<E extends Exception>

Type Parameters:
E - the exception type

public interface ExceptionRunnable<E extends Exception>
An operation that can throw an exception.
  • Method Details

    • run

      void run() throws E
      Run the operation.
      Throws:
      E - if an exception occurs
    • andThen

      default ExceptionRunnable<E> andThen(ExceptionRunnable<? extends E> after)
      Returns a runnable which runs this task and then the given task.
      Parameters:
      after - the other task
      Returns:
      a runnable which runs this task and then the given task
    • compose

      default ExceptionRunnable<E> compose(ExceptionRunnable<? extends E> before)
      Returns a runnable which runs the given task and then this task.
      Parameters:
      before - the other task
      Returns:
      a runnable which runs the given task and then this task