Interface ThrowingRunnable<E extends Throwable>

Type Parameters:
E - Exception to be thrown
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 ThrowingRunnable<E extends Throwable>
The SDK version of Java's Runnable interface which comes with a throw signature. Source: Runnable The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run.
Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static <E extends Throwable>
    Runnable
    Call to run() method with try-catch for unchecked exceptions.
  • Method Details

    • run

      void run() throws E
      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.

      Throws:
      E - Exception to be thrown
      See Also:
    • unchecked

      static <E extends Throwable> Runnable unchecked(ThrowingRunnable<E> f)
      Call to run() method with try-catch for unchecked exceptions.
      Type Parameters:
      E - Exception to be thrown
      Parameters:
      f - ThrowingRunnable object with exception E
      Returns:
      Runnable