public static class Maybe.CompletableMaybe<ORG,T2> extends java.lang.Object implements Maybe<T2>, Completable<ORG>
Maybe.CompletableMaybe<ORG,T2>, Maybe.Instances, Maybe.Just<T>, Maybe.Lazy<T>, Maybe.Nothing<T>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 |
Maybe<T2> |
maybe |
| Constructor and Description |
|---|
CompletableMaybe() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
complete(ORG done) |
boolean |
completeAsNone() |
boolean |
completeExceptionally(java.lang.Throwable error) |
boolean |
equals(java.lang.Object obj) |
Maybe<T2> |
filter(java.util.function.Predicate<? super T2> fn)
Keep only elements for which the supplied predicates hold
e.g.
|
<R> Maybe<R> |
flatMap(java.util.function.Function<? super T2,? extends MonadicValue<? extends R>> mapper)
A flattening transformation operation (@see
Optional.flatMap(Function) |
T2 |
get() |
int |
hashCode() |
boolean |
isDone() |
boolean |
isFailed() |
boolean |
isPresent() |
<R> Maybe<R> |
map(java.util.function.Function<? super T2,? extends R> mapper)
Transform this functor using the supplied transformation function
|
Maybe<T2> |
recover(java.util.function.Supplier<? extends T2> value) |
Maybe<T2> |
recover(T2 value) |
Maybe<T2> |
recoverWith(java.util.function.Supplier<? extends Maybe<T2>> fn) |
<R> R |
visit(java.util.function.Function<? super T2,? extends R> some,
java.util.function.Supplier<? extends R> none)
The provided function is executed with the value stored in this Visitable if one is present,
otherwise the provided Supplier is executed instead.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaccumulateJust, accumulateJust, accumulateJust, allTypeclasses, anyM, arrow, async, cast, coflatMap, combine, combineEager, coproduct, filterNot, flatMapI, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromEval, fromEvalNullable, fromEvalOf, fromEvalOptional, fromFuture, fromIterable, fromLazy, fromOptional, fromOptional, fromOptionalKind, fromPublisher, fromStream, just, kindCokleisli, kindKleisli, liftM, mapM, maybe, narrow, narrowK, narrowOptional, nest, nested, none, notNull, of, ofNullable, ofType, peek, product, retry, retry, sequence, sequence, sequenceJust, toMaybe, toTrampoline, trampoline, unit, widen, widen2, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithP, zipWithSarityapply, generate, iterate, iterator, mkString, newSubscriber, stream, subscribe, test, toEither, toEval, toEvalAlways, toEvalLater, toEvalNow, toIor, toLeft, toMaybeEager, toRight, toTry, toTry, toTry, toXor, toXorendsWith, 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, toOptional, toStreampublic final Completable.CompletablePublisher<ORG> complete
public T2 get()
get in interface Convertable<T2>get in interface java.util.function.Supplier<T2>public boolean isPresent()
public Maybe<T2> recoverWith(java.util.function.Supplier<? extends Maybe<T2>> fn)
recoverWith in interface Maybe<T2>public <R> Maybe<R> map(java.util.function.Function<? super T2,? extends R> mapper)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map in interface Transformable<T2>map in interface MonadicValue<T2>map in interface Maybe<T2>mapper - Transformation functionpublic <R> Maybe<R> flatMap(java.util.function.Function<? super T2,? extends MonadicValue<? extends R>> mapper)
MonadicValueOptional.flatMap(Function)
Eval.now(1).map(i->i+2).flatMap(i->Eval.later(()->i*3);
//Eval[9]
public <R> R visit(java.util.function.Function<? super T2,? extends R> some, java.util.function.Supplier<? extends R> none)
Visitablevisit in interface Convertable<T2>visit in interface Visitable<T2>visit in interface Maybe<T2>some - Function to execute if this Visitable has a valuenone - Supplier to execute if this Visitable does not have a Valuepublic Maybe<T2> filter(java.util.function.Predicate<? super T2> fn)
Filters
of(1,2,3).filter(i->i>2);
//[3]
public boolean isFailed()
isFailed in interface Completable<ORG>public boolean isDone()
isDone in interface Completable<ORG>public boolean completeAsNone()
public boolean complete(ORG done)
complete in interface Completable<ORG>public boolean completeExceptionally(java.lang.Throwable error)
completeExceptionally in interface Completable<ORG>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object