Package org.nuxeo.common.function
Interface ThrowableRunnable<E extends Throwable>
-
- Type Parameters:
E
- the type of exception to throw
- 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>
- Since:
- 11.1
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <E extends Throwable>
RunnableasRunnable(ThrowableRunnable<E> throwableRunnable)
static <E extends Throwable>
ThrowableSupplier<Void,E>asThrowableSupplier(ThrowableRunnable<E> throwableRunnable)
void
run()
default Runnable
toRunnable()
default ThrowableSupplier<Void,E>
toThrowableSupplier()
-
-
-
Method Detail
-
toRunnable
default Runnable toRunnable()
- Returns:
- this
ThrowableRunnable
as aRunnable
throwing the checked exception as an unchecked one
-
toThrowableSupplier
default ThrowableSupplier<Void,E> toThrowableSupplier()
- Returns:
- this
ThrowableRunnable
as aThrowableSupplier
returningVoid
-
asRunnable
static <E extends Throwable> Runnable asRunnable(ThrowableRunnable<E> throwableRunnable)
- Returns:
- the given
ThrowableRunnable
as aRunnable
throwing the checked exception as an unchecked one
-
asThrowableSupplier
static <E extends Throwable> ThrowableSupplier<Void,E> asThrowableSupplier(ThrowableRunnable<E> throwableRunnable)
- Returns:
- the given
ThrowableRunnable
as aThrowableSupplier
returningVoid
-
-