Interface KiwiRunnables.ThrowingRunnable

  • Enclosing class:
    KiwiRunnables
    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 static interface KiwiRunnables.ThrowingRunnable
    A variation on Runnable which allows exceptions to be thrown.

    Note that since it has no relation to Runnable it can't be used in things like Java's concurrency classes that expect Runnable. However, you can use the provided conversion methods to convert into Runnable objects.

    • Method Detail

      • run

        void run()
          throws Exception
        Does something that might throw a checked exception.
        Throws:
        Exception - if something went wrong
      • toCatchingRunnable

        default org.kiwiproject.base.CatchingRunnable toCatchingRunnable()
        Converts this instance to a CatchingRunnable.
        Returns:
        a new CatchingRunnable instance