Interface ThrowableRunnable<E extends java.lang.Throwable>

  • Type Parameters:
    E - The type of exception this Runnable is expected to throw.
    All Superinterfaces:
    java.lang.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 java.lang.Throwable>
    extends java.lang.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 Detail

      • doAction

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

        @Deprecated(since="4.0")
        default void run()
        Deprecated.
        Do not use this method in a specific implementation. Please use the doAction() method instead.
        This method only exists so this interface can be used as a functional interface.
        Specified by:
        run in interface java.lang.Runnable