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 38530b0b..3f432e74 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java @@ -2151,10 +2151,10 @@ public static CompletableFuture the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, long timeout, TimeUnit unit, Function fn1, Function fn2) { - return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2); + return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2); } /** @@ -2176,7 +2176,7 @@ public static CompletableFuture> tupleMApplyMostSucce * @param the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, Executor executor, long timeout, TimeUnit unit, Function fn1, Function fn2) { requireNonNull(executor, "executor is null"); requireNonNull(unit, "unit is null"); @@ -2207,10 +2207,10 @@ public static CompletableFuture> tupleMApplyMostSucce * @param the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, long timeout, TimeUnit unit, Function fn1, Function fn2, Function fn3) { - return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3); + return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3); } /** @@ -2234,7 +2234,7 @@ public static CompletableFuture> tupleMApplyM * @param the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, Executor executor, long timeout, TimeUnit unit, Function fn1, Function fn2, Function fn3) { requireNonNull(executor, "executor is null"); requireNonNull(unit, "unit is null"); @@ -2267,10 +2267,10 @@ public static CompletableFuture> tupleMApplyM * @param the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, long timeout, TimeUnit unit, Function fn1, Function fn2, Function fn3, Function fn4) { - return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4); + return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4); } /** @@ -2296,7 +2296,7 @@ public static CompletableFuture> tupl * @param the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, Executor executor, long timeout, TimeUnit unit, Function fn1, Function fn2, Function fn3, Function fn4) { requireNonNull(executor, "executor is null"); @@ -2332,11 +2332,11 @@ public static CompletableFuture> tupl * @param the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, long timeout, TimeUnit unit, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { - return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4, fn5); + return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4, fn5); } /** @@ -2364,7 +2364,7 @@ public static CompletableFuture the function return type * @return the new CompletableFuture */ - public static CompletableFuture> tupleMApplyMostSuccessAsync( + public static CompletableFuture> thenTupleMApplyMostSuccessAsync( CompletionStage cf, Executor executor, long timeout, TimeUnit unit, Function fn1, Function fn2, Function fn3, Function fn4, Function fn5) { 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 045adc02..78e5f36c 100644 --- a/cffu-core/src/test/java/io/foldright/cffu/CompletableFutureUtilsTest.java +++ b/cffu-core/src/test/java/io/foldright/cffu/CompletableFutureUtilsTest.java @@ -848,17 +848,17 @@ void test_tupleMApplyMostSuccessAsync() throws Exception { sleep(100); return n + n; }; - assertEquals(Tuple2.of(n, s), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s).get()); - assertEquals(Tuple2.of(n, s), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s).get()); + assertEquals(Tuple2.of(n, s), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s).get()); + assertEquals(Tuple2.of(n, s), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s).get()); - assertEquals(Tuple3.of(n, s, d), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get()); - assertEquals(Tuple3.of(n, s, d), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get()); + assertEquals(Tuple3.of(n, s, d), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get()); + assertEquals(Tuple3.of(n, s, d), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get()); - assertEquals(Tuple4.of(n, s, d, anotherN), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get()); - assertEquals(Tuple4.of(n, s, d, anotherN), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get()); + assertEquals(Tuple4.of(n, s, d, anotherN), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get()); + assertEquals(Tuple4.of(n, s, d, anotherN), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get()); - assertEquals(Tuple5.of(n, s, d, anotherN, n + n), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get()); - assertEquals(Tuple5.of(n, s, d, anotherN, n + n), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get()); + assertEquals(Tuple5.of(n, s, d, anotherN, n + n), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get()); + assertEquals(Tuple5.of(n, s, d, anotherN, n + n), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get()); } @Test