Package org.reactfx.util
Class Left<L,R>
- java.lang.Object
-
- org.reactfx.util.Left<L,R>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<L>
asLeft()
java.util.Optional<R>
asRight()
boolean
equals(java.lang.Object other)
void
exec(java.util.function.Consumer<? super L> ifLeft, java.util.function.Consumer<? super R> ifRight)
<L2,R2>
Either<L2,R2>flatMap(java.util.function.Function<? super L,Either<L2,R2>> f, java.util.function.Function<? super R,Either<L2,R2>> g)
<L2> Either<L2,R>
flatMapLeft(java.util.function.Function<? super L,Either<L2,R>> f)
<R2> Either<L,R2>
flatMapRight(java.util.function.Function<? super R,Either<L,R2>> f)
L
getLeft()
R
getRight()
int
hashCode()
void
ifLeft(java.util.function.Consumer<? super L> f)
void
ifRight(java.util.function.Consumer<? super R> f)
boolean
isLeft()
boolean
isRight()
<L2,R2>
Either<L2,R2>map(java.util.function.Function<? super L,? extends L2> f, java.util.function.Function<? super R,? extends R2> g)
<L2> Either<L2,R>
mapLeft(java.util.function.Function<? super L,? extends L2> f)
<R2> Either<L,R2>
mapRight(java.util.function.Function<? super R,? extends R2> f)
L
toLeft(java.util.function.Function<? super R,? extends L> f)
R
toRight(java.util.function.Function<? super L,? extends R> f)
java.lang.String
toString()
<T> T
unify(java.util.function.Function<? super L,? extends T> f, java.util.function.Function<? super R,? extends T> g)
-
-
-
Field Detail
-
value
private final L value
-
-
Constructor Detail
-
Left
public Left(L value)
-
-
Method Detail
-
ifLeft
public void ifLeft(java.util.function.Consumer<? super L> f)
-
ifRight
public void ifRight(java.util.function.Consumer<? super R> f)
-
exec
public void exec(java.util.function.Consumer<? super L> ifLeft, java.util.function.Consumer<? super R> ifRight)
-
mapRight
public <R2> Either<L,R2> mapRight(java.util.function.Function<? super R,? extends R2> f)
-
map
public <L2,R2> Either<L2,R2> map(java.util.function.Function<? super L,? extends L2> f, java.util.function.Function<? super R,? extends R2> g)
-
flatMap
public <L2,R2> Either<L2,R2> flatMap(java.util.function.Function<? super L,Either<L2,R2>> f, java.util.function.Function<? super R,Either<L2,R2>> g)
-
flatMapLeft
public <L2> Either<L2,R> flatMapLeft(java.util.function.Function<? super L,Either<L2,R>> f)
- Specified by:
flatMapLeft
in interfaceEither<L,R>
-
flatMapRight
public <R2> Either<L,R2> flatMapRight(java.util.function.Function<? super R,Either<L,R2>> f)
- Specified by:
flatMapRight
in interfaceEither<L,R>
-
unify
public <T> T unify(java.util.function.Function<? super L,? extends T> f, java.util.function.Function<? super R,? extends T> g)
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-