L
- the type of LeftR
- the type of Right@Public public abstract class Either<L,R> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Either.Left<L,R>
A left value of
Either |
static class |
Either.Right<L,R>
A right value of
Either |
Constructor and Description |
---|
Either() |
Modifier and Type | Method and Description |
---|---|
boolean |
isLeft() |
boolean |
isRight() |
abstract L |
left()
Retrieve the Left value of Either.
|
static <L,R> Either<L,R> |
Left(L value)
Create a Left value of Either
|
abstract R |
right()
Retrieve the Right value of Either.
|
static <L,R> Either<L,R> |
Right(R value)
Create a Right value of Either
|
public static <L,R> Either<L,R> Left(L value)
public static <L,R> Either<L,R> Right(R value)
public abstract L left() throws IllegalStateException
IllegalStateException
- if called on a Rightpublic abstract R right() throws IllegalStateException
IllegalStateException
- if called on a Leftpublic final boolean isLeft()
public final boolean isRight()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.