| Package | Description |
|---|---|
| org.osgl | |
| org.osgl.util |
| Modifier and Type | Class and Description |
|---|---|
static class |
Lang.None<T> |
static class |
Lang.Some<T> |
| Modifier and Type | Method and Description |
|---|---|
static <T> Lang.Option<T> |
Lang.cast(Object o,
Class<T> c)
Cast an object to a type.
|
Lang.Option<T> |
Lang.Option.filter(Lang.Function<? super T,Boolean> predicate)
If a value is present, and the value matches the given predicate, return an
Option describing the value, otherwise return Lang.NONE. |
Lang.Option<T> |
Lang.Var.findFirst(Lang.Function<? super T,Boolean> predicate) |
Lang.Option<T> |
Lang.Var.findLast(Lang.Function<? super T,Boolean> predicate) |
Lang.Option<T> |
Lang.Var.findOne(Lang.Function<? super T,Boolean> predicate) |
<B> Lang.Option<B> |
Lang.Option.flatMap(Lang.Function<? super T,Lang.Option<B>> mapper)
If a value is present, apply the provided
Option-bearing mapping function to it, return that result, otherwise return Lang.NONE. |
<B> Lang.Option<B> |
Lang.Option.map(Lang.Function<? super T,? extends B> mapper)
If a value is present, apply the provided mapping function to it, and if the result is non-null, return an
Option describing the result. |
static <T> Lang.Option<T> |
Lang.Option.of(T value)
|
Lang.Option<T> |
Lang.Var.reduce(Lang.Func2<T,T,T> accumulator) |
Lang.Option<T> |
Lang.Var.reduceLeft(Lang.Func2<T,T,T> accumulator) |
Lang.Option<T> |
Lang.Var.reduceRight(Lang.Func2<T,T,T> accumulator) |
static <T> Lang.Option<Class<T>> |
Lang.safeClassForName(String className) |
static <T> Lang.Option<Class<T>> |
Lang.safeClassForName(String className,
ClassLoader classLoader) |
static <T> Lang.Option<T> |
Lang.safeNewInstance(String className) |
static <T> Lang.Option<T> |
Lang.some(T a) |
Lang.Option<T> |
Lang.Var.toOption() |
| Modifier and Type | Method and Description |
|---|---|
<R> Lang.F1<T,Lang.Option<R>> |
Lang.Predicate.elseThen(Lang.Function<? super T,R> func) |
Lang.F0<Lang.Option<T>> |
Lang.Option.f.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>> |
Lang.Option.f.flatMap(Lang.Function<? super T,Lang.Option<B>> mapper)
Returns a function that when applied, run
Option#flatMap(Function) on this Option |
<R> Lang.F1<T,Lang.Option<R>> |
Lang.Predicate.ifThen(Lang.Function<? super T,R> func) |
Lang.F0<Lang.Option<R>> |
Lang.F0.lift()
Turns this partial function into a plain function returning an Option result.
|
Lang.F1<P1,Lang.Option<R>> |
Lang.F1.lift()
Turns this partial function into a plain function returning an Option result.
|
Lang.F2<P1,P2,Lang.Option<R>> |
Lang.F2.lift()
Turns this partial function into a plain function returning an Option result.
|
Lang.F3<P1,P2,P3,Lang.Option<R>> |
Lang.F3.lift()
Turns this partial function into a plain function returning an Option result.
|
Lang.F4<P1,P2,P3,P4,Lang.Option<R>> |
Lang.F4.lift()
Turns this partial function into a plain function returning an Option result.
|
Lang.F5<P1,P2,P3,P4,P5,Lang.Option<R>> |
Lang.F5.lift()
Turns this partial function into a plain function returning an Option result.
|
<B> Lang.F0<Lang.Option<B>> |
Lang.Option.f.map(Lang.Function<? super T,? extends B> mapper)
Returns a function that when applied, run
Option#map(Function) on this Option |
| Modifier and Type | Method and Description |
|---|---|
<B> Lang.Option<B> |
Lang.Option.flatMap(Lang.Function<? super T,Lang.Option<B>> mapper)
If a value is present, apply the provided
Option-bearing mapping function to it, return that result, otherwise return Lang.NONE. |
<B> Lang.F0<Lang.Option<B>> |
Lang.Option.f.flatMap(Lang.Function<? super T,Lang.Option<B>> mapper)
Returns a function that when applied, run
Option#flatMap(Function) on this Option |
| Modifier and Type | Method and Description |
|---|---|
Lang.Option<T> |
C.Sequence.findFirst(Lang.Function<? super T,Boolean> predicate)
Apply the predicate specified to the element of this sequence from head to tail.
|
Lang.Option<T> |
ListBase.findFirst(Lang.Function<? super T,Boolean> predicate) |
Lang.Option<T> |
SequenceBase.findFirst(Lang.Function<? super T,Boolean> predicate)
Delegate to
TraversableBase.findOne(org.osgl.Lang.Function) |
Lang.Option<ELEMENT> |
C.Range.findLast(Lang.Function<? super ELEMENT,Boolean> predicate) |
Lang.Option<ELEMENT> |
LazyRange.findLast(Lang.Function<? super ELEMENT,Boolean> predicate) |
Lang.Option<T> |
C.ReversibleSequence.findLast(Lang.Function<? super T,Boolean> predicate)
Apply the predicate specified to the element of this sequence from tail to head.
|
Lang.Option<T> |
ListBase.findLast(Lang.Function<? super T,Boolean> predicate) |
Lang.Option<T> |
C.Traversable.findOne(Lang.Function<? super T,Boolean> predicate)
Returns an element that matches the predicate specified.
|
Lang.Option<T> |
ListBase.findOne(Lang.Function<? super T,Boolean> predicate) |
Lang.Option<T> |
TraversableBase.findOne(Lang.Function<? super T,Boolean> predicate)
Iterate the traversal to check if any element applied to the predicate the iteration process stop when the element is found and return an option describing the element.
|
Lang.Option<T> |
SetBase.findOne(Lang.Function<? super T,Boolean> predicate) |
Lang.Option<T> |
C.Traversable.reduce(Lang.Func2<T,T,T> accumulator)
Performs a reduction on the elements in this traversable, using provided accumulating function.
|
Lang.Option<T> |
C.Sequence.reduce(Lang.Func2<T,T,T> accumulator)
Performs a reduction on the elements in this traversable, using provided accumulating function.
|
Lang.Option<T> |
ListBase.reduce(Lang.Func2<T,T,T> accumulator) |
Lang.Option<T> |
TraversableBase.reduce(Lang.Func2<T,T,T> accumulator)
Iterate through the traversal to apply the accumulator to the result of previous application and the element being iterated.
|
Lang.Option<T> |
SetBase.reduce(Lang.Func2<T,T,T> accumulator) |
Lang.Option<T> |
C.Sequence.reduceLeft(Lang.Func2<T,T,T> accumulator)
Run reduction from head to tail.
|
Lang.Option<T> |
ListBase.reduceLeft(Lang.Func2<T,T,T> accumulator) |
Lang.Option<T> |
SequenceBase.reduceLeft(Lang.Func2<T,T,T> accumulator)
Delegate to
TraversableBase.reduce(org.osgl.Lang.Func2) |
Lang.Option<ELEMENT> |
C.Range.reduceRight(Lang.Func2<ELEMENT,ELEMENT,ELEMENT> accumulator) |
Lang.Option<ELEMENT> |
LazyRange.reduceRight(Lang.Func2<ELEMENT,ELEMENT,ELEMENT> accumulator) |
Lang.Option<T> |
C.ReversibleSequence.reduceRight(Lang.Func2<T,T,T> accumulator)
Run reduction from tail to head.
|
Lang.Option<T> |
ListBase.reduceRight(Lang.Func2<T,T,T> accumulator) |
Copyright © 2014–2021 OSGL (Open Source General Library). All rights reserved.