public final class Lang.Option.f extends Object
The runtime/instance function namespace
| Modifier and Type | Field and Description |
|---|---|
Lang.F0<T> |
GET
A function that when applied, returns the value described by this
Option |
Lang.F0<Boolean> |
IS_DEFINED
A function that when applied, returns if the
Option is defined |
Lang.F0<Boolean> |
NOT_DEFINED
Negate of
IS_DEFINED |
| Modifier and Type | Method and Description |
|---|---|
Lang.F0<Lang.Option<T>> |
filter(Lang.Function<? super T,Boolean> predicate)
Returns a function that when applied, run
Option#filter(Function) on this Option |
<B> Lang.F0<Lang.Option<B>> |
flatMap(Lang.Function<? super T,Lang.Option<B>> mapper)
Returns a function that when applied, run
Option#flatMap(Function) on this Option |
<B> Lang.F0<Lang.Option<B>> |
map(Lang.Function<? super T,? extends B> mapper)
Returns a function that when applied, run
Option#map(Function) on this Option |
Lang.F0<T> |
orElse(Lang.Func0<? extends T> other)
Returns a function that when applied, run
Option#orElse(Func0) on this Option |
Lang.F0<T> |
orElse(T other)
Returns a function that when applied, run
Lang.Option.orElse(Object) on this Option |
Lang.F0<Void> |
runWith(Lang.Visitor<? super T> consumer)
Returns a function that when applied, run
Option#runWith(Visitor) on this Option |
public final Lang.F0<Boolean> IS_DEFINED
A function that when applied, returns if the Option is defined
public final Lang.F0<Boolean> NOT_DEFINED
Negate of IS_DEFINED
public final Lang.F0<Lang.Option<T>> filter(Lang.Function<? super T,Boolean> predicate)
Returns a function that when applied, run Option#filter(Function) on this Option
predicate - the predicate functionLang.NONE if predicate failed to test on the element in this optionpublic final <B> Lang.F0<Lang.Option<B>> map(Lang.Function<? super T,? extends B> mapper)
Returns a function that when applied, run Option#map(Function) on this Option
B - the type of returning option element typemapper - the function that map T element to B objectB type option if this option is defined or Lang.NONE if this option is not definedpublic final <B> Lang.F0<Lang.Option<B>> flatMap(Lang.Function<? super T,Lang.Option<B>> mapper)
Returns a function that when applied, run Option#flatMap(Function) on this Option
B - the element type of the Optionmapper - the function that map an elemnet of type T to a Option of type BT element to B Optionspublic final Lang.F0<T> orElse(T other)
Returns a function that when applied, run Lang.Option.orElse(Object) on this Option
other - the other value to be returned if this option is emptyelse if semanticpublic final Lang.F0<T> orElse(Lang.Func0<? extends T> other)
Returns a function that when applied, run Option#orElse(Func0) on this Option
other - the function that generates another T element when this option is emptyelse if semantic on this Optionpublic final Lang.F0<Void> runWith(Lang.Visitor<? super T> consumer)
Returns a function that when applied, run Option#runWith(Visitor) on this Option
consumer - the function that consumes the element in this Optionconsumer function if this Option is definedCopyright © 2014–2019 OSGL (Open Source General Library). All rights reserved.