public class Either<L,R> extends Object
Modifier | Constructor and Description |
---|---|
protected |
Either(Optional<L> left,
Optional<R> right) |
Modifier and Type | Method and Description |
---|---|
<X> X |
cata(Function<L,X> left,
Function<R,X> right) |
protected Optional<L> |
getLeft() |
R |
getOrElse(R default_value) |
<E extends Exception> |
getOrElseThrow(Function<L,E> exceptionFn) |
protected Optional<R> |
getRight() |
boolean |
isLeft() |
boolean |
isRight() |
static <L,R> Either<L,R> |
ofLeft(L value) |
static <L,R> Either<L,R> |
ofRight(R value) |
public static <L,R> Either<L,R> ofLeft(L value)
public static <L,R> Either<L,R> ofRight(R value)
public boolean isLeft()
public boolean isRight()
public <E extends Exception> R getOrElseThrow(Function<L,E> exceptionFn) throws E extends Exception
E extends Exception
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.