public static class Either.CompletableEither<ORG,RT> extends java.lang.Object implements Either<java.lang.Throwable,RT>, Completable<ORG>
Either.CompletableEither<ORG,RT>, Either.Lazy<ST,PT>, Either.Left<ST,PT>, Either.Right<ST,PT>Xor.Instances, Xor.Primary<ST,PT>, Xor.Secondary<ST,PT>Value.ValueImpl<T>Convertable.SupplierToConvertable<T>Fn0.FunctionalOperations<R>, Fn0.SupplierKind<R>Completable.CompletablePublisher<T>| Modifier and Type | Field and Description |
|---|---|
Completable.CompletablePublisher<ORG> |
complete |
Either<java.lang.Throwable,RT> |
either |
| Constructor and Description |
|---|
CompletableEither() |
| Modifier and Type | Method and Description |
|---|---|
<T2,R> Either<java.lang.Throwable,R> |
combine(Value<? extends T2> app,
java.util.function.BiFunction<? super RT,? super T2,? extends R> fn)
Lazily combine this ApplicativeFunctor with the supplied value via the supplied BiFunction
Example
|
boolean |
complete(ORG done) |
boolean |
completeExceptionally(java.lang.Throwable error) |
boolean |
equals(java.lang.Object obj) |
Either<java.lang.Throwable,RT> |
filter(java.util.function.Predicate<? super RT> test)
Keep only elements for which the supplied predicates hold
e.g.
|
<RT1> Either<java.lang.Throwable,RT1> |
flatMap(java.util.function.Function<? super RT,? extends MonadicValue<? extends RT1>> mapper)
A flattening transformation operation (@see
Optional.flatMap(Function) |
RT |
get() |
int |
hashCode() |
boolean |
isDone() |
boolean |
isFailed() |
boolean |
isLeft() |
boolean |
isRight() |
<R> Either<java.lang.Throwable,R> |
map(java.util.function.Function<? super RT,? extends R> fn)
Transform this functor using the supplied transformation function
|
Either<java.lang.Throwable,RT> |
peek(java.util.function.Consumer<? super RT> action)
Peek at the current value of this Transformable, without transforming it
|
void |
peek(java.util.function.Consumer<? super java.lang.Throwable> stAction,
java.util.function.Consumer<? super RT> ptAction) |
<LT1> Either<LT1,RT> |
secondaryFlatMap(java.util.function.Function<? super java.lang.Throwable,? extends Xor<LT1,RT>> mapper)
Perform a flatMap operation on the Left type
|
java.lang.Throwable |
secondaryGet() |
<R> Either<R,RT> |
secondaryMap(java.util.function.Function<? super java.lang.Throwable,? extends R> fn)
Always map the Left type of this Either if it is present using the provided transformation function
|
Either<java.lang.Throwable,RT> |
secondaryPeek(java.util.function.Consumer<? super java.lang.Throwable> action)
Peek at the Left type value if present
|
java.util.Optional<java.lang.Throwable> |
secondaryToOptional() |
Either<java.lang.Throwable,RT> |
secondaryToPrimayFlatMap(java.util.function.Function<? super java.lang.Throwable,? extends Xor<java.lang.Throwable,RT>> fn)
A flatMap operation that keeps the Left and Right types the same
|
Either<java.lang.Throwable,RT> |
secondaryToPrimayMap(java.util.function.Function<? super java.lang.Throwable,? extends RT> fn)
If this Either contains the Left type, map it's value so that it contains the Right type
|
ReactiveSeq<java.lang.Throwable> |
secondaryToStream() |
Value<java.lang.Throwable> |
secondaryValue() |
Either<RT,java.lang.Throwable> |
swap()
Swap types so operations directly affect the current (pre-swap) Left type
|
Ior<java.lang.Throwable,RT> |
toIor()
Return an Ior that can be this object or a Ior.primary or Ior.secondary
|
<R> R |
visit(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.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaccumulate, anyMEither, applyAny, async, bicast, bimap, bipeek, bitrampoline, cast, coflatMap, combine, combine, combineEager, combineToList, combineToList, consumeAny, either, filterNot, flatMapI, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromFuture, fromIterable, fromLazy, fromMonadicValue, fromPublisher, fromXor, isPresent, isPrimary, isSecondary, left, leftEval, list, mapBoth, narrow, nest, notNull, ofType, retry, retry, right, rightEval, sequenceLeft, sequenceRight, toEitherTrampoline, toOptional, toTrampoline, toTrampoline, toTrampoline, toXor, toXor, trampoline, traverseLeft, traverseRight, unit, visitAny, visitAny, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithP, zipWithSaccumulatePrimary, accumulatePrimary, accumulatePrimary, accumulateSecondary, accumulateSecondary, accumulateSecondary, allTypeclasses, anyM, applyAny, arity, consumeAny, coproduct, kindCokleisli, kindKleisli, liftM, mapM, narrowK, narrowK2, nested, nestedEval, primary, product, secondary, sequencePrimary, sequenceSecondary, visitAny, visitAny, widenapply, generate, iterate, iterator, mkString, newSubscriber, of, stream, subscribe, test, toEither, toEval, toEvalAlways, toEvalLater, toEvalNow, toLeft, toMaybe, toMaybeEager, toRight, toTry, toTry, toTryendsWith, endsWithIterable, findAny, findFirst, firstValue, foldLeft, foldLeft, foldLeft, foldLeft, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, join, join, join, mapReduce, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleUnsafe, startsWith, startsWithIterable, takeOne, xMatchcollect, fromSupplier, orElse, orElseGet, orElseThrow, toCompletableFuture, toCompletableFutureAsync, toFuture, toFutureAsync, toStream, visitpublic final Completable.CompletablePublisher<ORG> complete
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 Either<java.lang.Throwable,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 MonadicValue<RT>filter in interface Either<java.lang.Throwable,RT>filter in interface Xor<java.lang.Throwable,RT>test - to filter elements by, retaining matchespublic <R> Either<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]
public Either<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 Xor<java.lang.Throwable,RT>action - Consumer that recieves each element from this Transformablepublic Either<RT,java.lang.Throwable> swap()
Either
Either.left("hello")
.map(v->v+" world")
//Either.seconary["hello"]
Either.left("hello")
.swap()
.map(v->v+" world")
.swap()
//Either.seconary["hello world"]
public Ior<java.lang.Throwable,RT> toIor()
Valuepublic RT get()
public Value<java.lang.Throwable> secondaryValue()
secondaryValue in interface Either<java.lang.Throwable,RT>secondaryValue in interface Xor<java.lang.Throwable,RT>public java.lang.Throwable secondaryGet()
secondaryGet in interface Either<java.lang.Throwable,RT>secondaryGet in interface Xor<java.lang.Throwable,RT>public java.util.Optional<java.lang.Throwable> secondaryToOptional()
secondaryToOptional in interface Either<java.lang.Throwable,RT>secondaryToOptional in interface Xor<java.lang.Throwable,RT>public ReactiveSeq<java.lang.Throwable> secondaryToStream()
secondaryToStream in interface Either<java.lang.Throwable,RT>secondaryToStream in interface Xor<java.lang.Throwable,RT>public <RT1> Either<java.lang.Throwable,RT1> flatMap(java.util.function.Function<? super RT,? extends MonadicValue<? extends RT1>> mapper)
MonadicValueOptional.flatMap(Function)
Eval.now(1).map(i->i+2).flatMap(i->Eval.later(()->i*3);
//Eval[9]
public boolean isRight()
public boolean isLeft()
public <T2,R> Either<java.lang.Throwable,R> combine(Value<? extends T2> app, java.util.function.BiFunction<? super RT,? super T2,? extends R> fn)
MonadicValue
Maybe<Integer> some = Maybe.just(10);
just.combine(Eval.now(20), this::add);
//Some[30]
Maybe<Integer> none = Maybe.none();
none.combine(Eval.now(20), this::add);
//None
combine in interface MonadicValue<RT>combine in interface Either<java.lang.Throwable,RT>combine in interface Xor<java.lang.Throwable,RT>app - Value to combine with this one.fn - BiFunction to combine thempublic void peek(java.util.function.Consumer<? super java.lang.Throwable> stAction,
java.util.function.Consumer<? super RT> ptAction)
public Either<java.lang.Throwable,RT> secondaryToPrimayFlatMap(java.util.function.Function<? super java.lang.Throwable,? extends Xor<java.lang.Throwable,RT>> fn)
EithersecondaryToPrimayFlatMap in interface Either<java.lang.Throwable,RT>secondaryToPrimayFlatMap in interface Xor<java.lang.Throwable,RT>fn - Transformation functionpublic <LT1> Either<LT1,RT> secondaryFlatMap(java.util.function.Function<? super java.lang.Throwable,? extends Xor<LT1,RT>> mapper)
EithersecondaryFlatMap in interface Either<java.lang.Throwable,RT>secondaryFlatMap in interface Xor<java.lang.Throwable,RT>mapper - Flattening transformation functionpublic <R> R visit(java.util.function.Function<? super java.lang.Throwable,? extends R> secondary,
java.util.function.Function<? super RT,? extends R> primary)
Either
Either.right(10)
.visit(secondary->"no", primary->"yes")
//Either["yes"]
Either.left(90)
.visit(secondary->"no", primary->"yes")
//Either["no"]
visit in interface Either<java.lang.Throwable,RT>visit in interface Xor<java.lang.Throwable,RT>secondary - Function to execute if this is a Left Eitherprimary - Function to execute if this is a Right Iorpublic Either<java.lang.Throwable,RT> secondaryPeek(java.util.function.Consumer<? super java.lang.Throwable> action)
EithersecondaryPeek in interface Either<java.lang.Throwable,RT>secondaryPeek in interface Xor<java.lang.Throwable,RT>action - Consumer to peek at the Left type valuepublic <R> Either<R,RT> secondaryMap(java.util.function.Function<? super java.lang.Throwable,? extends R> fn)
EithersecondaryMap in interface Either<java.lang.Throwable,RT>secondaryMap in interface Xor<java.lang.Throwable,RT>fn - Transformation function for Left typespublic Either<java.lang.Throwable,RT> secondaryToPrimayMap(java.util.function.Function<? super java.lang.Throwable,? extends RT> fn)
EithersecondaryToPrimayMap in interface Either<java.lang.Throwable,RT>secondaryToPrimayMap in interface Xor<java.lang.Throwable,RT>fn - Function to map secondary type to primarypublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object