public final class Osgl.Option.f extends Object
| Modifier and Type | Field and Description |
|---|---|
Osgl.F0<T> |
GET
A function that when applied, returns the value described by this
Option |
Osgl.F0<Boolean> |
IS_DEFINED
A function that when applied, returns if the
Option is defined |
Osgl.F0<Boolean> |
NOT_DEFINED
Negate of
IS_DEFINED |
| Modifier and Type | Method and Description |
|---|---|
Osgl.F0<Osgl.Option<T>> |
filter(Osgl.Function<? super T,Boolean> predicate)
Returns a function that when applied, run
Osgl.Option.filter(Osgl.Function) on this
Option |
<B> Osgl.F0<Osgl.Option<B>> |
flatMap(Osgl.Function<? super T,Osgl.Option<B>> mapper)
Returns a function that when applied, run
Osgl.Option.flatMap(Osgl.Function) on this
Option |
<B> Osgl.F0<Osgl.Option<B>> |
map(Osgl.Function<? super T,? extends B> mapper)
Returns a function that when applied, run
Osgl.Option.map(Osgl.Function) on this
Option |
Osgl.F0<T> |
orElse(Osgl.Func0<? extends T> other)
Returns a function that when applied, run
Osgl.Option.orElse(Osgl.Func0)
on this Option |
Osgl.F0<T> |
orElse(T other)
Returns a function that when applied, run
Osgl.Option.orElse(Object) on this
Option |
Osgl.F0<Void> |
runWith(Osgl.Function<? super T,?> consumer)
Returns a function that when applied, run
Osgl.Option.runWith(Osgl.Function)
on this Option |
public final Osgl.F0<Boolean> IS_DEFINED
Option is definedpublic final Osgl.F0<Boolean> NOT_DEFINED
IS_DEFINEDpublic final Osgl.F0<Osgl.Option<T>> filter(Osgl.Function<? super T,Boolean> predicate)
Osgl.Option.filter(Osgl.Function) on this
Optionpredicate - the predicate functionOsgl.NONE if predicate failed
to test on the element in this optionpublic final <B> Osgl.F0<Osgl.Option<B>> map(Osgl.Function<? super T,? extends B> mapper)
Osgl.Option.map(Osgl.Function) on this
OptionB - the type of returning option element typemapper - the function that map T element to B objectB type option if this option
is defined or Osgl.NONE if this option is not definedpublic final <B> Osgl.F0<Osgl.Option<B>> flatMap(Osgl.Function<? super T,Osgl.Option<B>> mapper)
Osgl.Option.flatMap(Osgl.Function) on this
OptionB - 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 Osgl.F0<T> orElse(T other)
Osgl.Option.orElse(Object) on this
Optionother - the other value to be returned if this option is emptyelse if semanticpublic final Osgl.F0<T> orElse(Osgl.Func0<? extends T> other)
Osgl.Option.orElse(Osgl.Func0)
on this Optionother - the function that generates another T element when this
option is emptyelse if semantic on this Optionpublic final Osgl.F0<Void> runWith(Osgl.Function<? super T,?> consumer)
Osgl.Option.runWith(Osgl.Function)
on this Optionconsumer - the function that consumes the element in this Optionconsumer function if this Option is definedCopyright © 2017. All Rights Reserved.