Interface ThrowableRunnable<E extends Throwable>

Type Parameters:
E - The type of exception this Runnable is expected to throw.
All Superinterfaces:
Runnable
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 ThrowableRunnable<E extends Throwable>
extends Runnable
Simple hack to add checked error support to a Runnables. It is mainly used in conjunction with Utilities.runnableHandling(ThrowableRunnable, Consumer) to achieve error handling within a Runnable.
Author:
Collin Alpert
See Also:
Runnable
  • Method Summary

    Modifier and Type Method Description
    void doAction()  
    default void run()
    When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
  • Method Details

    • doAction

      void doAction() throws E extends Throwable
      Throws:
      E extends Throwable
    • run

      default void run()
      When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

      The general contract of the method run is that it may take any action whatsoever.

      Specified by:
      run in interface Runnable
      See Also:
      Thread.run()