public abstract static class Osgl.F2<P1,P2,R> extends Osgl.FuncBase implements Osgl.Func2<P1,P2,R>
Osgl.Func2 function. User application should
(nearly) always make their implementation extend to this base class
instead of implement Osgl.Func2 directly| Constructor and Description |
|---|
F2() |
| Modifier and Type | Method and Description |
|---|---|
Osgl.F2<P1,P2,R> |
andThen(Osgl.Func2<? super P1,? super P2,? extends R>... fs)
Returns a composed function that applied, in sequence, this function and
all functions specified one by one.
|
<T> Osgl.F2<P1,P2,T> |
andThen(Osgl.Function<? super R,? extends T> f)
Returns a composed function from this function and the specified function that takes the
result of this function.
|
R |
applyOrElse(P1 p1,
P2 p2,
Osgl.F2<? super P1,? super P2,? extends R> fallback)
Applies this partial function to the given argument when it is contained in the function domain.
|
Osgl.F0<R> |
curry(P1 p1,
P2 p2) |
Osgl.F1<P1,R> |
curry(P2 p2) |
Osgl.F2<P1,P2,Osgl.Option<R>> |
lift()
Turns this partial function into a plain function returning an Option result.
|
Osgl.F2<P1,P2,R> |
orElse(Osgl.Func2<? super P1,? super P2,? extends R> fallback)
Returns a composed function that when applied, try to apply this function first, in case
a
NotAppliedException is captured apply to the fallback function specified. |
breakOutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic R applyOrElse(P1 p1, P2 p2, Osgl.F2<? super P1,? super P2,? extends R> fallback)
p1 - the first param with type P1p2 - the second param with type P2fallback - the function to be called when an RuntimeException caughtpublic <T> Osgl.F2<P1,P2,T> andThen(Osgl.Function<? super R,? extends T> f)
T - the return type of function ff - the function takes the R type parameter and return T
type resultNullPointerException - if f is nullpublic Osgl.F2<P1,P2,R> andThen(Osgl.Func2<? super P1,? super P2,? extends R>... fs)
When apply the composed function, the result of the last function is returned
fs - a sequence of function to be applied after this functionpublic Osgl.F2<P1,P2,R> orElse(Osgl.Func2<? super P1,? super P2,? extends R> fallback)
NotAppliedException is captured apply to the fallback function specified. This
method helps to implement partial functionfallback - the function to applied if this function doesn't apply to the parameter(s)public Osgl.F2<P1,P2,Osgl.Option<R>> lift()
Copyright © 2017. All Rights Reserved.