public class Either<L,R>
extends Object
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Either
protected Either(@Nullable
L left,
@Nullable
R right)
-
Method Details
-
forLeft
public static <L,
R> Either<L,R> forLeft(L left)
-
forRight
public static <L,
R> Either<L,R> forRight(R right)
-
getLeft
@CheckForNull
public L getLeft()
-
getRight
@CheckForNull
public R getRight()
-
isLeft
public boolean isLeft()
-
isRight
public boolean isRight()
-
map
public <T> T map(Function<? super L,? extends T> mapLeft,
Function<? super R,? extends T> mapRight)