public class MonoTValue<A> extends java.lang.Object implements MonoT<A>, com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>, com.aol.cyclops.types.MonadicValue1<A>, java.util.function.Supplier<A>, com.aol.cyclops.types.ConvertableFunctor<A>, com.aol.cyclops.types.Filterable<A>, com.aol.cyclops.types.applicative.ApplicativeFunctor<A>, com.aol.cyclops.control.Matchable.ValueAndOptionalMatcher<A>
com.aol.cyclops.types.applicative.ApplicativeFunctor.Applicatives, com.aol.cyclops.types.applicative.ApplicativeFunctor.ApplyFunctions<T>| Modifier and Type | Method and Description |
|---|---|
<B> MonoTValue<B> |
bind(java.util.function.Function<? super A,MonoT<? extends B>> f)
FlatMap operation
|
<U> MonoTValue<U> |
cast(java.lang.Class<? extends U> type) |
<R> MonoTValue<R> |
coflatMap(java.util.function.Function<? super com.aol.cyclops.types.MonadicValue<A>,R> mapper) |
<T2,R> MonoTValue<R> |
combine(com.aol.cyclops.types.Value<? extends T2> app,
java.util.function.BiFunction<? super A,? super T2,? extends R> fn) |
MonoTValue<A> |
combineEager(com.aol.cyclops.Monoid<A> monoid,
com.aol.cyclops.types.MonadicValue<? extends A> v2) |
<R> MonoTValue<R> |
empty() |
boolean |
equals(java.lang.Object o) |
MonoTValue<A> |
filter(java.util.function.Predicate<? super A> test) |
MonoTValue<A> |
filterNot(java.util.function.Predicate<? super A> fn) |
<B> MonoTValue<B> |
flatMap(java.util.function.Function<? super A,? extends com.aol.cyclops.types.MonadicValue<? extends B>> f)
flatMap operation
|
<B> MonoTValue<B> |
flatMapT(java.util.function.Function<? super A,MonoTValue<B>> f)
Flat Map the wrapped CompletableFuture
|
static <A> MonoTValue<A> |
fromAnyM(com.aol.cyclops.types.anyM.AnyMValue<A> anyM)
|
A |
get() |
int |
hashCode() |
boolean |
isPresent() |
boolean |
isValuePresent() |
java.util.Iterator<A> |
iterator() |
static <U,R> java.util.function.Function<MonoTValue<U>,MonoTValue<R>> |
lift(java.util.function.Function<? super U,? extends R> fn)
Lift a function into one that accepts and returns an CompletableFutureT
This allows multiple monad types to add functionality to existing functions and methods
e.g.
|
static <U1,U2,R> java.util.function.BiFunction<MonoTValue<U1>,MonoTValue<U2>,MonoTValue<R>> |
lift2(java.util.function.BiFunction<? super U1,? super U2,? extends R> fn)
Lift a BiFunction into one that accepts and returns CompletableFutureTs
This allows multiple monad types to add functionality to existing functions and methods
e.g.
|
<B> MonoTValue<B> |
map(java.util.function.Function<? super A,? extends B> f)
Map the wrapped Mono
|
MonoTValue<com.aol.cyclops.types.MonadicValue<A>> |
nest() |
MonoTValue<A> |
notNull() |
static <A> MonoTValue<A> |
of(com.aol.cyclops.types.anyM.AnyMValue<reactor.core.publisher.Mono<A>> monads)
Construct an CompletableFutureT from an AnyM that wraps a monad containing CompletableFutures
|
static <A> MonoTValue<A> |
of(reactor.core.publisher.Mono<A> monads) |
<U> MonoTValue<U> |
ofType(java.lang.Class<? extends U> type) |
<R> MonoTValue<R> |
patternMatch(java.util.function.Function<com.aol.cyclops.control.Matchable.CheckValue1<A,R>,com.aol.cyclops.control.Matchable.CheckValue1<A,R>> case1,
java.util.function.Supplier<? extends R> otherwise) |
MonoTValue<A> |
peek(java.util.function.Consumer<? super A> peek)
Peek at the current value of the Mono
|
com.aol.cyclops.control.ReactiveSeq<A> |
stream() |
void |
subscribe(org.reactivestreams.Subscriber<? super A> s) |
boolean |
test(A t) |
java.lang.String |
toString() |
<R> MonoTValue<R> |
trampoline(java.util.function.Function<? super A,? extends com.aol.cyclops.control.Trampoline<? extends R>> mapper) |
<R> MonoTValue<R> |
unit(R value) |
com.aol.cyclops.types.anyM.AnyMValue<reactor.core.publisher.Mono<A>> |
unwrap() |
com.aol.cyclops.control.FutureW<A> |
value() |
<T2,R> MonoTValue<R> |
zip(java.util.function.BiFunction<? super A,? super T2,? extends R> fn,
org.reactivestreams.Publisher<? extends T2> app) |
<T2,R> MonoTValue<R> |
zip(java.lang.Iterable<? extends T2> app,
java.util.function.BiFunction<? super A,? super T2,? extends R> fn) |
<U> MonoTValue<org.jooq.lambda.tuple.Tuple2<A,U>> |
zip(java.lang.Iterable<? extends U> other) |
<U> MonoTValue<org.jooq.lambda.tuple.Tuple2<A,U>> |
zip(org.jooq.lambda.Seq<? extends U> other) |
<U,R> MonoTValue<R> |
zip(org.jooq.lambda.Seq<? extends U> other,
java.util.function.BiFunction<? super A,? super U,? extends R> zipper) |
<U> MonoTValue<org.jooq.lambda.tuple.Tuple2<A,U>> |
zip(java.util.stream.Stream<? extends U> other) |
<U,R> MonoTValue<R> |
zip(java.util.stream.Stream<? extends U> other,
java.util.function.BiFunction<? super A,? super U,? extends R> zipper) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitemptyList, emptyOptional, fromAnyM, fromAnyMSeq, fromAnyMValue, fromFuture, fromIterable, fromIterableValue, fromMono, fromOptional, fromPublisher, fromStream, fromValue, offutureStream, getStreamable, isEmpty, jdkStream, reactiveSeq, reveresedJDKStream, reveresedStreamapplyFunctionscollect, fold, fold, generate, iterate, mapReduce, mkString, newSubscriber, of, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFeatureToggle, toFutureStream, toFutureStream, toIor, toLazyImmutable, toList, toListX, toMaybe, toMutable, toPBagX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toTry, toTry, toTry, toXor, toXor, unapplyendsWith, endsWithIterable, findAny, findFirst, firstValue, foldable, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, join, join, join, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, xMatchcollect, fromSupplier, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visitpublic com.aol.cyclops.types.anyM.AnyMValue<reactor.core.publisher.Mono<A>> unwrap()
public com.aol.cyclops.control.FutureW<A> value()
value in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>public boolean isPresent()
public boolean isValuePresent()
isValuePresent in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>public MonoTValue<A> filter(java.util.function.Predicate<? super A> test)
public MonoTValue<A> peek(java.util.function.Consumer<? super A> peek)
MonoT
MonoT.of(AnyM.fromIterable(ListX.of(Mono.just(10)))
.peek(System.out::println);
//prints 10
peek in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>peek in interface MonoT<A>peek in interface com.aol.cyclops.types.Functor<A>peek - Consumer to accept current value of CompletableFuturepublic <B> MonoTValue<B> map(java.util.function.Function<? super A,? extends B> f)
MonoT
MonoT.of(AnyM.fromIterable(ListX.of(Mono.just(10)))
.map(t->t+1);
map in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>map in interface MonoT<A>map in interface com.aol.cyclops.types.ConvertableFunctor<A>map in interface com.aol.cyclops.types.Functor<A>map in interface com.aol.cyclops.types.MonadicValue<A>map in interface com.aol.cyclops.types.MonadicValue1<A>f - Mapping function for the wrapped Monopublic <T2,R> MonoTValue<R> combine(com.aol.cyclops.types.Value<? extends T2> app, java.util.function.BiFunction<? super A,? super T2,? extends R> fn)
combine in interface com.aol.cyclops.types.applicative.ApplicativeFunctor<A>public <T2,R> MonoTValue<R> zip(java.lang.Iterable<? extends T2> app, java.util.function.BiFunction<? super A,? super T2,? extends R> fn)
public <T2,R> MonoTValue<R> zip(java.util.function.BiFunction<? super A,? super T2,? extends R> fn, org.reactivestreams.Publisher<? extends T2> app)
public <U,R> MonoTValue<R> zip(org.jooq.lambda.Seq<? extends U> other, java.util.function.BiFunction<? super A,? super U,? extends R> zipper)
zip in interface com.aol.cyclops.types.Zippable<A>public <U,R> MonoTValue<R> zip(java.util.stream.Stream<? extends U> other, java.util.function.BiFunction<? super A,? super U,? extends R> zipper)
zip in interface com.aol.cyclops.types.Zippable<A>public <U> MonoTValue<org.jooq.lambda.tuple.Tuple2<A,U>> zip(java.util.stream.Stream<? extends U> other)
zip in interface com.aol.cyclops.types.Zippable<A>public <U> MonoTValue<org.jooq.lambda.tuple.Tuple2<A,U>> zip(org.jooq.lambda.Seq<? extends U> other)
zip in interface com.aol.cyclops.types.Zippable<A>public <U> MonoTValue<org.jooq.lambda.tuple.Tuple2<A,U>> zip(java.lang.Iterable<? extends U> other)
zip in interface com.aol.cyclops.types.Zippable<A>public <B> MonoTValue<B> flatMapT(java.util.function.Function<? super A,MonoTValue<B>> f)
MonoT.fromOptional(Optional.of(Mono.just(10))
.flatMapT(t->MonoT.fromOptional(Mono.just(t*2));
//MonoT[20]
f - FlatMap functionpublic <B> MonoTValue<B> flatMap(java.util.function.Function<? super A,? extends com.aol.cyclops.types.MonadicValue<? extends B>> f)
MonoT
MonoT.of(AnyM.fromIterable(ListX.of(Mono.just(10)))
.flatMap(t-> Maybe.just(t+1));
public static <U,R> java.util.function.Function<MonoTValue<U>,MonoTValue<R>> lift(java.util.function.Function<? super U,? extends R> fn)
public static <U1,U2,R> java.util.function.BiFunction<MonoTValue<U1>,MonoTValue<U2>,MonoTValue<R>> lift2(java.util.function.BiFunction<? super U1,? super U2,? extends R> fn)
public static <A> MonoTValue<A> fromAnyM(com.aol.cyclops.types.anyM.AnyMValue<A> anyM)
anyM - AnyM that doesn't contain a monad wrapping an CompletableFuturepublic static <A> MonoTValue<A> of(com.aol.cyclops.types.anyM.AnyMValue<reactor.core.publisher.Mono<A>> monads)
monads - AnyM that contains a monad wrapping an CompletableFuturepublic static <A> MonoTValue<A> of(reactor.core.publisher.Mono<A> monads)
public java.lang.String toString()
toString in class java.lang.Objectpublic A get()
public com.aol.cyclops.control.ReactiveSeq<A> stream()
public java.util.Iterator<A> iterator()
iterator in interface com.aol.cyclops.control.Matchable.MatchableOptional<A>iterator in interface com.aol.cyclops.control.Matchable.ValueAndOptionalMatcher<A>iterator in interface com.aol.cyclops.types.Convertable<A>iterator in interface com.aol.cyclops.types.stream.ToStream<A>iterator in interface com.aol.cyclops.types.Value<A>iterator in interface java.lang.Iterable<A>public void subscribe(org.reactivestreams.Subscriber<? super A> s)
public boolean test(A t)
public <R> MonoTValue<R> unit(R value)
unit in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>unit in interface com.aol.cyclops.types.MonadicValue<A>unit in interface com.aol.cyclops.types.MonadicValue1<A>unit in interface com.aol.cyclops.types.Unit<A>public <R> MonoTValue<R> empty()
public <U> MonoTValue<U> cast(java.lang.Class<? extends U> type)
public <R> MonoTValue<R> trampoline(java.util.function.Function<? super A,? extends com.aol.cyclops.control.Trampoline<? extends R>> mapper)
trampoline in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>trampoline in interface MonoT<A>trampoline in interface com.aol.cyclops.types.Functor<A>public <R> MonoTValue<R> patternMatch(java.util.function.Function<com.aol.cyclops.control.Matchable.CheckValue1<A,R>,com.aol.cyclops.control.Matchable.CheckValue1<A,R>> case1, java.util.function.Supplier<? extends R> otherwise)
patternMatch in interface com.aol.cyclops.control.monads.transformers.values.TransformerValue<A>patternMatch in interface MonoT<A>patternMatch in interface com.aol.cyclops.types.Functor<A>public <U> MonoTValue<U> ofType(java.lang.Class<? extends U> type)
public MonoTValue<A> filterNot(java.util.function.Predicate<? super A> fn)
public MonoTValue<A> notNull()
public <B> MonoTValue<B> bind(java.util.function.Function<? super A,MonoT<? extends B>> f)
MonoTpublic MonoTValue<com.aol.cyclops.types.MonadicValue<A>> nest()
nest in interface com.aol.cyclops.types.MonadicValue<A>public <R> MonoTValue<R> coflatMap(java.util.function.Function<? super com.aol.cyclops.types.MonadicValue<A>,R> mapper)
public MonoTValue<A> combineEager(com.aol.cyclops.Monoid<A> monoid, com.aol.cyclops.types.MonadicValue<? extends A> v2)
combineEager in interface com.aol.cyclops.types.MonadicValue1<A>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object