public interface Either<L,R>
Either
are either an instance of Left
or Right
. Either
of the type Right
.
Either<Object, String> either = new Right<>("Right is not Left");
Modifier and Type | Method and Description |
---|---|
<T> T |
fold(java.util.function.Function<L,T> func_left,
java.util.function.Function<R,T> func_right)
|
default boolean |
isLeft()
|
boolean |
isRight()
|
default LeftProjection<L,R> |
left()
Returns a
LeftProjection for this instance. |
default RightProjection<L,R> |
right()
Returns a
RightProjection for this instance. |
Either<R,L> |
swap()
|
boolean isRight()
true
if this instance is Right
.default boolean isLeft()
true
if this instance is Left
.<T> T fold(java.util.function.Function<L,T> func_left, java.util.function.Function<R,T> func_right)
default RightProjection<L,R> right()
RightProjection
for this instance.default LeftProjection<L,R> left()
LeftProjection
for this instance.Copyright © 2015. All rights reserved.