Skip to content

Commit

Permalink
refactor: add covariance/out modifier to allTupleOf* extension me…
Browse files Browse the repository at this point in the history
…thods 🧬 🍩
  • Loading branch information
oldratlee committed May 5, 2024
1 parent 8ba17fd commit 796b255
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ fun <T, U, V> CompletionStage<out T>.thenCombineFastFailAsync(
* @see allResultsOfCompletableFuture
* @see CompletableFuture.allOf
*/
fun <T1, T2> CompletionStage<T1>.allTupleOf(cf2: CompletionStage<T2>): CompletableFuture<Tuple2<T1, T2>> =
fun <T1, T2> CompletionStage<out T1>.allTupleOf(cf2: CompletionStage<out T2>): CompletableFuture<Tuple2<T1, T2>> =
CompletableFutureUtils.allTupleOf(this, cf2)

/**
Expand All @@ -476,7 +476,7 @@ fun <T1, T2> CompletionStage<T1>.allTupleOf(cf2: CompletionStage<T2>): Completab
* @see allResultsOfFastFailCompletableFuture
* @see CompletableFutureUtils.allOfFastFail
*/
fun <T1, T2> CompletionStage<T1>.allTupleOfFastFail(cf2: CompletionStage<T2>): CompletableFuture<Tuple2<T1, T2>> =
fun <T1, T2> CompletionStage<out T1>.allTupleOfFastFail(cf2: CompletionStage<out T2>): CompletableFuture<Tuple2<T1, T2>> =
CompletableFutureUtils.allTupleOfFastFail(this, cf2)

/**
Expand All @@ -490,8 +490,8 @@ fun <T1, T2> CompletionStage<T1>.allTupleOfFastFail(cf2: CompletionStage<T2>): C
* @see allResultsOfCompletableFuture
* @see CompletableFuture.allOf
*/
fun <T1, T2, T3> CompletionStage<T1>.allTupleOf(
cf2: CompletionStage<T2>, cf3: CompletionStage<T3>
fun <T1, T2, T3> CompletionStage<out T1>.allTupleOf(
cf2: CompletionStage<out T2>, cf3: CompletionStage<out T3>
): CompletableFuture<Tuple3<T1, T2, T3>> =
CompletableFutureUtils.allTupleOf(this, cf2, cf3)

Expand All @@ -507,8 +507,8 @@ fun <T1, T2, T3> CompletionStage<T1>.allTupleOf(
* @see allResultsOfFastFailCompletableFuture
* @see CompletableFutureUtils.allOfFastFail
*/
fun <T1, T2, T3> CompletionStage<T1>.allTupleOfFastFail(
cf2: CompletionStage<T2>, cf3: CompletionStage<T3>
fun <T1, T2, T3> CompletionStage<out T1>.allTupleOfFastFail(
cf2: CompletionStage<out T2>, cf3: CompletionStage<out T3>
): CompletableFuture<Tuple3<T1, T2, T3>> =
CompletableFutureUtils.allTupleOfFastFail(this, cf2, cf3)

Expand All @@ -523,8 +523,8 @@ fun <T1, T2, T3> CompletionStage<T1>.allTupleOfFastFail(
* @see allResultsOfCompletableFuture
* @see CompletableFuture.allOf
*/
fun <T1, T2, T3, T4> CompletionStage<T1>.allTupleOf(
cf2: CompletionStage<T2>, cf3: CompletionStage<T3>, cf4: CompletionStage<T4>
fun <T1, T2, T3, T4> CompletionStage<out T1>.allTupleOf(
cf2: CompletionStage<out T2>, cf3: CompletionStage<out T3>, cf4: CompletionStage<out T4>
): CompletableFuture<Tuple4<T1, T2, T3, T4>> =
CompletableFutureUtils.allTupleOf(this, cf2, cf3, cf4)

Expand All @@ -540,8 +540,8 @@ fun <T1, T2, T3, T4> CompletionStage<T1>.allTupleOf(
* @see allResultsOfFastFailCompletableFuture
* @see CompletableFutureUtils.allOfFastFail
*/
fun <T1, T2, T3, T4> CompletionStage<T1>.allTupleOfFastFail(
cf2: CompletionStage<T2>, cf3: CompletionStage<T3>, cf4: CompletionStage<T4>
fun <T1, T2, T3, T4> CompletionStage<out T1>.allTupleOfFastFail(
cf2: CompletionStage<out T2>, cf3: CompletionStage<out T3>, cf4: CompletionStage<out T4>
): CompletableFuture<Tuple4<T1, T2, T3, T4>> =
CompletableFutureUtils.allTupleOfFastFail(this, cf2, cf3, cf4)

Expand All @@ -556,9 +556,9 @@ fun <T1, T2, T3, T4> CompletionStage<T1>.allTupleOfFastFail(
* @see allResultsOfCompletableFuture
* @see CompletableFuture.allOf
*/
fun <T1, T2, T3, T4, T5> CompletionStage<T1>.allTupleOf(
cf2: CompletionStage<T2>, cf3: CompletionStage<T3>,
cf4: CompletionStage<T4>, cf5: CompletionStage<T5>
fun <T1, T2, T3, T4, T5> CompletionStage<out T1>.allTupleOf(
cf2: CompletionStage<out T2>, cf3: CompletionStage<out T3>,
cf4: CompletionStage<out T4>, cf5: CompletionStage<out T5>
): CompletableFuture<Tuple5<T1, T2, T3, T4, T5>> =
CompletableFutureUtils.allTupleOf(this, cf2, cf3, cf4, cf5)

Expand All @@ -574,9 +574,9 @@ fun <T1, T2, T3, T4, T5> CompletionStage<T1>.allTupleOf(
* @see allResultsOfFastFailCompletableFuture
* @see CompletableFutureUtils.allOfFastFail
*/
fun <T1, T2, T3, T4, T5> CompletionStage<T1>.allTupleOfFastFail(
cf2: CompletionStage<T2>, cf3: CompletionStage<T3>,
cf4: CompletionStage<T4>, cf5: CompletionStage<T5>
fun <T1, T2, T3, T4, T5> CompletionStage<out T1>.allTupleOfFastFail(
cf2: CompletionStage<out T2>, cf3: CompletionStage<out T3>,
cf4: CompletionStage<out T4>, cf5: CompletionStage<out T5>
): CompletableFuture<Tuple5<T1, T2, T3, T4, T5>> =
CompletableFutureUtils.allTupleOfFastFail(this, cf2, cf3, cf4, cf5)

Expand Down

0 comments on commit 796b255

Please sign in to comment.