E - exception thrown by the procedure@FunctionalInterface
public interface FragileProcedure0<E extends java.lang.Exception>
Procedure0,
FragileProcedure1,
FragileProcedure2,
FragileProcedure3| Modifier and Type | Field and Description |
|---|---|
static FragileProcedure0<?> |
NULL
Fragile procedure with no arguments which does nothing, not even throw.
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply()
Run the function.
|
default <Any> FragileProcedure1<E,Any> |
asProcedure1()
Return a view of this procedure which accepts an additional but ignored parameter.
|
static <X extends java.lang.Exception> |
empty()
Return a zero argument procedure which does nothing, not even throw.
|
default Procedure0 |
nonFragile()
Convert this to a non-fragile procedure which does not throw a checked exception.
|
default Procedure0 |
nonFragileX(java.util.function.Consumer<? super E> exceptionHandler)
Convert this to a non-fragile procedure which does not a checked exception.
|
@NotNull static final FragileProcedure0<?> NULL
empty() instead.void apply()
throws E extends java.lang.Exception
E - exceptionE extends java.lang.Exception@NotNull default <Any> FragileProcedure1<E,Any> asProcedure1()
This is sometimes useful when another functional signature is required.
FragileProcedure0<IOException> foo = () -> is.write(0xFF);
FragileProcedure1<IOException, Integer> bar = foo.asProcedure1();
FragileProcedure1<IOException, String> baz = foo.asProcedure1();
Any - parameter type of returned procedure@NotNull default Procedure0 nonFragile()
WrappedFragileException for any
checked exception thrown during apply().Procedure0.nonFragile(FragileProcedure0)@NotNull default Procedure0 nonFragileX(@NotNull java.util.function.Consumer<? super E> exceptionHandler)
WrappedFragileException for any
checked exception thrown during apply().exceptionHandler - handler called when an exception is encountered.
It may either ignore it, throw an unchecked exception,
or collect the exceptionsProcedure0.nonFragileX(FragileProcedure0, Consumer)@NotNull static <X extends java.lang.Exception> FragileProcedure0<X> empty()
X - exception type