Top Methods
org.reactfx.util

public Interface Either<L, R>

Additional top-level classes in compilation unit: Left, Right.

Known Direct Subinterfaces
org.reactfx.util.Try
Known Direct Implementers
org.reactfx.util.Left, org.reactfx.util.Right
Imports
java.util.NoSuchElementException, .Objects, .Optional, java.util.function.Consumer, .Function

Method Summary

Modifier and TypeMethod and Description
public Optional<L>
public Optional<R>
public void
exec(Consumer<? super L> ifLeft, Consumer<? super R> ifRight)

public <L2, R2> Either<L2, R2>
flatMap(Function<? super L, Either<L2, R2>> f, Function<? super R, Either<L2, R2>> g)

public <L2> Either<L2, R>
flatMapLeft(Function<? super L, Either<L2, R>> f)

public <R2> Either<L, R2>
flatMapRight(Function<? super R, Either<L, R2>> f)

public L
public R
public void
ifLeft(Consumer<? super L> f)

public void
ifRight(Consumer<? super R> f)

public boolean
public boolean
public static <L, R> Either<L, R>
left(L l)

public static <L, R> Either<L, R>
public static <L, R> Either<L, R>
public <L2, R2> Either<L2, R2>
map(Function<? super L, ? extends L2> f, Function<? super R, ? extends R2> g)

public <L2> Either<L2, R>
mapLeft(Function<? super L, ? extends L2> f)

public <R2> Either<L, R2>
mapRight(Function<? super R, ? extends R2> f)

public static <L, R> Either<L, R>
right(R r)

public static <L, R> Either<L, R>
public static <L, R> Either<L, R>
public L
toLeft(Function<? super R, ? extends L> f)

public R
toRight(Function<? super L, ? extends R> f)

public <T> T
unify(Function<? super L, ? extends T> f, Function<? super R, ? extends T> g)

Method Detail

asLeftback to summary
public Optional<L> asLeft()
asRightback to summary
public Optional<R> asRight()
execback to summary
public void exec(Consumer<? super L> ifLeft, Consumer<? super R> ifRight)
flatMapback to summary
public <L2, R2> Either<L2, R2> flatMap(Function<? super L, Either<L2, R2>> f, Function<? super R, Either<L2, R2>> g)
flatMapLeftback to summary
public <L2> Either<L2, R> flatMapLeft(Function<? super L, Either<L2, R>> f)
flatMapRightback to summary
public <R2> Either<L, R2> flatMapRight(Function<? super R, Either<L, R2>> f)
getLeftback to summary
public L getLeft()
getRightback to summary
public R getRight()
ifLeftback to summary
public void ifLeft(Consumer<? super L> f)
ifRightback to summary
public void ifRight(Consumer<? super R> f)
isLeftback to summary
public boolean isLeft()
isRightback to summary
public boolean isRight()
leftback to summary
public static <L, R> Either<L, R> left(L l)
leftOrDefaultback to summary
public static <L, R> Either<L, R> leftOrDefault(Optional<L> l, R r)
leftOrNullback to summary
public static <L, R> Either<L, R> leftOrNull(Optional<L> l)
mapback to summary
public <L2, R2> Either<L2, R2> map(Function<? super L, ? extends L2> f, Function<? super R, ? extends R2> g)
mapLeftback to summary
public <L2> Either<L2, R> mapLeft(Function<? super L, ? extends L2> f)
mapRightback to summary
public <R2> Either<L, R2> mapRight(Function<? super R, ? extends R2> f)
rightback to summary
public static <L, R> Either<L, R> right(R r)
rightOrDefaultback to summary
public static <L, R> Either<L, R> rightOrDefault(Optional<R> r, L l)
rightOrNullback to summary
public static <L, R> Either<L, R> rightOrNull(Optional<R> r)
toLeftback to summary
public L toLeft(Function<? super R, ? extends L> f)
toRightback to summary
public R toRight(Function<? super L, ? extends R> f)
unifyback to summary
public <T> T unify(Function<? super L, ? extends T> f, Function<? super R, ? extends T> g)