From 4b75c9f800012cea832fa0120016b2b6f375edcf Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sun, 16 Jun 2024 13:35:48 +0800 Subject: [PATCH] WIP CffuFactory --- .../java/io/foldright/cffu/CffuFactory.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 7515d39a..b2e96b31 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java @@ -303,7 +303,7 @@ public final Cffu[] toCffuArray(CompletionStage... stages) { *

* If you need the successful results of given stages in the given time, prefer below methods: *

    - *
  • {@link #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[])} + *
  • {@link #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[])} *
  • {@link #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage)} *
  • {@link #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage)} *
@@ -314,7 +314,7 @@ public final Cffu[] toCffuArray(CompletionStage... stages) { * @see #allResultsOf(CompletionStage[]) * @see #allTupleOf(CompletionStage, CompletionStage) * @see #allTupleOf(CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage) - * @see #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[]) + * @see #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[]) * @see #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage) * @see #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage) * @see CompletableFutureUtils#allOf(CompletionStage[]) @@ -366,7 +366,7 @@ public final Cffu> allResultsOf(CompletionStage... cfs) *

* If you need the successful results of given stages in the given time, prefer below methods: *

    - *
  • {@link #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[])} + *
  • {@link #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[])} *
  • {@link #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage)} *
  • {@link #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage)} *
@@ -377,7 +377,7 @@ public final Cffu> allResultsOf(CompletionStage... cfs) * @see #allResultsOfFastFail(CompletionStage[]) * @see #allTupleOfFastFail(CompletionStage, CompletionStage) * @see #allTupleOfFastFail(CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage) - * @see #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[]) + * @see #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[]) * @see #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage) * @see #mostTupleOfSuccess(long, TimeUnit, CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage) * @see #allOf(CompletionStage[]) @@ -418,16 +418,16 @@ public final Cffu> allResultsOfFastFail(CompletionStage *

* If the given stage is successful, its result is the completed value; Otherwise the given valueIfNotSuccess. * + * @param valueIfNotSuccess the value to return if not completed successfully * @param timeout how long to wait in units of {@code unit} * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter - * @param valueIfNotSuccess the value to return if not completed successfully * @param cfs the stages * @see Cffu#getSuccessNow(Object) */ @Contract(pure = true) @SafeVarargs public final Cffu> mostResultsOfSuccess( - long timeout, TimeUnit unit, @Nullable T valueIfNotSuccess, CompletionStage... cfs) { + @Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage... cfs) { return create(CompletableFutureUtils.mostResultsOfSuccess( valueIfNotSuccess, defaultExecutor, timeout, unit, cfs)); } @@ -636,7 +636,7 @@ public Cffu> allTupleOfFastFail( * @param timeout how long to wait in units of {@code unit} * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return a new Cffu that is completed when the given two stages complete - * @see #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[]) + * @see #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[]) * @see Cffu#getSuccessNow(Object) */ @Contract(pure = true) @@ -654,7 +654,7 @@ public Cffu> mostTupleOfSuccess( * @param timeout how long to wait in units of {@code unit} * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return a new Cffu that is completed when the given three stages complete - * @see #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[]) + * @see #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[]) * @see Cffu#getSuccessNow(Object) */ @Contract(pure = true) @@ -673,7 +673,7 @@ public Cffu> mostTupleOfSuccess( * @param timeout how long to wait in units of {@code unit} * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return a new Cffu that is completed when the given four stages complete - * @see #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[]) + * @see #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[]) * @see Cffu#getSuccessNow(Object) */ @Contract(pure = true) @@ -693,7 +693,7 @@ public Cffu> mostTupleOfSuccess( * @param timeout how long to wait in units of {@code unit} * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return a new Cffu that is completed when the given five stages complete - * @see #mostResultsOfSuccess(long, TimeUnit, Object, CompletionStage[]) + * @see #mostResultsOfSuccess(Object, long, TimeUnit, CompletionStage[]) * @see Cffu#getSuccessNow(Object) */ @Contract(pure = true)