diff --git a/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java b/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java index 0b2b97cf..e181c5a3 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java @@ -683,15 +683,15 @@ public Cffu> mostTupleOfSuccess( * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function)} * except for the fast-fail behavior. * * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyFastFailAsync( + public Cffu> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2) { - return create(CompletableFutureUtils.allTupleOfThenMApplyFastFailAsync(cf, fn1, fn2)); + return create(CompletableFutureUtils.thenTupleMApplyFastFailAsync(cf, fn1, fn2)); } /** @@ -701,16 +701,16 @@ public Cffu> allTupleOfThenMApplyFastFailAsync( * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyFastFailAsync( + public Cffu> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3) { - return create(CompletableFutureUtils.allTupleOfThenMApplyFastFailAsync(cf, fn1, fn2, fn3)); + return create(CompletableFutureUtils.thenTupleMApplyFastFailAsync(cf, fn1, fn2, fn3)); } /** @@ -720,17 +720,17 @@ public Cffu> allTupleOfThenMApplyFastFailAsyn * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyFastFailAsync( + public Cffu> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4) { - return create(CompletableFutureUtils.allTupleOfThenMApplyFastFailAsync(cf, fn1, fn2, fn3, fn4)); + return create(CompletableFutureUtils.thenTupleMApplyFastFailAsync(cf, fn1, fn2, fn3, fn4)); } /** @@ -740,17 +740,17 @@ public Cffu> allTupleOfThenMApplyFast * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyFastFailAsync( + public Cffu> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { - return create(CompletableFutureUtils.allTupleOfThenMApplyFastFailAsync(cf, fn1, fn2, fn3, fn4, fn5)); + return create(CompletableFutureUtils.thenTupleMApplyFastFailAsync(cf, fn1, fn2, fn3, fn4, fn5)); } /** @@ -763,10 +763,10 @@ public Cffu> allTupleOfThenMA * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyAsync( + public Cffu> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2) { - return create(CompletableFutureUtils.allTupleOfThenMApplyAsync(cf, fn1, fn2)); + return create(CompletableFutureUtils.thenTupleMApplyAsync(cf, fn1, fn2)); } /** @@ -779,10 +779,10 @@ public Cffu> allTupleOfThenMApplyAsync( * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyAsync( + public Cffu> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3) { - return create(CompletableFutureUtils.allTupleOfThenMApplyAsync(cf, fn1, fn2, fn3)); + return create(CompletableFutureUtils.thenTupleMApplyAsync(cf, fn1, fn2, fn3)); } /** @@ -795,11 +795,11 @@ public Cffu> allTupleOfThenMApplyAsync( * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyAsync( + public Cffu> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4) { - return create(CompletableFutureUtils.allTupleOfThenMApplyAsync(cf, fn1, fn2, fn3, fn4)); + return create(CompletableFutureUtils.thenTupleMApplyAsync(cf, fn1, fn2, fn3, fn4)); } /** @@ -812,11 +812,11 @@ public Cffu> allTupleOfThenMApplyAsyn * @return the new Cffu */ @Contract(pure = true) - public Cffu> allTupleOfThenMApplyAsync( + public Cffu> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { - return create(CompletableFutureUtils.allTupleOfThenMApplyAsync(cf, fn1, fn2, fn3, fn4, fn5)); + return create(CompletableFutureUtils.thenTupleMApplyAsync(cf, fn1, fn2, fn3, fn4, fn5)); } // endregion diff --git a/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java b/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java index e197e348..33f5d403 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java @@ -1746,15 +1746,15 @@ public static CompletableFuture thenMRunAsync(CompletionStage cf, Runna * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2) { - return allTupleOfThenMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2); + return thenTupleMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2); } /** @@ -1763,12 +1763,12 @@ public static CompletableFuture> allTupleOfThenMApply * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Executor, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Executor, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2) { requireNonNull(cf, "cf is null"); @@ -1785,15 +1785,15 @@ public static CompletableFuture> allTupleOfThenMApply * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3) { - return allTupleOfThenMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3); + return thenTupleMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3); } /** @@ -1802,12 +1802,12 @@ public static CompletableFuture> allTupleOfTh * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Executor, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Executor, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2, Function fn3) { requireNonNull(cf, "cf is null"); @@ -1824,16 +1824,16 @@ public static CompletableFuture> allTupleOfTh * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4) { - return allTupleOfThenMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4); + return thenTupleMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4); } /** @@ -1842,12 +1842,12 @@ public static CompletableFuture> allT * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Executor, Function, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Executor, Function, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2, Function fn3, Function fn4) { @@ -1865,16 +1865,16 @@ public static CompletableFuture> allT * (with the given stage's result as the argument to the given functions) * in the same order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Function, Function, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Function, Function, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { - return allTupleOfThenMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4, fn5); + return thenTupleMApplyFastFailAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4, fn5); } /** @@ -1883,12 +1883,12 @@ public static CompletableFuturesame order of the given Functions arguments. *

- * This method is the same as {@link #allTupleOfThenMApplyAsync(CompletionStage, Executor, Function, Function, Function, Function, Function)} + * This method is the same as {@link #thenTupleMApplyAsync(CompletionStage, Executor, Function, Function, Function, Function, Function)} * except for the fast-fail behavior. * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyFastFailAsync( + public static CompletableFuture> thenTupleMApplyFastFailAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { @@ -1908,10 +1908,10 @@ public static CompletableFuture CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2) { - return allTupleOfThenMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2); + return thenTupleMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2); } /** @@ -1922,7 +1922,7 @@ public static CompletableFuture> allTupleOfThenMApply * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2) { requireNonNull(cf, "cf is null"); @@ -1941,10 +1941,10 @@ public static CompletableFuture> allTupleOfThenMApply * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3) { - return allTupleOfThenMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3); + return thenTupleMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3); } /** @@ -1955,7 +1955,7 @@ public static CompletableFuture> allTupleOfTh * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2, Function fn3) { requireNonNull(cf, "cf is null"); @@ -1974,11 +1974,11 @@ public static CompletableFuture> allTupleOfTh * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4) { - return allTupleOfThenMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4); + return thenTupleMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4); } /** @@ -1989,7 +1989,7 @@ public static CompletableFuture> allT * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2, Function fn3, Function fn4) { @@ -2009,11 +2009,11 @@ public static CompletableFuture> allT * * @return the new CompletableFuture */ - public static CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { - return allTupleOfThenMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4, fn5); + return thenTupleMApplyAsync(cf, AsyncPoolHolder.ASYNC_POOL, fn1, fn2, fn3, fn4, fn5); } /** @@ -2024,7 +2024,7 @@ public static CompletableFuture CompletableFuture> allTupleOfThenMApplyAsync( + public static CompletableFuture> thenTupleMApplyAsync( CompletionStage cf, Executor executor, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { diff --git a/cffu-core/src/test/java/io/foldright/cffu/CffuFactoryTest.java b/cffu-core/src/test/java/io/foldright/cffu/CffuFactoryTest.java index 3f4f1b1d..ff68cd8b 100644 --- a/cffu-core/src/test/java/io/foldright/cffu/CffuFactoryTest.java +++ b/cffu-core/src/test/java/io/foldright/cffu/CffuFactoryTest.java @@ -663,7 +663,7 @@ void test_tupleMSupplyAsync() throws Exception { } @Test - void test_allTupleOfThenMApplyAsync() throws Exception { + void test_thenTupleMApplyAsync() throws Exception { final CompletableFuture completed = completedFuture(n); final Function function_n = (x) -> { sleep(100); @@ -687,17 +687,17 @@ void test_allTupleOfThenMApplyAsync() throws Exception { sleep(100); return n+n; }; - assertEquals(Tuple2.of(n, s), cffuFactory.allTupleOfThenMApplyAsync(completed,function_n, function_s).get()); - assertEquals(Tuple2.of(n, s), cffuFactory.allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s).get()); + assertEquals(Tuple2.of(n, s), cffuFactory.thenTupleMApplyAsync(completed,function_n, function_s).get()); + assertEquals(Tuple2.of(n, s), cffuFactory.thenTupleMApplyFastFailAsync(completed,function_n, function_s).get()); - assertEquals(Tuple3.of(n, s, d), cffuFactory.allTupleOfThenMApplyAsync(completed,function_n, function_s, function_d).get()); - assertEquals(Tuple3.of(n, s, d), cffuFactory.allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s, function_d).get()); + assertEquals(Tuple3.of(n, s, d), cffuFactory.thenTupleMApplyAsync(completed,function_n, function_s, function_d).get()); + assertEquals(Tuple3.of(n, s, d), cffuFactory.thenTupleMApplyFastFailAsync(completed,function_n, function_s, function_d).get()); - assertEquals(Tuple4.of(n, s, d, anotherN), cffuFactory.allTupleOfThenMApplyAsync(completed,function_n, function_s, function_d, function_an).get()); - assertEquals(Tuple4.of(n, s, d, anotherN), cffuFactory.allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an).get()); + assertEquals(Tuple4.of(n, s, d, anotherN), cffuFactory.thenTupleMApplyAsync(completed,function_n, function_s, function_d, function_an).get()); + assertEquals(Tuple4.of(n, s, d, anotherN), cffuFactory.thenTupleMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an).get()); - assertEquals(Tuple5.of(n, s, d, anotherN, n + n), cffuFactory.allTupleOfThenMApplyAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); - assertEquals(Tuple5.of(n, s, d, anotherN, n + n), cffuFactory.allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); + assertEquals(Tuple5.of(n, s, d, anotherN, n + n), cffuFactory.thenTupleMApplyAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); + assertEquals(Tuple5.of(n, s, d, anotherN, n + n), cffuFactory.thenTupleMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); } //////////////////////////////////////////////////////////////////////////////// diff --git a/cffu-core/src/test/java/io/foldright/cffu/CompletableFutureUtilsTest.java b/cffu-core/src/test/java/io/foldright/cffu/CompletableFutureUtilsTest.java index fbbba3d4..9a5a9e16 100644 --- a/cffu-core/src/test/java/io/foldright/cffu/CompletableFutureUtilsTest.java +++ b/cffu-core/src/test/java/io/foldright/cffu/CompletableFutureUtilsTest.java @@ -788,7 +788,7 @@ void test_tupleMSupplyAsync() throws Exception { @Test - void test_allTupleOfThenMApplyAsync() throws Exception { + void test_thenTupleMApplyAsync() throws Exception { final CompletableFuture completed = completedFuture(n); final Function function_n = (x) -> { sleep(100); @@ -812,17 +812,17 @@ void test_allTupleOfThenMApplyAsync() throws Exception { sleep(100); return n+n; }; - assertEquals(Tuple2.of(n, s), allTupleOfThenMApplyAsync(completed,function_n, function_s).get()); - assertEquals(Tuple2.of(n, s), allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s).get()); + assertEquals(Tuple2.of(n, s), thenTupleMApplyAsync(completed,function_n, function_s).get()); + assertEquals(Tuple2.of(n, s), thenTupleMApplyFastFailAsync(completed,function_n, function_s).get()); - assertEquals(Tuple3.of(n, s, d), allTupleOfThenMApplyAsync(completed,function_n, function_s, function_d).get()); - assertEquals(Tuple3.of(n, s, d), allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s, function_d).get()); + assertEquals(Tuple3.of(n, s, d), thenTupleMApplyAsync(completed,function_n, function_s, function_d).get()); + assertEquals(Tuple3.of(n, s, d), thenTupleMApplyFastFailAsync(completed,function_n, function_s, function_d).get()); - assertEquals(Tuple4.of(n, s, d, anotherN), allTupleOfThenMApplyAsync(completed,function_n, function_s, function_d, function_an).get()); - assertEquals(Tuple4.of(n, s, d, anotherN), allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an).get()); + assertEquals(Tuple4.of(n, s, d, anotherN), thenTupleMApplyAsync(completed,function_n, function_s, function_d, function_an).get()); + assertEquals(Tuple4.of(n, s, d, anotherN), thenTupleMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an).get()); - assertEquals(Tuple5.of(n, s, d, anotherN, n + n), allTupleOfThenMApplyAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); - assertEquals(Tuple5.of(n, s, d, anotherN, n + n), allTupleOfThenMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); + assertEquals(Tuple5.of(n, s, d, anotherN, n + n), thenTupleMApplyAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); + assertEquals(Tuple5.of(n, s, d, anotherN, n + n), thenTupleMApplyFastFailAsync(completed,function_n, function_s, function_d, function_an, function_nn).get()); } @Test