Class Either<L,R>
- java.lang.Object
-
- io.streamthoughts.azkarra.api.monad.Either<L,R>
-
- Type Parameters:
L
- theEither.Left
type.R
- theEither.Right
type.
- Direct Known Subclasses:
Either.Left
,Either.Right
public abstract class Either<L,R> extends Object
SimpleEither
monad type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Either.Left<L,R>
static class
Either.LeftProjection<L,R>
static class
Either.Right<L,R>
static class
Either.RightProjection<L,R>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> T
fold(Function<L,T> fl, Function<R,T> fr)
abstract boolean
isLeft()
abstract boolean
isRight()
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()
-
-