public final class Stages extends Object
| Modifier and Type | Method and Description |
|---|---|
static Stage<Void> |
all() |
static Stage<Void> |
all(Iterable<? extends Stage<?>> stages) |
static Stage<Void> |
all(Iterator<? extends Stage<?>> stages) |
static Stage<Void> |
all(List<? extends Stage<?>> stages) |
static Stage<Void> |
all(Stage<?>... stages) |
static Stage<Void> |
all(Stage<?> stage1) |
static Stage<Void> |
all(Stage<?> stage1,
Stage<?> stage2)
Optimized for 2 stages.
|
static Stage<Void> |
all(Stream<? extends Stage<?>> stages) |
static <T> Stage<T> |
any() |
static <T> Stage<T> |
any(Iterable<? extends Stage<? extends T>> stages) |
static <T> Stage<T> |
any(Iterator<? extends Stage<? extends T>> stages) |
static <T> Stage<T> |
any(List<? extends Stage<? extends T>> stages) |
static <T> Stage<T> |
any(Stage<? extends T>... stages) |
static <T> Stage<T> |
any(Stage<? extends T> stage1) |
static <T> Stage<T> |
any(Stage<? extends T> stage1,
Stage<? extends T> stage2)
Optimized for 2 stages.
|
static <T> Stage<T> |
any(Stream<? extends Stage<? extends T>> stages) |
static <A,T,R> Stage<R> |
collect(List<? extends Stage<? extends T>> stages,
CollectListener<T,A,R> listener,
IndexedCollector<T,A,R> collector)
Allows you to do something on completion of every
Stage. |
static <A,T,R> Stage<R> |
collect(List<? extends Stage<? extends T>> stages,
Collector<T,A,R> collector) |
static <A,T,R> Stage<R> |
collect(List<? extends Stage<? extends T>> stages,
IndexedCollector<T,A,R> collector)
Accumulates results of
Stages using IndexedCollector. |
static <T,A,R> Stage<R> |
collectSequence(Iterable<? extends AsyncCallable<? extends T>> stages,
Collector<T,A,R> collector) |
static <T,A,R> Stage<R> |
collectSequence(Iterator<? extends AsyncCallable<? extends T>> stages,
Collector<T,A,R> collector)
Accumulate
Stage results into one final using Collector sequentially |
static <T,A,R> Stage<R> |
collectSequence(Stream<AsyncCallable<? extends T>> stages,
Collector<T,A,R> collector) |
static <T> Stage<T> |
first(Iterable<? extends AsyncCallable<? extends T>> stages,
BiPredicate<? super T,? super Throwable> predicate) |
static <T> Stage<T> |
first(Iterator<? extends AsyncCallable<? extends T>> stages,
BiPredicate<? super T,? super Throwable> predicate) |
static <T> Stage<T> |
first(Stream<? extends AsyncCallable<? extends T>> stages,
BiPredicate<? super T,? super Throwable> predicate) |
static <T> Stage<T> |
firstSuccessful(AsyncCallable<? extends T>... stages)
Predicate in this case picks first
Stage that was completed normally |
static <T> Stage<T> |
firstSuccessful(Iterable<? extends AsyncCallable<? extends T>> stages)
Predicate in this case picks first
Stage that was completed normally |
static <T> Stage<T> |
firstSuccessful(Iterator<? extends AsyncCallable<? extends T>> stages)
Predicate in this case picks first
Stage that was completed normally |
static <T> Stage<T> |
firstSuccessful(Stream<AsyncCallable<? extends T>> stages) |
static <T> Iterable<Stage<T>> |
iterable(Iterable<? extends AsyncCallable<? extends T>> callables)
Transforms Iterable over AsyncCallable to Iterable over Stages
|
static <T> Iterator<Stage<T>> |
iterator(Iterator<? extends AsyncCallable<? extends T>> callables)
Transforms Iterator over AsyncCallable to Iterator over Stages
|
static Stage<Void> |
runSequence() |
static Stage<Void> |
runSequence(AsyncCallable<?>... stages) |
static Stage<Void> |
runSequence(AsyncCallable<?> stage) |
static Stage<Void> |
runSequence(AsyncCallable<?> stage1,
AsyncCallable<?> stage2) |
static Stage<Void> |
runSequence(AsyncCallable<?> stage1,
AsyncCallable<?> stage2,
AsyncCallable<?> stage3) |
static Stage<Void> |
runSequence(Iterable<? extends AsyncCallable<?>> stages) |
static Stage<Void> |
runSequence(Iterator<? extends AsyncCallable<?>> stages)
Calls every
Stage from stages in sequence. |
static Stage<Void> |
runSequence(Stream<? extends AsyncCallable<?>> stages) |
static <T> Stage<T[]> |
toArray(Class<T> type) |
static <T> Stage<T[]> |
toArray(Class<T> type,
List<? extends Stage<? extends T>> stages)
Prepared version of reduce that reduces stages into Stage<Array>
|
static <T> Stage<T[]> |
toArray(Class<T> type,
Stage<? extends T>... stages) |
static <T> Stage<T[]> |
toArray(Class<T> type,
Stage<? extends T> stage1) |
static <T> Stage<T[]> |
toArray(Class<T> type,
Stage<? extends T> stage1,
Stage<? extends T> stage2) |
static <T> Stage<T[]> |
toArray(Class<T> type,
Stream<? extends Stage<? extends T>> stages) |
static <T> Stage<List<T>> |
toList() |
static <T> Stage<List<T>> |
toList(List<? extends Stage<? extends T>> stages)
Prepared version of reduce that reduces stages into Stage<List>
|
static <T> Stage<List<T>> |
toList(Stage<? extends T>... stages) |
static <T> Stage<List<T>> |
toList(Stage<? extends T> stage1) |
static <T> Stage<List<T>> |
toList(Stage<? extends T> stage1,
Stage<? extends T> stage2) |
static <T> Stage<List<T>> |
toList(Stream<? extends Stage<? extends T>> stages) |
static <T1> Stage<Tuple1<T1>> |
toTuple(Stage<? extends T1> stage1) |
static <T1,T2> Stage<Tuple2<T1,T2>> |
toTuple(Stage<? extends T1> stage1,
Stage<? extends T2> stage2) |
static <T1,T2,T3> Stage<Tuple3<T1,T2,T3>> |
toTuple(Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3) |
static <T1,T2,T3,T4> |
toTuple(Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3,
Stage<? extends T4> stage4) |
static <T1,T2,T3,T4,T5> |
toTuple(Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3,
Stage<? extends T4> stage4,
Stage<? extends T5> stage5) |
static <T1,T2,T3,T4,T5,T6> |
toTuple(Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3,
Stage<? extends T4> stage4,
Stage<? extends T5> stage5,
Stage<? extends T6> stage6) |
static <T1,R> Stage<R> |
toTuple(TupleConstructor1<T1,R> constructor,
Stage<? extends T1> stage1) |
static <T1,T2,R> Stage<R> |
toTuple(TupleConstructor2<T1,T2,R> constructor,
Stage<? extends T1> stage1,
Stage<? extends T2> stage2) |
static <T1,T2,T3,R> |
toTuple(TupleConstructor3<T1,T2,T3,R> constructor,
Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3) |
static <T1,T2,T3,T4,R> |
toTuple(TupleConstructor4<T1,T2,T3,T4,R> constructor,
Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3,
Stage<? extends T4> stage4) |
static <T1,T2,T3,T4,T5,R> |
toTuple(TupleConstructor5<T1,T2,T3,T4,T5,R> constructor,
Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3,
Stage<? extends T4> stage4,
Stage<? extends T5> stage5) |
static <T1,T2,T3,T4,T5,T6,R> |
toTuple(TupleConstructor6<T1,T2,T3,T4,T5,T6,R> constructor,
Stage<? extends T1> stage1,
Stage<? extends T2> stage2,
Stage<? extends T3> stage3,
Stage<? extends T4> stage4,
Stage<? extends T5> stage5,
Stage<? extends T6> stage6) |
public static Stage<Void> all(Stage<?> stage1, Stage<?> stage2)
all(List)public static Stage<Void> all(List<? extends Stage<?>> stages)
Stage that completes when all stages are completedpublic static Stage<Void> all(Iterator<? extends Stage<?>> stages)
Stage that completes when all stages are completedpublic static <T> Stage<T> any()
public static <T> Stage<T> any(Stage<? extends T> stage1, Stage<? extends T> stage2)
any(List)@SafeVarargs public static <T> Stage<T> any(Stage<? extends T>... stages)
any(List)public static <T> Stage<T> any(List<? extends Stage<? extends T>> stages)
public static <A,T,R> Stage<R> collect(List<? extends Stage<? extends T>> stages, Collector<T,A,R> collector)
public static <A,T,R> Stage<R> collect(List<? extends Stage<? extends T>> stages, IndexedCollector<T,A,R> collector)
Stages using IndexedCollector.T - type of input valueA - type of accumulatorR - type of resultstages - collection of Stagescollector - reducer which is used for combining Stage results into one valueStage with accumulated resultIndexedCollectorpublic static <A,T,R> Stage<R> collect(List<? extends Stage<? extends T>> stages, CollectListener<T,A,R> listener, IndexedCollector<T,A,R> collector)
Stage.listener - calls CollectListener.onCollectResult(Object) with every Stage resultcollect(List, IndexedCollector)public static <T> Stage<List<T>> toList(Stage<? extends T> stage1)
toList(Stage[])public static <T> Stage<List<T>> toList(Stage<? extends T> stage1, Stage<? extends T> stage2)
toList(Stage[])@SafeVarargs public static <T> Stage<List<T>> toList(Stage<? extends T>... stages)
toList(Stage[])public static <T> Stage<List<T>> toList(Stream<? extends Stage<? extends T>> stages)
toList(Stage[])public static <T> Stage<List<T>> toList(List<? extends Stage<? extends T>> stages)
collect(List, IndexedCollector)public static <T> Stage<T[]> toArray(Class<T> type, Stage<? extends T> stage1)
toArray(Class, List)public static <T> Stage<T[]> toArray(Class<T> type, Stage<? extends T> stage1, Stage<? extends T> stage2)
toArray(Class, List)@SafeVarargs public static <T> Stage<T[]> toArray(Class<T> type, Stage<? extends T>... stages)
toArray(Class, List)public static <T> Stage<T[]> toArray(Class<T> type, Stream<? extends Stage<? extends T>> stages)
toArray(Class, List)public static <T> Stage<T[]> toArray(Class<T> type, List<? extends Stage<? extends T>> stages)
collect(List, IndexedCollector)public static <T1,R> Stage<R> toTuple(TupleConstructor1<T1,R> constructor, Stage<? extends T1> stage1)
public static <T1,T2,R> Stage<R> toTuple(TupleConstructor2<T1,T2,R> constructor, Stage<? extends T1> stage1, Stage<? extends T2> stage2)
public static <T1,T2,T3,R> Stage<R> toTuple(TupleConstructor3<T1,T2,T3,R> constructor, Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3)
public static <T1,T2,T3,T4,R> Stage<R> toTuple(TupleConstructor4<T1,T2,T3,T4,R> constructor, Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3, Stage<? extends T4> stage4)
public static <T1,T2,T3,T4,T5,R> Stage<R> toTuple(TupleConstructor5<T1,T2,T3,T4,T5,R> constructor, Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3, Stage<? extends T4> stage4, Stage<? extends T5> stage5)
public static <T1,T2,T3,T4,T5,T6,R> Stage<R> toTuple(TupleConstructor6<T1,T2,T3,T4,T5,T6,R> constructor, Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3, Stage<? extends T4> stage4, Stage<? extends T5> stage5, Stage<? extends T6> stage6)
public static <T1,T2> Stage<Tuple2<T1,T2>> toTuple(Stage<? extends T1> stage1, Stage<? extends T2> stage2)
public static <T1,T2,T3> Stage<Tuple3<T1,T2,T3>> toTuple(Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3)
public static <T1,T2,T3,T4> Stage<Tuple4<T1,T2,T3,T4>> toTuple(Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3, Stage<? extends T4> stage4)
public static <T1,T2,T3,T4,T5> Stage<Tuple5<T1,T2,T3,T4,T5>> toTuple(Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3, Stage<? extends T4> stage4, Stage<? extends T5> stage5)
public static <T1,T2,T3,T4,T5,T6> Stage<Tuple6<T1,T2,T3,T4,T5,T6>> toTuple(Stage<? extends T1> stage1, Stage<? extends T2> stage2, Stage<? extends T3> stage3, Stage<? extends T4> stage4, Stage<? extends T5> stage5, Stage<? extends T6> stage6)
public static Stage<Void> runSequence()
runSequence(Iterator)public static Stage<Void> runSequence(AsyncCallable<?> stage)
runSequence(Iterator)public static Stage<Void> runSequence(AsyncCallable<?> stage1, AsyncCallable<?> stage2)
runSequence(Iterator)public static Stage<Void> runSequence(AsyncCallable<?>... stages)
runSequence(Iterator)public static Stage<Void> runSequence(AsyncCallable<?> stage1, AsyncCallable<?> stage2, AsyncCallable<?> stage3)
runSequence(Iterator)public static Stage<Void> runSequence(Stream<? extends AsyncCallable<?>> stages)
public static Stage<Void> runSequence(Iterable<? extends AsyncCallable<?>> stages)
runSequence(Iterator)public static Stage<Void> runSequence(Iterator<? extends AsyncCallable<?>> stages)
Stage from stages in sequence.Stage that completes when all stages are completedpublic static <T,A,R> Stage<R> collectSequence(Stream<AsyncCallable<? extends T>> stages, Collector<T,A,R> collector)
collectSequence(Iterator, Collector)public static <T,A,R> Stage<R> collectSequence(Iterable<? extends AsyncCallable<? extends T>> stages, Collector<T,A,R> collector)
collectSequence(Iterator, Collector)public static <T,A,R> Stage<R> collectSequence(Iterator<? extends AsyncCallable<? extends T>> stages, Collector<T,A,R> collector)
Stage results into one final using Collector sequentiallyStage that completes when all stages are completedCollector@SafeVarargs public static <T> Stage<T> firstSuccessful(AsyncCallable<? extends T>... stages)
Stage that was completed normallyfirst(Iterator, BiPredicate)public static <T> Stage<T> firstSuccessful(Stream<AsyncCallable<? extends T>> stages)
public static <T> Stage<T> firstSuccessful(Iterable<? extends AsyncCallable<? extends T>> stages)
Stage that was completed normallyfirst(Iterator, BiPredicate)public static <T> Stage<T> firstSuccessful(Iterator<? extends AsyncCallable<? extends T>> stages)
Stage that was completed normallyfirst(Iterator, BiPredicate)public static <T> Stage<T> first(Stream<? extends AsyncCallable<? extends T>> stages, BiPredicate<? super T,? super Throwable> predicate)
public static <T> Stage<T> first(Iterable<? extends AsyncCallable<? extends T>> stages, BiPredicate<? super T,? super Throwable> predicate)
first(Iterator, BiPredicate)public static <T> Stage<T> first(Iterator<? extends AsyncCallable<? extends T>> stages, BiPredicate<? super T,? super Throwable> predicate)
predicate - for filtering results, consumes result of StageStage that satisfies predicatepublic static <T> Iterable<Stage<T>> iterable(Iterable<? extends AsyncCallable<? extends T>> callables)
public static <T> Iterator<Stage<T>> iterator(Iterator<? extends AsyncCallable<? extends T>> callables)
callables - Iterator over AsyncCallableCopyright © 2019. All rights reserved.