P1
- first parameter typeP2
- second parameter type@FunctionalInterface public interface FragileProcedure2<E extends java.lang.Exception,P1,P2> extends FragileProcedure1<E,ITuple2<? extends P1,? extends P2>>
BiConsumer
,
but in a more extensible way.
As it is extending BiConsumer
it can be used anywhereProcedure0
,
Procedure1
,
Procedure3
,
Procedure4
,
Procedure5
,
Procedure6
,
Procedure7
,
Procedure8
,
Procedure9
Modifier and Type | Field and Description |
---|---|
static FragileProcedure2<?,?,?> |
NULL
Procedure with two arguments which does nothing.
|
Modifier and Type | Method and Description |
---|---|
default <FR extends ITuple2<? extends P1,? extends P2>,FP> |
after1(java.util.function.Function<FP,FR> before)
Get a chained procedure which first applies the given function, then this procedure.
|
default void |
apply(ITuple2<? extends P1,? extends P2> tuple2)
Expand a tuple into the arguments of this procedure.
|
void |
apply(P1 arg1,
P2 arg2)
Run the function.
|
static <X extends java.lang.Exception,T1,T2> |
empty()
Return a procedure which does nothing.
|
default Procedure2<P1,P2> |
nonFragile()
Convert this to a non-fragile procedure which does not throw a checked exception.
|
default Procedure2<P1,P2> |
nonFragileX(Procedure3<? super E,? super P1,? super P2> exceptionHandler)
Convert this to a non-fragile procedure which does not a checked exception.
|
default FragileProcedure1<E,P2> |
partial1(P1 argument)
Get a partially applied procedure.
|
default FragileProcedure1<E,P1> |
partial2(P2 argument)
Get a partially applied procedure.
|
default FragileProcedure1<E,P2> |
partialLeft(P1 argument)
Get a partially applied procedure.
|
default FragileProcedure1<E,P1> |
partialRight(P2 argument)
Get a partially applied procedure.
|
applyNonNull, nonFragileX, partial
@NotNull static final FragileProcedure2<?,?,?> NULL
empty()
instead.default void apply(@NotNull ITuple2<? extends P1,? extends P2> tuple2) throws E extends java.lang.Exception
void apply(P1 arg1, P2 arg2) throws E extends java.lang.Exception
arg1
- first function argumentarg2
- second function argumentE
- on errorsE extends java.lang.Exception
@NotNull default Procedure2<P1,P2> nonFragile()
WrappedFragileException
for any
checked exception thrown during apply(Object, Object)
.nonFragile
in interface FragileProcedure1<E extends java.lang.Exception,ITuple2<? extends P1,? extends P2>>
Procedure2.nonFragile(FragileProcedure2)
@NotNull default Procedure2<P1,P2> nonFragileX(@NotNull Procedure3<? super E,? super P1,? super P2> exceptionHandler)
WrappedFragileException
for any
checked exception thrown during apply(Object, Object)
.exceptionHandler
- handler called when an exception is encountered.
It may either ignore it, throw an unchecked exception,
or collect the exceptionsProcedure2.nonFragileX(FragileProcedure2, Procedure3)
@NotNull default FragileProcedure1<E,P2> partialLeft(P1 argument)
argument
- value applied for first argument@NotNull default FragileProcedure1<E,P2> partial1(P1 argument)
partialLeft(Object)
, but with a name which is more
consistent with functions having more arguments.argument
- value applied for first argument@NotNull default FragileProcedure1<E,P1> partialRight(P2 argument)
argument
- value applied for second argument@NotNull default FragileProcedure1<E,P1> partial2(P2 argument)
partialRight(Object)
, but with a name which is more
consistent with functions having more arguments.argument
- value applied for second argument@NotNull default <FR extends ITuple2<? extends P1,? extends P2>,FP> FragileProcedure1<E,FP> after1(@NotNull java.util.function.Function<FP,FR> before)
ITuple2
with matching parametric types
which are applied in their order to this procedure.FR
- function before
's return type, has to be a 2-tuple with matching typesFP
- function before
's parameter type, same for returned procedurebefore
- function to apply first, has to return a non-null
result so unpacking the parameters
from the tuple is possible@NotNull static <X extends java.lang.Exception,T1,T2> FragileProcedure2<X,T1,T2> empty()
NULL
, but the compiler will accept it smoothly.