com.aol.cyclops.rx.adapter.ObservableReactiveSeq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cyclops-rx Show documentation
Show all versions of cyclops-rx Show documentation
Converters and Comprehenders for RxJava
package com.aol.cyclops.rx.adapter;
import com.aol.cyclops2.internal.stream.ReactiveStreamX;
import com.aol.cyclops2.internal.stream.StreamX;
import com.aol.cyclops2.types.anyM.AnyMSeq;
import com.aol.cyclops2.types.stream.HeadAndTail;
import com.aol.cyclops2.types.traversable.Traversable;
import cyclops.async.adapters.QueueFactory;
import cyclops.collections.immutable.VectorX;
import cyclops.collections.mutable.ListX;
import cyclops.companion.rx.Observables;
import cyclops.control.Maybe;
import cyclops.control.lazy.Either;
import cyclops.function.Monoid;
import cyclops.function.Reducer;
import cyclops.monads.AnyM;
import cyclops.monads.Witness;
import cyclops.monads.Witness.reactiveSeq;
import cyclops.monads.Witness.stream;
import cyclops.monads.transformers.ListT;
import cyclops.stream.ReactiveSeq;
import cyclops.stream.Spouts;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.Wither;
import org.jooq.lambda.tuple.Tuple;
import org.jooq.lambda.tuple.Tuple2;
import org.jooq.lambda.tuple.Tuple3;
import org.jooq.lambda.tuple.Tuple4;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import rx.Observable;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.*;
import java.util.stream.*;
@AllArgsConstructor
public class ObservableReactiveSeq implements ReactiveSeq {
@Wither
@Getter
Observable observable;
public ObservableReactiveSeq observable(Observable observable){
return new ObservableReactiveSeq<>(observable);
}
public ObservableReactiveSeq observable(ReactiveSeq observable){
if(observable instanceof ObservableReactiveSeq){
return (ObservableReactiveSeq)observable;
}
return new ObservableReactiveSeq<>(Observables.observableFrom(observable));
}
@Override
public ReactiveSeq coflatMap(Function super ReactiveSeq, ? extends R> fn) {
return observable(Observable.just(fn.apply(this)));
}
@Override
public ReactiveSeq unit(T1 unit) {
return observable(Observable.just(unit));
}
@Override
public U foldRight(U identity, BiFunction super T, ? super U, ? extends U> accumulator) {
return observable.reduce(identity,(a,b)->accumulator.apply(b,a))
.toBlocking()
.first();
}
@Override
public ReactiveSeq zipS(Stream extends U> other, BiFunction super T, ? super U, ? extends R> zipper) {
if(other instanceof ReactiveSeq){
ReactiveSeq o = (ReactiveSeq)other;
return o.visit(sync->observable(observable.zipWith(ReactiveSeq.fromStream((Stream)other),(a,b)->zipper.apply(a,b))),
rs->observable(observable.zipWith(ReactiveSeq.fromStream((Stream)other),(a,b)->zipper.apply(a,b))),
async->observable(observable.zipWith(ReactiveSeq.fromStream((Stream)other),(a,b)->zipper.apply(a,b))));
}
if(other instanceof Publisher){
return zipP((Publisher)other,zipper);
}
return observable(observable.zipWith(ReactiveSeq.fromStream((Stream)other),(a,b)->zipper.apply(a,b)));
}
@Override
public ReactiveSeq zipLatest(Publisher extends U> other, BiFunction super T, ? super U, ? extends R> zipper) {
Observable obs = Observable.combineLatest(observable, Observables.observable(other), (a, b) -> zipper.apply((T)a, (U)b));
return observable(obs);
}
@Override
public ReactiveSeq zipP(Publisher extends U> other, BiFunction super T, ? super U, ? extends R> zipper) {
return observable(observable.zipWith(Observables.observable(other),(a,b)->zipper.apply(a,b)));
}
@Override
public ReactiveSeq> zipP(Publisher extends U> other) {
return observable(observable.zipWith(Observables.observable(other),Tuple::tuple));
}
@Override
public ReactiveSeq cycle() {
return observable(observable.repeat());
}
@Override
public Tuple2, ReactiveSeq> duplicate() {
return Observables.connectToReactiveSeq(observable).duplicate().map((s1, s2)->Tuple.tuple(observable(s1),observable(s2)));
}
@Override
public Tuple2, ReactiveSeq> duplicate(Supplier> bufferFactory) {
return Observables.connectToReactiveSeq(observable).duplicate(bufferFactory).map((s1, s2)->Tuple.tuple(observable(s1),observable(s2)));
}
@Override
public Tuple3, ReactiveSeq, ReactiveSeq> triplicate() {
return Observables.connectToReactiveSeq(observable).triplicate().map((s1, s2, s3)->Tuple.tuple(observable(s1),observable(s2),observable(s3)));
}
@Override
public Tuple3, ReactiveSeq, ReactiveSeq> triplicate(Supplier> bufferFactory) {
return Observables.connectToReactiveSeq(observable).triplicate(bufferFactory).map((s1, s2, s3)->Tuple.tuple(observable(s1),observable(s2),observable(s3)));
}
@Override
public Tuple4, ReactiveSeq, ReactiveSeq, ReactiveSeq> quadruplicate() {
return Observables.connectToReactiveSeq(observable).quadruplicate().map((s1, s2, s3, s4)->Tuple.tuple(observable(s1),observable(s2),observable(s3),observable(s4)));
}
@Override
public Tuple4, ReactiveSeq, ReactiveSeq, ReactiveSeq> quadruplicate(Supplier> bufferFactory) {
return Observables.connectToReactiveSeq(observable).quadruplicate(bufferFactory).map((s1, s2, s3, s4)->Tuple.tuple(observable(s1),observable(s2),observable(s3),observable(s4)));
}
@Override
public Tuple2, ReactiveSeq> splitAtHead() {
return Observables.connectToReactiveSeq(observable).splitAtHead().map((s1, s2)->Tuple.tuple(s1,observable(s2)));
}
@Override
public Tuple2, ReactiveSeq> splitAt(int where) {
return Observables.connectToReactiveSeq(observable).splitAt(where).map((s1, s2)->Tuple.tuple(observable(s1),observable(s2)));
}
@Override
public Tuple2, ReactiveSeq> splitBy(Predicate splitter) {
return Observables.connectToReactiveSeq(observable).splitBy(splitter).map((s1, s2)->Tuple.tuple(observable(s1),observable(s2)));
}
@Override
public Tuple2, ReactiveSeq> partition(Predicate super T> splitter) {
return Observables.connectToReactiveSeq(observable).partition(splitter).map((s1, s2)->Tuple.tuple(observable(s1),observable(s2)));
}
@Override
public ReactiveSeq> zipS(Stream extends U> other) {
return zipS(other,Tuple::tuple);
}
@Override
public ReactiveSeq> zip3(Iterable extends S> second, Iterable extends U> third) {
return zip(second,Tuple::tuple).zip(third,(a,b)->Tuple.tuple(a.v1,a.v2,b));
}
@Override
public ReactiveSeq> zip4(Iterable extends T2> second, Iterable extends T3> third, Iterable extends T4> fourth) {
return zip(second,Tuple::tuple).zip(third,(a,b)->Tuple.tuple(a.v1,a.v2,b))
.zip(fourth,(a,b)->(Tuple4)Tuple.tuple(a.v1,a.v2,a.v3,b));
}
@Override
public ReactiveSeq> sliding(int windowSize, int increment) {
return observable(Observables.connectToReactiveSeq(observable).sliding(windowSize,increment));
}
@Override
public ReactiveSeq> grouped(int groupSize) {
return observable(observable.buffer(groupSize).map(ListX::fromIterable));
}
@Override
public ReactiveSeq> groupedStatefullyUntil(BiPredicate, ? super T> predicate) {
return observable(Observables.connectToReactiveSeq(observable).groupedStatefullyUntil(predicate));
}
@Override
public , R> ReactiveSeq groupedStatefullyUntil(BiPredicate predicate, Supplier factory, Function super C, ? extends R> finalizer) {
return observable(Observables.connectToReactiveSeq(observable).groupedStatefullyUntil(predicate,factory,finalizer));
}
@Override
public ReactiveSeq> groupedStatefullyWhile(BiPredicate, ? super T> predicate) {
return observable(Observables.connectToReactiveSeq(observable).groupedStatefullyWhile(predicate));
}
@Override
public , R> ReactiveSeq groupedStatefullyWhile(BiPredicate predicate, Supplier factory, Function super C, ? extends R> finalizer) {
return observable(Observables.connectToReactiveSeq(observable).groupedStatefullyWhile(predicate,factory,finalizer));
}
@Override
public ReactiveSeq> groupedBySizeAndTime(int size, long time, TimeUnit t) {
return observable(Observables.connectToReactiveSeq(observable).groupedBySizeAndTime(size, time, t));
}
@Override
public > ReactiveSeq groupedBySizeAndTime(int size, long time, TimeUnit unit, Supplier factory) {
return observable(Observables.connectToReactiveSeq(observable).groupedBySizeAndTime(size,time,unit,factory));
}
@Override
public , R> ReactiveSeq groupedBySizeAndTime(int size, long time, TimeUnit unit, Supplier factory, Function super C, ? extends R> finalizer) {
return observable(Observables.connectToReactiveSeq(observable).groupedBySizeAndTime(size,time,unit,factory,finalizer));
}
@Override
public , R> ReactiveSeq groupedByTime(long time, TimeUnit unit, Supplier factory, Function super C, ? extends R> finalizer) {
return groupedBySizeAndTime(Integer.MAX_VALUE,time,unit,factory,finalizer);
}
@Override
public ReactiveSeq> groupedByTime(long time, TimeUnit t) {
return observable(Observables.connectToReactiveSeq(observable).groupedByTime(time, t));
}
@Override
public > ReactiveSeq groupedByTime(long time, TimeUnit unit, Supplier factory) {
return observable(Observables.connectToReactiveSeq(observable).groupedByTime(time, unit, factory));
}
@Override
public > ReactiveSeq grouped(int size, Supplier supplier) {
return observable(Observables.connectToReactiveSeq(observable).grouped(size,supplier));
}
@Override
public ReactiveSeq> groupedWhile(Predicate super T> predicate) {
return observable(Observables.connectToReactiveSeq(observable).groupedWhile(predicate));
}
@Override
public > ReactiveSeq groupedWhile(Predicate super T> predicate, Supplier factory) {
return observable(Observables.connectToReactiveSeq(observable).groupedWhile(predicate,factory));
}
@Override
public ReactiveSeq distinct() {
return observable(observable.distinct());
}
@Override
public ReactiveSeq scanLeft(U seed, BiFunction super U, ? super T, ? extends U> function) {
return observable(observable.scan(seed,(a,b)->function.apply(a,b)));
}
@Override
public ReactiveSeq sorted() {
return observable(Observables.connectToReactiveSeq(observable).sorted());
}
@Override
public ReactiveSeq skip(long num) {
return observable(observable.skip((int)num));
}
@Override
public void forEach(Consumer super T> action) {
Observables.connectToReactiveSeq(observable).forEach(action);
}
@Override
public void forEachOrdered(Consumer super T> action) {
Observables.connectToReactiveSeq(observable).forEachOrdered(action);
}
@Override
public Object[] toArray() {
return Observables.connectToReactiveSeq(observable).toArray();
}
@Override
public A[] toArray(IntFunction generator) {
return Observables.connectToReactiveSeq(observable).toArray(generator);
}
@Override
public ReactiveSeq skipWhile(Predicate super T> p) {
return observable(observable.skipWhile(t->p.test(t)));
}
@Override
public ReactiveSeq limit(long num) {
return observable(observable.take((int)num));
}
@Override
public ReactiveSeq limitWhile(Predicate super T> p) {
return observable(Observables.connectToReactiveSeq(observable).takeWhile(p));
}
@Override
public ReactiveSeq limitWhileClosed(Predicate super T> p) {
return observable(observable.takeWhile(t->p.test(t)));
}
@Override
public ReactiveSeq limitUntil(Predicate super T> p) {
return observable(Observables.connectToReactiveSeq(observable).limitUntil(p));
}
@Override
public ReactiveSeq limitUntilClosed(Predicate super T> p) {
return observable(observable.takeUntil(t->p.test(t)));
}
@Override
public ReactiveSeq parallel() {
return this;
}
@Override
public boolean allMatch(Predicate super T> c) {
return Observables.connectToReactiveSeq(observable).allMatch(c);
}
@Override
public boolean anyMatch(Predicate super T> c) {
return Observables.connectToReactiveSeq(observable).anyMatch(c);
}
@Override
public boolean xMatch(int num, Predicate super T> c) {
return Observables.connectToReactiveSeq(observable).xMatch(num,c);
}
@Override
public boolean noneMatch(Predicate super T> c) {
return Observables.connectToReactiveSeq(observable).noneMatch(c);
}
@Override
public String join() {
return Observables.connectToReactiveSeq(observable).join();
}
@Override
public String join(String sep) {
return Observables.connectToReactiveSeq(observable).join(sep);
}
@Override
public String join(String sep, String start, String end) {
return Observables.connectToReactiveSeq(observable).join(sep,start,end);
}
@Override
public HeadAndTail headAndTail() {
return Observables.connectToReactiveSeq(observable).headAndTail();
}
@Override
public Optional findFirst() {
return Observables.connectToReactiveSeq(observable).findFirst();
}
@Override
public Maybe findOne() {
return Observables.connectToReactiveSeq(observable).findOne();
}
@Override
public Either findFirstOrError() {
return Observables.connectToReactiveSeq(observable).findFirstOrError();
}
@Override
public Optional findAny() {
return Observables.connectToReactiveSeq(observable).findAny();
}
@Override
public R mapReduce(Reducer reducer) {
return Observables.connectToReactiveSeq(observable).mapReduce(reducer);
}
@Override
public R mapReduce(Function super T, ? extends R> mapper, Monoid reducer) {
return Observables.connectToReactiveSeq(observable).mapReduce(mapper,reducer);
}
@Override
public T reduce(Monoid reducer) {
return Observables.connectToReactiveSeq(observable).reduce(reducer);
}
@Override
public Optional reduce(BinaryOperator accumulator) {
return Observables.connectToReactiveSeq(observable).reduce(accumulator);
}
@Override
public T reduce(T identity, BinaryOperator accumulator) {
return Observables.connectToReactiveSeq(observable).reduce(identity,accumulator);
}
@Override
public U reduce(U identity, BiFunction accumulator, BinaryOperator combiner) {
return Observables.connectToReactiveSeq(observable).reduce(identity, accumulator, combiner);
}
@Override
public ListX reduce(Stream extends Monoid> reducers) {
return Observables.connectToReactiveSeq(observable).reduce(reducers);
}
@Override
public ListX reduce(Iterable extends Monoid> reducers) {
return Observables.connectToReactiveSeq(observable).reduce(reducers);
}
@Override
public T foldRight(Monoid reducer) {
return Observables.connectToReactiveSeq(observable).foldRight(reducer);
}
@Override
public T foldRight(T identity, BinaryOperator accumulator) {
return Observables.connectToReactiveSeq(observable).foldRight(identity,accumulator);
}
@Override
public T1 foldRightMapToType(Reducer reducer) {
return Observables.connectToReactiveSeq(observable).foldRightMapToType(reducer);
}
@Override
public ReactiveSeq stream() {
return Observables.connectToReactiveSeq(observable);
}
@Override
public Traversable unitIterator(Iterator U) {
return new ObservableReactiveSeq<>(Observable.from(()->U));
}
@Override
public boolean startsWithIterable(Iterable iterable) {
return Observables.connectToReactiveSeq(observable).startsWithIterable(iterable);
}
@Override
public boolean startsWith(Stream stream) {
return Observables.connectToReactiveSeq(observable).startsWith(stream);
}
@Override
public AnyMSeq anyM() {
return AnyM.fromStream(this);
}
@Override
public ReactiveSeq map(Function super T, ? extends R> fn) {
return observable(observable.map(e->fn.apply(e)));
}
@Override
public ReactiveSeq flatMap(Function super T, ? extends Stream extends R>> fn) {
return observable(observable.flatMap(s->Observables.fromStream(fn.apply(s))));
}
@Override
public IntStream flatMapToInt(Function super T, ? extends IntStream> mapper) {
return Observables.connectToReactiveSeq(observable).flatMapToInt(mapper);
}
@Override
public LongStream flatMapToLong(Function super T, ? extends LongStream> mapper) {
return Observables.connectToReactiveSeq(observable).flatMapToLong(mapper);
}
@Override
public DoubleStream flatMapToDouble(Function super T, ? extends DoubleStream> mapper) {
return Observables.connectToReactiveSeq(observable).flatMapToDouble(mapper);
}
@Override
public ReactiveSeq flatMapAnyM(Function super T, AnyM> fn) {
return observable(observable.flatMap(a->Observables.observable(fn.apply(a))));
}
@Override
public ReactiveSeq flatMapI(Function super T, ? extends Iterable extends R>> fn) {
return observable(observable.flatMapIterable(a->fn.apply(a)));
}
@Override
public ReactiveSeq flatMapP(Function super T, ? extends Publisher extends R>> fn) {
return observable(Observable.merge(observable.map(a->Observables.observable(fn.apply(a)))));
}
@Override
public ReactiveSeq flatMapP(int maxConcurrency, Function super T, ? extends Publisher extends R>> fn) {
return observable(Observable.merge(observable.map(a->Observables.observable(fn.apply(a))),maxConcurrency));
}
@Override
public ReactiveSeq flatMapStream(Function super T, BaseStream extends R, ?>> fn) {
return this.observable((Observable)observable.flatMap(a->fn.andThen(s->{
ReactiveSeq res = s instanceof ReactiveSeq ? (ReactiveSeq) s : (ReactiveSeq) ReactiveSeq.fromSpliterator(s.spliterator());
return Observables.fromStream(res);
}
).apply(a)));
}
@Override
public ReactiveSeq filter(Predicate super T> fn) {
return observable(observable.filter(t->fn.test(t)));
}
@Override
public Iterator iterator() {
return Observables.connectToReactiveSeq(observable).iterator();
}
@Override
public Spliterator spliterator() {
return Observables.connectToReactiveSeq(observable).spliterator();
}
@Override
public boolean isParallel() {
return false;
}
@Override
public ReactiveSeq sequential() {
return this;
}
@Override
public ReactiveSeq unordered() {
return this;
}
@Override
public ReactiveSeq reverse() {
return observable(Observables.connectToReactiveSeq(observable).reverse());
}
@Override
public ReactiveSeq onClose(Runnable closeHandler) {
return observable(observable.doOnCompleted(()->closeHandler.run()));
}
@Override
public void close() {
}
@Override
public ReactiveSeq prependS(Stream extends T> stream) {
return observable(Observables.connectToReactiveSeq(observable).prependS(stream));
}
@Override
public ReactiveSeq append(T... values) {
return observable(Observables.connectToReactiveSeq(observable).append(values));
}
@Override
public ReactiveSeq append(T value) {
return observable(Observables.connectToReactiveSeq(observable).append(value));
}
@Override
public ReactiveSeq prepend(T value) {
return observable(Observables.connectToReactiveSeq(observable).prepend(value));
}
@Override
public ReactiveSeq prepend(T... values) {
return observable(Observables.connectToReactiveSeq(observable).prepend(values));
}
@Override
public boolean endsWithIterable(Iterable iterable) {
return Observables.connectToReactiveSeq(observable).endsWithIterable(iterable);
}
@Override
public boolean endsWith(Stream stream) {
return Observables.connectToReactiveSeq(observable).endsWith(stream);
}
@Override
public ReactiveSeq skip(long time, TimeUnit unit) {
return observable(observable.skip(time,unit));
}
@Override
public ReactiveSeq limit(long time, TimeUnit unit) {
return observable(observable.take(time,unit));
}
@Override
public ReactiveSeq skipLast(int num) {
return observable(observable.skipLast(num));
}
@Override
public ReactiveSeq limitLast(int num) {
return observable(observable.takeLast(num));
}
@Override
public T firstValue() {
return observable.toBlocking().first();
}
@Override
public ReactiveSeq onEmptySwitch(Supplier extends Stream> switchTo) {
return observable(Observables.connectToReactiveSeq(observable).onEmptySwitch(switchTo));
}
@Override
public ReactiveSeq onEmptyGet(Supplier extends T> supplier) {
return observable(Observables.connectToReactiveSeq(observable).onEmptyGet(supplier));
}
@Override
public ReactiveSeq onEmptyThrow(Supplier extends X> supplier) {
return observable(Observables.connectToReactiveSeq(observable).onEmptyThrow(supplier));
}
@Override
public ReactiveSeq distinct(Function super T, ? extends U> keyExtractor) {
return observable(observable.distinct(a->keyExtractor.apply(a)));
}
@Override
public ReactiveSeq xPer(int x, long time, TimeUnit t) {
return observable(Observables.connectToReactiveSeq(observable).xPer(x,time,t));
}
@Override
public ReactiveSeq onePer(long time, TimeUnit t) {
return observable(Observables.connectToReactiveSeq(observable).onePer(time,t));
}
@Override
public ReactiveSeq debounce(long time, TimeUnit t) {
return observable(Observables.connectToReactiveSeq(observable).debounce(time,t));
}
@Override
public ReactiveSeq fixedDelay(long l, TimeUnit unit) {
return observable(Observables.connectToReactiveSeq(observable).fixedDelay(l,unit));
}
@Override
public ReactiveSeq jitter(long maxJitterPeriodInNanos) {
return observable(Observables.connectToReactiveSeq(observable).jitter(maxJitterPeriodInNanos));
}
@Override
public ReactiveSeq recover(Function super Throwable, ? extends T> fn) {
return observable(Observables.connectToReactiveSeq(observable).recover(fn));
}
@Override
public ReactiveSeq recover(Class exceptionClass, Function super EX, ? extends T> fn) {
return observable(Observables.connectToReactiveSeq(observable).recover(exceptionClass,fn));
}
@Override
public long count() {
return Observables.connectToReactiveSeq(observable).count();
}
@Override
public ReactiveSeq appendS(Stream extends T> other) {
return observable(Observables.connectToReactiveSeq(observable).appendS(other));
}
@Override
public ReactiveSeq append(Iterable extends T> other) {
return observable(Observables.connectToReactiveSeq(observable).append(other));
}
@Override
public ReactiveSeq prepend(Iterable extends T> other) {
return observable(Observables.connectToReactiveSeq(observable).prepend(other));
}
@Override
public ReactiveSeq cycle(long times) {
return observable(observable.repeat(times));
}
@Override
public ReactiveSeq skipWhileClosed(Predicate super T> predicate) {
return observable(Observables.connectToReactiveSeq(observable).skipWhileClosed(predicate));
}
@Override
public String format() {
return Observables.connectToReactiveSeq(observable).format();
}
@Override
public ReactiveSeq changes() {
return observable(Observables.connectToReactiveSeq(observable).changes());
}
@Override
public Subscription forEachSubscribe(Consumer super T> consumer) {
return Observables.connectToReactiveSeq(observable).forEachSubscribe(consumer);
}
@Override
public Subscription forEachSubscribe(Consumer super T> consumer, Consumer super Throwable> consumerError) {
return Observables.connectToReactiveSeq(observable).forEachSubscribe(consumer, consumerError);
}
@Override
public Subscription forEachSubscribe(Consumer super T> consumer, Consumer super Throwable> consumerError, Runnable onComplete) {
return Observables.connectToReactiveSeq(observable).forEachSubscribe(consumer, consumerError,onComplete);
}
@Override
public R collect(Supplier supplier, BiConsumer accumulator, BiConsumer combiner) {
return Observables.connectToReactiveSeq(observable).collect(supplier,accumulator,combiner);
}
@Override
public ReactiveSeq collectStream(Collector super T, A, R> collector) {
return observable(Observables.connectToReactiveSeq(observable).collectStream(collector));
}
@Override
public R collect(Collector super T, A, R> collector) {
return Observables.connectToReactiveSeq(observable).collect((Collector)collector);
}
@Override
public T singleUnsafe() {
return single().get();
}
@Override
public Maybe single(Predicate super T> predicate) {
return filter(predicate).single();
}
@Override
public Maybe single() {
return Observables.connectToReactiveSeq(observable).single();
}
@Override
public ListX> multicast(int num) {
return Observables.connectToReactiveSeq(observable).multicast(num).map(s->observable(s));
}
@Override
public void subscribe(Subscriber super T> s) {
Observables.publisher(observable).subscribe(s);
}
@Override
public R visit(Function super ReactiveSeq,? extends R> sync,Function super ReactiveSeq,? extends R> reactiveStreams,
Function super ReactiveSeq,? extends R> asyncNoBackPressure){
return asyncNoBackPressure.apply(this);
}
@Override
public ListT groupedT(int groupSize) {
return ListT.fromStream(grouped(groupSize));
}
@Override
public ListT slidingT(int windowSize, int increment) {
return ListT.fromStream(sliding(windowSize,increment));
}
@Override
public ListT slidingT(int windowSize) {
return ListT.fromStream(sliding(windowSize));
}
@Override
public ListT groupedUntilT(Predicate super T> predicate) {
return ListT.fromStream(groupedUntil(predicate));
}
@Override
public ListT groupedStatefullyUntilT(BiPredicate, ? super T> predicate) {
return ListT.fromStream(groupedStatefullyWhile(predicate));
}
@Override
public ListT groupedWhileT(Predicate super T> predicate) {
return ListT.fromStream(groupedWhile(predicate));
}
}