R
- return typeE
- exception typeP1
- first parameter typeP2
- second parameter type@FunctionalInterface public interface FragileFunction2<R,E extends java.lang.Exception,P1,P2> extends FragileFunction1<R,E,ITuple2<? extends P1,? extends P2>>
Modifier and Type | Method and Description |
---|---|
default R |
apply(ITuple2<? extends P1,? extends P2> tuple2)
Expand a tuple into the arguments of this function.
|
R |
apply(P1 arg1,
P2 arg2)
Run the function.
|
default Function2<R,P1,P2> |
nonFragile()
Convert this to a non-fragile function which does not throw a checked exception.
|
default Function2<R,P1,P2> |
nonFragile(R fallback)
Convert this to a non-fragile function which does not throw a checked exception.
|
default Function2<R,P1,P2> |
nonFragileX(Function3<? extends R,? super E,? super P1,? super P2> exceptionHandler)
Convert this to a non-fragile function which does not throw a checked exception.
|
default FragileFunction1<R,E,P2> |
partial1(P1 argument)
Get a partially applied function.
|
default FragileFunction1<R,E,P1> |
partial2(P2 argument)
Get a partially applied function.
|
nonFragileX
R apply(P1 arg1, P2 arg2) throws E extends java.lang.Exception
arg1
- first argumentarg2
- second argumentE
- typed exceptionE extends java.lang.Exception
default R apply(@NotNull ITuple2<? extends P1,? extends P2> tuple2) throws E extends java.lang.Exception
apply
in interface FragileFunction1<R,E extends java.lang.Exception,ITuple2<? extends P1,? extends P2>>
tuple2
- tuple to expandE
- typed exceptionE extends java.lang.Exception
@NotNull default Function2<R,P1,P2> nonFragile()
WrappedFragileException
for any
checked exception thrown during apply(Object, Object)
.nonFragile
in interface FragileFunction1<R,E extends java.lang.Exception,ITuple2<? extends P1,? extends P2>>
Function2.nonFragile(FragileFunction2)
@NotNull default Function2<R,P1,P2> nonFragile(R fallback)
fallback
value.
Please note that in this case the exception is completely lost!nonFragile
in interface FragileFunction1<R,E extends java.lang.Exception,ITuple2<? extends P1,? extends P2>>
fallback
- fallback valueFunction2.nonFragile(FragileFunction2, Object)
@NotNull default Function2<R,P1,P2> nonFragileX(@NotNull Function3<? extends R,? super E,? super P1,? super P2> exceptionHandler)
exceptionHandler
- handler which can handle the exception how it sees fit.
E.g. throw an unchecked exception (compare nonFragile()
,
return a fallback (compare nonFragile(Object)
),
or do the latter but also log or collect the exceptionFunction1.nonFragileX(FragileFunction1, BiFunction)
@NotNull default FragileFunction1<R,E,P2> partial1(P1 argument)
argument
- value applied for first argument