Package org.opencastproject.util.data
Class Either<A,B>
java.lang.Object
org.opencastproject.util.data.Either<A,B>
An algebraic data type representing a disjoint union. By convention left is considered to represent an error while
right represents a value.
This implementation of
Either is much simpler than implementations you may know from other languages or
libraries.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassLeft projection of either.static interfaceEither.Match<A,B, X> classRight projection of either. -
Method Summary
-
Method Details
-
left
-
right
-
fold
-
fold
-
isLeft
public abstract boolean isLeft() -
isRight
public abstract boolean isRight() -
left
Create a left. -
right
Create a right.
-