Interface Either.Projection<A,B,L,R>
- All Superinterfaces:
Effect.Applicant<A>, Iterable<A>, Maybe<A>
- All Known Implementing Classes:
Either.AbstractProjection, Either.LeftProjection, Either.RightProjection
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptioneither()The either value underlying this projection.The value of this projection or the result of the given function on the opposing projection's value.toOption()Returns this projection's value inSomeif it exists, otherwiseNone.Returns this projection's value inOptional.of(T)if it exists, otherwiseOptional.empty().toStream()Returns this projection's value inStream.of(T)if it exists, otherwiseStream.empty().Methods inherited from interface Effect.Applicant
foreachMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
either
-
toOption
-
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
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
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.
-