public static class LazyEither.CompletableEither<ORG,RT> extends java.lang.Object implements LazyEither<java.lang.Throwable,RT>, Completable<ORG>
LazyEither.CompletableEither<ORG,RT>, LazyEither.Lazy<ST,PT>, LazyEither.Left<ST,PT>, LazyEither.Right<ST,PT>
Completable.CompletablePublisher<T>
Modifier and Type | Field and Description |
---|---|
Completable.CompletablePublisher<ORG> |
complete |
LazyEither<java.lang.Throwable,RT> |
either |
Constructor and Description |
---|
CompletableEither() |
Modifier and Type | Method and Description |
---|---|
boolean |
complete(ORG done) |
boolean |
completeExceptionally(java.lang.Throwable error) |
boolean |
equals(java.lang.Object obj) |
Maybe<RT> |
filter(java.util.function.Predicate<? super RT> test)
Keep only elements for which the supplied predicates hold
e.g.
|
<RT1> LazyEither<java.lang.Throwable,RT1> |
flatMap(java.util.function.Function<? super RT,? extends Either<? extends java.lang.Throwable,? extends RT1>> mapper) |
<LT1> LazyEither<LT1,RT> |
flatMapLeft(java.util.function.Function<? super java.lang.Throwable,? extends Either<LT1,RT>> mapper)
Perform a flatMap operation on the Left type
|
LazyEither<java.lang.Throwable,RT> |
flatMapLeftToRight(java.util.function.Function<? super java.lang.Throwable,? extends Either<java.lang.Throwable,RT>> fn)
A flatMap operation that keeps the Left and Right types the same
|
<R> R |
fold(java.util.function.Function<? super RT,? extends R> present,
java.util.function.Supplier<? extends R> absent) |
<R> R |
fold(java.util.function.Function<? super java.lang.Throwable,? extends R> secondary,
java.util.function.Function<? super RT,? extends R> primary)
Visitor pattern for this Ior.
|
Option<RT> |
get() |
Option<java.lang.Throwable> |
getLeft() |
int |
hashCode() |
boolean |
isDone() |
boolean |
isFailed() |
boolean |
isLeft() |
boolean |
isRight() |
java.lang.Throwable |
leftOrElse(java.lang.Throwable alt) |
ReactiveSeq<java.lang.Throwable> |
leftToStream() |
<R> LazyEither<java.lang.Throwable,R> |
map(java.util.function.Function<? super RT,? extends R> fn)
Transform this functor using the supplied transformation function
|
<R> LazyEither<R,RT> |
mapLeft(java.util.function.Function<? super java.lang.Throwable,? extends R> fn)
Always transform the Left type of this Either if it is present using the provided transformation function
|
LazyEither<java.lang.Throwable,RT> |
mapLeftToRight(java.util.function.Function<? super java.lang.Throwable,? extends RT> fn)
If this Either contains the Left type, transform it's value so that it contains the Right type
|
LazyEither<java.lang.Throwable,RT> |
peek(java.util.function.Consumer<? super RT> action)
Peek at the current value of this Transformable, without transforming it
|
LazyEither<java.lang.Throwable,RT> |
peekLeft(java.util.function.Consumer<? super java.lang.Throwable> action)
Peek at the Left type value if present
|
Either<java.lang.Throwable,RT> |
recover(RT value) |
Either<java.lang.Throwable,RT> |
recover(java.util.function.Supplier<? extends RT> value) |
Either<java.lang.Throwable,RT> |
recoverWith(java.util.function.Supplier<? extends Either<java.lang.Throwable,RT>> fn) |
LazyEither<RT,java.lang.Throwable> |
swap()
Swap types so operations directly affect the current (pre-swap) Left type
|
Ior<java.lang.Throwable,RT> |
toIor() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
accumulate, applyAny, arity, async, bimap, bipeek, combine, combine, combineToLazySeq, combineToList, consumeAny, either, filter, forEach2, forEach3, forEach4, fromEither, fromFuture, fromIterable, fromLazy, fromPublisher, isPresent, lazySeq, left, leftEval, narrow, narrowK, narrowK2, nest, right, rightEval, sequence, sequenceLeft, sequenceRight, tailRec, toEither, toEither, toEitherTrampoline, toTrampoline, toTrampoline, toTrampoline, traverse, traverseLeft, traverseRight, unit, visitAny, visitAny, zip, zip
accumulateLeft, accumulateLeft, accumulateLeft, accumulateRight, accumulateRight, accumulateRight, applyAny, combineToVector, consumeAny, filterNot, fromIterable, nestedEval, notNull, ofType, sequence, sequenceLeft, sequenceRight, tailRec, traverse, visitAny, visitAny, widen
orElseUse, orElseUse
asSupplier, collect, fold, forEach, generate, iterate, iterator, mkString, newSubscriber, nonEmptyList, nonEmptyListGet, orElse, orElseGet, print, print, printErr, printOut, stream, subscribe, toLazyEither, toLeft, toMaybe, toOption, toOptional, toRight, toTry, toTry, toTry, transform
public final Completable.CompletablePublisher<ORG> complete
public final LazyEither<java.lang.Throwable,RT> either
public Either<java.lang.Throwable,RT> recover(java.util.function.Supplier<? extends RT> value)
public Either<java.lang.Throwable,RT> recoverWith(java.util.function.Supplier<? extends Either<java.lang.Throwable,RT>> fn)
recoverWith
in interface Either<java.lang.Throwable,RT>
public boolean isFailed()
isFailed
in interface Completable<ORG>
public boolean isDone()
isDone
in interface Completable<ORG>
public boolean complete(ORG done)
complete
in interface Completable<ORG>
public boolean completeExceptionally(java.lang.Throwable error)
completeExceptionally
in interface Completable<ORG>
public Maybe<RT> filter(java.util.function.Predicate<? super RT> test)
Filters
of(1,2,3).filter(i->i>2);
//[3]
filter
in interface Filters<RT>
filter
in interface Either<java.lang.Throwable,RT>
filter
in interface LazyEither<java.lang.Throwable,RT>
test
- to filter elements by, retaining matchespublic <R> LazyEither<java.lang.Throwable,R> map(java.util.function.Function<? super RT,? extends R> fn)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface Transformable<RT>
map
in interface Either<java.lang.Throwable,RT>
map
in interface LazyEither<java.lang.Throwable,RT>
fn
- Transformation functionpublic LazyEither<java.lang.Throwable,RT> peek(java.util.function.Consumer<? super RT> action)
Transformable
of(1,2,3).map(System.out::println)
1
2
3
peek
in interface Transformable<RT>
peek
in interface Either<java.lang.Throwable,RT>
peek
in interface LazyEither<java.lang.Throwable,RT>
action
- Consumer that recieves each element from this Transformablepublic LazyEither<RT,java.lang.Throwable> swap()
LazyEither
Either.left("hello")
.map(v->v+" world")
//Either.seconary["hello"]
Either.left("hello")
.swap()
.map(v->v+" world")
.swap()
//Either.seconary["hello world"]
public Option<java.lang.Throwable> getLeft()
public java.lang.Throwable leftOrElse(java.lang.Throwable alt)
leftOrElse
in interface Either<java.lang.Throwable,RT>
public ReactiveSeq<java.lang.Throwable> leftToStream()
leftToStream
in interface Either<java.lang.Throwable,RT>
leftToStream
in interface LazyEither<java.lang.Throwable,RT>
public <RT1> LazyEither<java.lang.Throwable,RT1> flatMap(java.util.function.Function<? super RT,? extends Either<? extends java.lang.Throwable,? extends RT1>> mapper)
public boolean isRight()
public boolean isLeft()
public LazyEither<java.lang.Throwable,RT> flatMapLeftToRight(java.util.function.Function<? super java.lang.Throwable,? extends Either<java.lang.Throwable,RT>> fn)
LazyEither
flatMapLeftToRight
in interface Either<java.lang.Throwable,RT>
flatMapLeftToRight
in interface LazyEither<java.lang.Throwable,RT>
fn
- Transformation functionpublic <LT1> LazyEither<LT1,RT> flatMapLeft(java.util.function.Function<? super java.lang.Throwable,? extends Either<LT1,RT>> mapper)
LazyEither
flatMapLeft
in interface Either<java.lang.Throwable,RT>
flatMapLeft
in interface LazyEither<java.lang.Throwable,RT>
mapper
- Flattening transformation functionpublic <R> R fold(java.util.function.Function<? super java.lang.Throwable,? extends R> secondary, java.util.function.Function<? super RT,? extends R> primary)
LazyEither
Either.right(10)
.visit(left->"no", right->"yes")
//Either["yes"]
Either.left(90)
.visit(left->"no", right->"yes")
//Either["no"]
fold
in interface Sealed2<java.lang.Throwable,RT>
fold
in interface Either<java.lang.Throwable,RT>
fold
in interface LazyEither<java.lang.Throwable,RT>
secondary
- Function to execute if this is a Left Eitherprimary
- Function to execute if this is a Right Iorpublic LazyEither<java.lang.Throwable,RT> peekLeft(java.util.function.Consumer<? super java.lang.Throwable> action)
LazyEither
public <R> LazyEither<R,RT> mapLeft(java.util.function.Function<? super java.lang.Throwable,? extends R> fn)
LazyEither
public LazyEither<java.lang.Throwable,RT> mapLeftToRight(java.util.function.Function<? super java.lang.Throwable,? extends RT> fn)
LazyEither
mapLeftToRight
in interface Either<java.lang.Throwable,RT>
mapLeftToRight
in interface LazyEither<java.lang.Throwable,RT>
fn
- Function to transform left type to rightpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object