public abstract static class Osgl.F0<R> extends Osgl.FuncBase implements Osgl.Func0<R>
Osgl.Func0. Implementation of Osgl.Func0 should
(nearly) always extend to this class instead of implement the interface directly| Constructor and Description |
|---|
F0() |
| Modifier and Type | Method and Description |
|---|---|
Osgl.F0<R> |
andThen(Osgl.Func0<? extends R>... fs)
Returns a composed function that applied, in sequence, this function and
all functions specified one by one.
|
<T> Osgl.F0<T> |
andThen(Osgl.Function<? super R,? extends T> after)
Returns a composed function that applies this function to it's input and
then applies the
after function to the result. |
R |
applyOrElse(Osgl.F0<? extends R> fallback)
Applies this partial function to the given argument when it is contained in the function domain.
|
Osgl.F0<Osgl.Option<R>> |
lift()
Turns this partial function into a plain function returning an Option result.
|
Osgl.F0<R> |
orElse(Osgl.Func0<? extends R> fallback)
Returns a composed function that when applied, try to apply this function first, in case
a
RuntimeException is captured apply to the fallback function specified. |
breakOutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic R applyOrElse(Osgl.F0<? extends R> fallback)
RuntimeException is capturedfallback - if RuntimeException captured then apply this fallback functionpublic <T> Osgl.F0<T> andThen(Osgl.Function<? super R,? extends T> after)
after function to the result. If evaluation of either
function throws an exception, it is relayed to the caller of the composed
function.T - the type of the output of the before functionafter - the function applies after this function is appliedNullPointerException - if before is nullpublic Osgl.F0<R> andThen(Osgl.Func0<? 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.F0<R> orElse(Osgl.Func0<? extends R> fallback)
RuntimeException 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 in the current situationpublic Osgl.F0<Osgl.Option<R>> lift()
Copyright © 2017. All Rights Reserved.