Skip to content

Commit

Permalink
refactor: reorder methods allTupleOf* methods, consistent with othe…
Browse files Browse the repository at this point in the history
…r methods 💅
  • Loading branch information
oldratlee committed Jun 24, 2024
1 parent 8362d4e commit 7fa7035
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 92 deletions.
92 changes: 46 additions & 46 deletions cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -541,21 +541,6 @@ public <T1, T2> Cffu<Tuple2<T1, T2>> allTupleOfFastFail(
return create(CompletableFutureUtils.allTupleOfFastFail(cf1, cf2));
}

/**
* Returns a new Cffu that is completed when the given two stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new Cffu that is completed when the given two stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public <T1, T2> Cffu<Tuple2<T1, T2>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) {
return create(CompletableFutureUtils.allTupleOf(cf1, cf2));
}

/**
* Returns a new Cffu that is successful when the given three stages success.
* If any of the given stages complete exceptionally, then the returned Cffu also does so
Expand All @@ -574,21 +559,6 @@ public <T1, T2, T3> Cffu<Tuple3<T1, T2, T3>> allTupleOfFastFail(
return create(CompletableFutureUtils.allTupleOfFastFail(cf1, cf2, cf3));
}

/**
* Returns a new Cffu that is completed when the given three stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new Cffu that is completed when the given three stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public <T1, T2, T3> Cffu<Tuple3<T1, T2, T3>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) {
return create(CompletableFutureUtils.allTupleOf(cf1, cf2, cf3));
}

/**
* Returns a new Cffu that is successful when the given four stages success.
* If any of the given stages complete exceptionally, then the returned Cffu also does so
Expand All @@ -608,22 +578,6 @@ public <T1, T2, T3, T4> Cffu<Tuple4<T1, T2, T3, T4>> allTupleOfFastFail(
return create(CompletableFutureUtils.allTupleOfFastFail(cf1, cf2, cf3, cf4));
}

/**
* Returns a new Cffu that is completed when the given four stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new Cffu that is completed when the given four stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public <T1, T2, T3, T4> Cffu<Tuple4<T1, T2, T3, T4>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2,
CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) {
return create(CompletableFutureUtils.allTupleOf(cf1, cf2, cf3, cf4));
}

/**
* Returns a new Cffu that is successful when the given five stages success.
* If any of the given stages complete exceptionally, then the returned Cffu also does so
Expand All @@ -643,6 +597,52 @@ public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1, T2, T3, T4, T5>> allTupleOfFastFail(
return create(CompletableFutureUtils.allTupleOfFastFail(cf1, cf2, cf3, cf4, cf5));
}

/**
* Returns a new Cffu that is completed when the given two stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new Cffu that is completed when the given two stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public <T1, T2> Cffu<Tuple2<T1, T2>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) {
return create(CompletableFutureUtils.allTupleOf(cf1, cf2));
}

/**
* Returns a new Cffu that is completed when the given three stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new Cffu that is completed when the given three stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public <T1, T2, T3> Cffu<Tuple3<T1, T2, T3>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) {
return create(CompletableFutureUtils.allTupleOf(cf1, cf2, cf3));
}

/**
* Returns a new Cffu that is completed when the given four stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new Cffu that is completed when the given four stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public <T1, T2, T3, T4> Cffu<Tuple4<T1, T2, T3, T4>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2,
CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) {
return create(CompletableFutureUtils.allTupleOf(cf1, cf2, cf3, cf4));
}

/**
* Returns a new Cffu that is completed when the given five stages complete.
* If any of the given stages complete exceptionally, then the returned Cffu also does so,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1088,21 +1088,6 @@ public static <T1, T2> CompletableFuture<Tuple2<T1, T2>> allTupleOfFastFail(
return allTupleOf0(true, requireCfsAndEleNonNull(cf1, cf2));
}

/**
* Returns a new CompletableFuture that is completed when the given two stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new CompletableFuture that is completed when the given two stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public static <T1, T2> CompletableFuture<Tuple2<T1, T2>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) {
return allTupleOf0(false, requireCfsAndEleNonNull(cf1, cf2));
}

/**
* Returns a new CompletableFuture that is successful when the given three stages success.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so
Expand All @@ -1121,21 +1106,6 @@ public static <T1, T2, T3> CompletableFuture<Tuple3<T1, T2, T3>> allTupleOfFastF
return allTupleOf0(true, requireCfsAndEleNonNull(cf1, cf2, cf3));
}

/**
* Returns a new CompletableFuture that is completed when the given three stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new CompletableFuture that is completed when the given three stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public static <T1, T2, T3> CompletableFuture<Tuple3<T1, T2, T3>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) {
return allTupleOf0(false, requireCfsAndEleNonNull(cf1, cf2, cf3));
}

/**
* Returns a new CompletableFuture that is successful when the given four stages success.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so
Expand All @@ -1155,22 +1125,6 @@ public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1, T2, T3, T4>> allTupl
return allTupleOf0(true, requireCfsAndEleNonNull(cf1, cf2, cf3, cf4));
}

/**
* Returns a new CompletableFuture that is completed when the given four stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new CompletableFuture that is completed when the given four stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1, T2, T3, T4>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2,
CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) {
return allTupleOf0(false, requireCfsAndEleNonNull(cf1, cf2, cf3, cf4));
}

/**
* Returns a new CompletableFuture that is successful when the given five stages success.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so
Expand All @@ -1190,6 +1144,52 @@ public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1, T2, T3, T4, T5>>
return allTupleOf0(true, requireCfsAndEleNonNull(cf1, cf2, cf3, cf4, cf5));
}

/**
* Returns a new CompletableFuture that is completed when the given two stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new CompletableFuture that is completed when the given two stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public static <T1, T2> CompletableFuture<Tuple2<T1, T2>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) {
return allTupleOf0(false, requireCfsAndEleNonNull(cf1, cf2));
}

/**
* Returns a new CompletableFuture that is completed when the given three stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new CompletableFuture that is completed when the given three stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public static <T1, T2, T3> CompletableFuture<Tuple3<T1, T2, T3>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) {
return allTupleOf0(false, requireCfsAndEleNonNull(cf1, cf2, cf3));
}

/**
* Returns a new CompletableFuture that is completed when the given four stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
* with a CompletionException holding this exception as its cause.
*
* @return a new CompletableFuture that is completed when the given four stages complete
* @throws NullPointerException if any of the given stages are {@code null}
* @see #allResultsOf(CompletionStage[])
*/
@Contract(pure = true)
public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1, T2, T3, T4>> allTupleOf(
CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2,
CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) {
return allTupleOf0(false, requireCfsAndEleNonNull(cf1, cf2, cf3, cf4));
}

/**
* Returns a new CompletableFuture that is completed when the given five stages complete.
* If any of the given stages complete exceptionally, then the returned CompletableFuture also does so,
Expand Down

0 comments on commit 7fa7035

Please sign in to comment.