public static class Maybe.CompletableMaybe<ORG,T2> extends java.lang.Object implements Maybe<T2>, Completable<ORG>
Maybe.µ, 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 |
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()
Apply this function to the arguments.
|
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<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, wait
accumulateJust, accumulateJust, accumulateJust, anyM, arrow, cast, coflatMap, combine, combineEager, filterNot, flatMapI, flatMapP, flatMapS, forEach2, forEach2, forEach3, forEach3, forEach4, forEach4, fromEval, fromEvalNullable, fromEvalOf, fromEvalOptional, fromFuture, fromIterable, fromLazy, fromOptional, fromOptional, fromOptionalKind, fromPublisher, fromStream, just, liftM, maybe, narrow, narrowK, narrowOptional, nest, none, notNull, of, ofNullable, ofType, peek, retry, retry, sequence, sequence, sequenceJust, toMaybe, trampoline, unit, widen2, zip, zip, zip, zip3, zip3, zip4, zip4, zipP, zipP, zipS, zipS, zipWith, zipWithP, zipWithS
apply, generate, iterate, iterator, mkString, newSubscriber, stream, subscribe, test, toEvalAlways, toEvalLater, toEvalNow, toIor, toTry, toTry, toTry, toXor, toXor
endsWith, 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, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, xMatch
futureStream, getStreamable, isEmpty, jdkStream, reactiveSeq, reveresedJDKStream, reveresedStream
collect, fromSupplier, orElse, orElseGet, orElseThrow, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFuture, toFutureWAsync, toFutureWAsync, toOptional, toStream
public final Completable.CompletablePublisher<ORG> complete
public T2 get()
org.jooq.lambda.function.Function0
get
in interface Convertable<T2>
get
in interface java.util.function.Supplier<T2>
get
in interface org.jooq.lambda.function.Function0<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 MonadicValue<T2>
map
in interface Transformable<T2>
map
in interface Maybe<T2>
mapper
- Transformation functionpublic <R> Maybe<R> flatMap(java.util.function.Function<? super T2,? extends MonadicValue<? extends R>> mapper)
MonadicValue
Optional.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)
Visitable
visit
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 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.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object