| Constructor and Description |
|---|
Options.Maybes() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
drop(Maybe<T> maybe)
Transforms a Maybe.nothing to null, a Maybe.just to the wrapped
value.
|
static <T> Iterator<T> |
drops(Iterable<Maybe<T>> iterable)
Creates an iterator transforming Maybes from the source iterable to
null when the source element is Nothing, to the wrapped value
otherwise.
|
static <T> Iterator<T> |
drops(Iterator<Maybe<T>> iterator)
Creates an iterator transforming Maybes from the source iterator to
null when the source element is Nothing, to the wrapped value
otherwise.
|
static <T> Iterator<T> |
drops(Maybe<T> first,
Maybe<T> second)
Creates an iterator transformed passed elements such as the become
null when the source element is Nothing, the wrapped value otherwise.
|
static <T> Iterator<T> |
drops(Maybe<T> first,
Maybe<T> second,
Maybe<T> third)
Creates an iterator transformed passed elements such as the become
null when the source element is Nothing, the wrapped value otherwise.
|
static <T> Maybe<T> |
join(Maybe<Maybe<T>> maybe)
Conventional monad join operator.
|
static <T> Iterator<T> |
justs(Iterable<Maybe<T>> maybes)
Filters nothings out of an Iterable of Maybe T, returning an Iterator
of T.
|
static <T> Iterator<T> |
justs(Iterator<Maybe<T>> maybes)
Filters nothings out of an Iterator of Maybe T, returning an Iterator
of T.
|
static <T> Iterator<T> |
justs(Maybe<T> first,
Maybe<T> second)
Filters nothings out of an array of Maybe T, returning an Iterator of
T.
|
static <T> Iterator<T> |
justs(Maybe<T> first,
Maybe<T> second,
Maybe<T> third)
Filters nothings out of an array of Maybe T, returning an Iterator of
T.
|
static <R,T> Delegate<Maybe<R>,Maybe<T>> |
lift(Delegate<R,T> delegate)
Transforms a delegate to another working on maybe monadic values.
|
static <T> Maybe<T> |
lift(T value)
Transforms a null value to Maybe.nothing, a non-null value to
Maybe.just(value)
|
static <T> Iterator<Maybe<T>> |
lifts(Iterable<T> iterable)
Creates an iterator transforming elements from the source iterable to
Maybe.nothing when the source element is null, to
Maybe.just(sourceValue) otherwise.
|
static <T> Iterator<Maybe<T>> |
lifts(Iterator<T> iterator)
Creates an iterator transforming elements from the source iterator to
Maybe.nothing when the source element is null, to
Maybe.just(sourceValue) otherwise.
|
static <T> Iterator<Maybe<T>> |
lifts(T first,
T second)
Creates an iterator transforming passed values to Maybe.nothing when
the source element is null, to Maybe.just(sourceValue) otherwise.
|
static <T> Iterator<Maybe<T>> |
lifts(T first,
T second,
T third)
Creates an iterator transforming passed values to Maybe.nothing when
the source element is null, to Maybe.just(sourceValue) otherwise.
|
static <T> Maybe<T> |
pure(T value)
Yields Maybe.pure() of a value.
|
static <T> Iterator<Maybe<T>> |
pures(Iterable<T> values)
Creates an iterator transforming values from the source iterable into
pure() Maybe
|
static <T> Iterator<Maybe<T>> |
pures(Iterator<T> values)
Creates an iterator transforming values from the source iterator into
pure() Maybe
|
static <T> Iterator<Maybe<T>> |
pures(T... values)
Creates an iterator yielding values pure() Maybe
|
static <T> Iterator<Maybe<T>> |
pures(T value)
Creates a singleton iterator yielding pure() Maybe
|
static <T> Iterator<Maybe<T>> |
pures(T first,
T second)
Creates an iterator yielding pure() Maybe
|
static <T> Iterator<Maybe<T>> |
pures(T first,
T second,
T third)
Creates an iterator yielding pure() Maybe
|
public static <T> Maybe<T> pure(T value)
Maybes.pure(1) -> Maybe.just(1)T - the value typevalue - the value to be transformedpublic static <T> Iterator<Maybe<T>> pures(Iterator<T> values)
Maybes.pures([1,2,3]) -> [Just 1, Just 2, Just 3]T - the iterator element typevalues - the source iteratorpublic static <T> Iterator<Maybe<T>> pures(Iterable<T> values)
Maybes.pures([1,2,3]) -> [Just 1, Just 2, Just 3]T - the iterable element typevalues - the source iterablepublic static <T> Iterator<Maybe<T>> pures(T value)
Maybes.pures(1) -> [Just 1]T - the element typevalue - the source valuepublic static <T> Iterator<Maybe<T>> pures(T first, T second)
Maybes.pures(1, 2) -> [Just 1, Just 2]T - the elements typefirst - the first elementsecond - the second elementpublic static <T> Iterator<Maybe<T>> pures(T first, T second, T third)
Maybes.pures(1, 2, 3) -> [Just 1, Just 2, Just 3]T - the elements typefirst - the first elementsecond - the second elementthird - the third elementpublic static <T> Iterator<Maybe<T>> pures(T... values)
Maybes.pures(1, 2, 3, 4) -> [Just 1, Just 2, Just 3, Just 4]T - the array element typevalues - the source arraypublic static <T> Iterator<T> justs(Iterator<Maybe<T>> maybes)
Maybes.justs([Just 1, Nothing, Just null]) -> [1, null]T - the Maybe type parametermaybes - an iterator of Maybepublic static <T> Iterator<T> justs(Iterable<Maybe<T>> maybes)
Maybes.justs([Just 1, Nothing, Just null]) -> [1, null]T - the Maybe type parametermaybes - an iterable of Maybepublic static <T> Iterator<T> justs(Maybe<T> first, Maybe<T> second)
Maybes.justs([Nothing, Just null]) -> [null]T - the Maybe type parameterfirst - the first elementsecond - the second elementpublic static <T> Iterator<T> justs(Maybe<T> first, Maybe<T> second, Maybe<T> third)
Maybes.justs([Just 1, Nothing, Just null]) -> [1, null]T - the Maybe type parameterfirst - the first elementsecond - the second elementthird - the third elementpublic static <T> Maybe<T> lift(T value)
T - the value type parametervalue - the value to be liftedpublic static <R,T> Delegate<Maybe<R>,Maybe<T>> lift(Delegate<R,T> delegate)
R - the delegate return typeT - the delegate parameter typedelegate - the delegate to be liftedpublic static <T> Iterator<Maybe<T>> lifts(Iterator<T> iterator)
Maybes.lift([null, 1, 2]) -> [Nothing, Just 1, Just 2]T - the value type parameteriterator - the iterator to be liftedpublic static <T> Iterator<Maybe<T>> lifts(Iterable<T> iterable)
Maybes.lift([null, 1, 2]) -> [Nothing, Just 1, Just 2]T - the value type parameteriterable - the iterable to be liftedpublic static <T> Iterator<Maybe<T>> lifts(T first, T second)
Maybes.lift(null, 1) -> [Nothing, Just 1]T - the value typefirst - the first elementsecond - the second elementpublic static <T> Iterator<Maybe<T>> lifts(T first, T second, T third)
Maybes.lift(null, 1, 3) -> [Nothing, Just 1, Just 3]T - the value typefirst - the first elementsecond - the second elementthird - the third elementpublic static <T> T drop(Maybe<T> maybe)
Maybes.drop(Just 1) -> 1
Maybes.drop(Nothing) -> nullT - the value type parametermaybe - the maybe to be droppedpublic static <T> Iterator<T> drops(Iterator<Maybe<T>> iterator)
Maybes.drops([Just null, Nothing, Just 3]) -> [null, null, 3]T - the value type parameteriterator - the iterator to be droppedpublic static <T> Iterator<T> drops(Iterable<Maybe<T>> iterable)
Maybes.drops([Just null, Nothing, Just 3]) -> [null, null, 3]T - the value type parameteriterable - the Iterable to be droppedpublic static <T> Iterator<T> drops(Maybe<T> first, Maybe<T> second)
Maybes.drops([Just null, Just 3]) -> [null, 3]T - the value type parameterfirst - the first maybesecond - the second maybepublic static <T> Iterator<T> drops(Maybe<T> first, Maybe<T> second, Maybe<T> third)
Maybes.drops([Just null, Just 3]) -> [null, 3]T - the value type parameterfirst - the first maybesecond - the second maybethird - the third maybepublic static <T> Maybe<T> join(Maybe<Maybe<T>> maybe)
T - the value type parametermaybe - the source monadCopyright © 2012. All Rights Reserved.