Interface UncheckedRunnable

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 UncheckedRunnable extends Runnable
Runnable that may throw; checked exceptions are rethrown via ReflectionUtil.propagate(Throwable).
  • Method Summary

    Modifier and Type
    Method
    Description
    Gives a throwing method reference this interface as its target type.
    default void
    run()
    Delegates to uncheckedRun(); checked exceptions are propagated.
    void
    Same as run(), but may throw.
  • Method Details

    • run

      default void run()
      Delegates to uncheckedRun(); checked exceptions are propagated.
      Specified by:
      run in interface Runnable
    • uncheckedRun

      void uncheckedRun() throws Throwable
      Same as run(), but may throw.
      Throws:
      Throwable
    • of

      static UncheckedRunnable of(UncheckedRunnable runnable)
      Gives a throwing method reference this interface as its target type. The same instance is returned; run() still propagates checked exceptions.