public static interface Either.Projection<A,B,L,R> extends Maybe<A>
| Modifier and Type | Method and Description |
|---|---|
Either<L,R> |
either()
The either value underlying this projection.
|
A |
on(Function<? super B,? extends A> f)
The value of this projection or the result of the given function on the
opposing projection's value.
|
Option<? super A> |
toOption()
Returns this projection's value in
Some if it exists,
otherwise None. |
Optional<? super A> |
toOptional()
Returns this projection's value in
Optional.of(T) if it exists,
otherwise Optional.empty(). |
Stream<? super A> |
toStream()
Returns this projection's value in
Stream.of(T) if it exists,
otherwise Stream.empty(). |
exists, forall, get, getOr, getOrElse, getOrElse, getOrError, getOrNull, getOrThrow, isDefined, isEmpty, iteratorforEach, spliteratorforeachEither<L,R> either()
Option<? super A> toOption()
Some if it exists,
otherwise None.Some if it exists,
otherwise None.Optional<? super A> toOptional()
Optional.of(T) if it exists,
otherwise Optional.empty().of if it exists,
otherwise empty.Stream<? super A> toStream()
Stream.of(T) if it exists,
otherwise Stream.empty().of if it exists,
otherwise empty.A on(Function<? super B,? extends A> f)
f - The function to execute if this projection has no value.Copyright © 2017 Atlassian. All rights reserved.