T1
- 1st allowable data type for elementT2
- 2nd allowable data type for elementpublic interface MonadicValue2<T1,T2> extends MonadicValue<T2>
Value.ValueImpl<T>
Convertable.SupplierToConvertable<T>
Modifier and Type | Method and Description |
---|---|
default MonadicValue2<T1,T2> |
combineEager(Monoid<T2> monoid,
MonadicValue2<? extends T1,? extends T2> v2)
Eagerly combine two MonadicValues using the supplied monoid
|
<R1,R2> MonadicValue2<R1,R2> |
flatMap(java.util.function.Function<? super T2,? extends MonadicValue2<? extends R1,? extends R2>> mapper)
Perform a flattening transformation of this Monadicvalue2
|
default <R> MonadicValue2<T1,R> |
flatMapIterable(java.util.function.Function<? super T2,? extends java.lang.Iterable<? extends R>> mapper)
A flattening transformation operation that takes the first value from the returned Publisher.
|
default <R> MonadicValue2<T1,R> |
flatMapPublisher(java.util.function.Function<? super T2,? extends org.reactivestreams.Publisher<? extends R>> mapper)
A flattening transformation operation that takes the first value from the returned Publisher.
|
<R> MonadicValue2<T1,R> |
map(java.util.function.Function<? super T2,? extends R> fn)
Transform this functor using the supplied transformation function
|
<T2> MonadicValue2<T1,T2> |
unit(T2 unit) |
anyM, coflatMap, nest
collect, fold, fold, generate, iterate, iterator, mapReduce, mkString, newSubscriber, of, stream, subscribe, test, 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, unapply
endsWith, 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, xMatch
collect, fromSupplier, get, isPresent, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visit
cast, patternMatch, peek, trampoline
<R1,R2> MonadicValue2<R1,R2> flatMap(java.util.function.Function<? super T2,? extends MonadicValue2<? extends R1,? extends R2>> mapper)
mapper
- transformation functiondefault MonadicValue2<T1,T2> combineEager(Monoid<T2> monoid, MonadicValue2<? extends T1,? extends T2> v2)
Monoid<Integer> add = Mondoid.of(1,Semigroups.intSum);
Maybe.of(10).combineEager(add,Maybe.none());
//Maybe[10]
Maybe.none().combineEager(add,Maybe.of(10));
//Maybe[10]
Maybe.none().combineEager(add,Maybe.none());
//Maybe.none()
Maybe.of(10).combineEager(add,Maybe.of(10));
//Maybe[20]
Monoid
<Integer> firstNonNull = Monoid.of(null , Semigroups.firstNonNull());
Maybe.of(10).combineEager(firstNonNull,Maybe.of(10));
//Maybe[10]
monoid
- Monoid to be used to combine valuesv2
- MonadicValue to combine with<R> MonadicValue2<T1,R> map(java.util.function.Function<? super T2,? extends R> fn)
Functor
of(1,2,3).map(i->i*2)
//[2,4,6]
<T2> MonadicValue2<T1,T2> unit(T2 unit)
default <R> MonadicValue2<T1,R> flatMapIterable(java.util.function.Function<? super T2,? extends java.lang.Iterable<? extends R>> mapper)
Xor.primary(1).map(i->i+2).flatMapPublisher(i->Arrays.asList(()->i*3,20);
//Xor[9]
mapper
- transformation functiondefault <R> MonadicValue2<T1,R> flatMapPublisher(java.util.function.Function<? super T2,? extends org.reactivestreams.Publisher<? extends R>> mapper)
Ior.primary(1).map(i->i+2).flatMapPublisher(i->Flux.just(()->i*3,20);
//Xor[9]
mapper
- FlatMap transformation function