Package io.atlassian.fugue
Interface Either.Projection<A,B,L,R>
-
- All Superinterfaces:
Effect.Applicant<A>,java.lang.Iterable<A>,Maybe<A>
- All Known Implementing Classes:
Either.AbstractProjection,Either.LeftProjection,Either.RightProjection
public static interface Either.Projection<A,B,L,R> extends Maybe<A>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Either<L,R>either()The either value underlying this projection.Aon(java.util.function.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 inSomeif it exists, otherwiseNone.java.util.Optional<? super A>toOptional()Returns this projection's value inOptional.of(T)if it exists, otherwiseOptional.empty().java.util.stream.Stream<? super A>toStream()Returns this projection's value inStream.of(T)if it exists, otherwiseStream.empty().-
Methods inherited from interface io.atlassian.fugue.Effect.Applicant
foreach
-
-
-
-
Method Detail
-
either
Either<L,R> either()
The either value underlying this projection.- Returns:
- The either value underlying this projection.
-
toOption
Option<? super A> toOption()
Returns this projection's value inSomeif it exists, otherwiseNone.- Returns:
- This projection's value in
Someif it exists, otherwiseNone.
-
toOptional
java.util.Optional<? super A> toOptional()
Returns this projection's value inOptional.of(T)if it exists, otherwiseOptional.empty().- Returns:
- This projection's value in
ofif it exists, otherwiseempty. - Since:
- 4.0
-
toStream
java.util.stream.Stream<? super A> toStream()
Returns this projection's value inStream.of(T)if it exists, otherwiseStream.empty().- Returns:
- This projection's value in
ofif it exists, otherwiseempty. - Since:
- 4.5.0
-
on
A on(java.util.function.Function<? super B,? extends A> f)
The value of this projection or the result of the given function on the opposing projection's value.- Parameters:
f- The function to execute if this projection has no value.- Returns:
- The value of this projection or the result of the given function on the opposing projection's value.
-
-