public abstract class Either<A,B> extends Object
Either is much simpler than implementations you may know from other languages or
libraries.| Modifier and Type | Class and Description |
|---|---|
class |
Either.LeftProjection<A,B>
Left projection of either.
|
static interface |
Either.Match<A,B,X> |
class |
Either.RightProjection<A,B>
Right projection of either.
|
| Modifier and Type | Method and Description |
|---|---|
abstract <X> X |
fold(Either.Match<A,B,X> visitor) |
abstract <X> X |
fold(Function<? super A,? extends X> left,
Function<? super B,? extends X> right) |
abstract boolean |
isLeft() |
abstract boolean |
isRight() |
abstract Either.LeftProjection<A,B> |
left() |
static <A,B> Either<A,B> |
left(A left)
Create a left.
|
abstract Either.RightProjection<A,B> |
right() |
static <A,B> Either<A,B> |
right(B right)
Create a right.
|
public abstract Either.LeftProjection<A,B> left()
public abstract Either.RightProjection<A,B> right()
public abstract <X> X fold(Either.Match<A,B,X> visitor)
public abstract <X> X fold(Function<? super A,? extends X> left, Function<? super B,? extends X> right)
public abstract boolean isLeft()
public abstract boolean isRight()
public static <A,B> Either<A,B> left(A left)
public static <A,B> Either<A,B> right(B right)
Copyright © 2009–2021 Opencast Project. All rights reserved.