Class Either<L,R>
- java.lang.Object
-
- io.streamthoughts.azkarra.api.monad.Either<L,R>
-
- Type Parameters:
L- theEither.Lefttype.R- theEither.Righttype.
- Direct Known Subclasses:
Either.Left,Either.Right
public abstract class Either<L,R> extends Object
SimpleEithermonad type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEither.Left<L,R>static classEither.LeftProjection<L,R>static classEither.Right<L,R>static classEither.RightProjection<L,R>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> Tfold(Function<L,T> fl, Function<R,T> fr)abstract booleanisLeft()abstract booleanisRight()Either.LeftProjection<L,R>left()static <L,R>
Either<L,R>left(L value)Either.RightProjection<L,R>right()static <L,R>
Either<L,R>right(R value)
-
-
-
Method Detail
-
left
public static <L,R> Either<L,R> left(L value)
-
right
public static <L,R> Either<L,R> right(R value)
-
isLeft
public abstract boolean isLeft()
-
isRight
public abstract boolean isRight()
-
left
public Either.LeftProjection<L,R> left()
-
right
public Either.RightProjection<L,R> right()
-
-