From 96e8df7fd35741db1321c4953454702d46d41110 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Thu, 2 May 2024 20:34:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20rename=20parameter=20names=20of=20e?= =?UTF-8?q?xtension=20methods=20in=20`CompletableFutureExtensions.kt`=20?= =?UTF-8?q?=F0=9F=8D=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/CompletableFutureExtensions.kt | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/cffu-kotlin/src/main/java/io/foldright/cffu/kotlin/CompletableFutureExtensions.kt b/cffu-kotlin/src/main/java/io/foldright/cffu/kotlin/CompletableFutureExtensions.kt index 4d1a0c64..de4cafff 100644 --- a/cffu-kotlin/src/main/java/io/foldright/cffu/kotlin/CompletableFutureExtensions.kt +++ b/cffu-kotlin/src/main/java/io/foldright/cffu/kotlin/CompletableFutureExtensions.kt @@ -345,9 +345,9 @@ fun CompletionStage<*>.runAfterBothFastFailAsync( * @see CompletableFuture.thenAcceptBoth */ fun CompletionStage.thenAcceptBothFastFail( - cf2: CompletionStage, action: BiConsumer + other: CompletionStage, action: BiConsumer ): CompletableFuture = - CompletableFutureUtils.thenAcceptBothFastFail(this, cf2, action) + CompletableFutureUtils.thenAcceptBothFastFail(this, other, action) /** * Returns a new CompletableFuture that, when tow given stage both complete normally, @@ -364,9 +364,9 @@ fun CompletionStage.thenAcceptBothFastFail( * @see CompletableFuture.thenAcceptBothAsync */ fun CompletionStage.thenAcceptBothFastFailAsync( - cf2: CompletionStage, action: BiConsumer + other: CompletionStage, action: BiConsumer ): CompletableFuture = - CompletableFutureUtils.thenAcceptBothFastFailAsync(this, cf2, action) + CompletableFutureUtils.thenAcceptBothFastFailAsync(this, other, action) /** * Returns a new CompletableFuture that, when tow given stage both complete normally, @@ -383,9 +383,9 @@ fun CompletionStage.thenAcceptBothFastFailAsync( * @see CompletableFuture.thenAcceptBothAsync */ fun CompletionStage.thenAcceptBothFastFailAsync( - cf2: CompletionStage, action: BiConsumer, executor: Executor + other: CompletionStage, action: BiConsumer, executor: Executor ): CompletableFuture = - CompletableFutureUtils.thenAcceptBothFastFailAsync(this, cf2, action, executor) + CompletableFutureUtils.thenAcceptBothFastFailAsync(this, other, action, executor) /** * Returns a new CompletableFuture that, when tow given stage both complete normally, @@ -401,9 +401,9 @@ fun CompletionStage.thenAcceptBothFastFailAsync( * @see CompletableFuture.thenCombine */ fun CompletionStage.thenCombineFastFail( - cf2: CompletionStage, fn: BiFunction + other: CompletionStage, fn: BiFunction ): CompletableFuture = - CompletableFutureUtils.thenCombineFastFail(this, cf2, fn) + CompletableFutureUtils.thenCombineFastFail(this, other, fn) /** * Returns a new CompletableFuture that, when tow given stage both complete normally, @@ -420,9 +420,9 @@ fun CompletionStage.thenCombineFastFail( * @see CompletableFuture.thenCombineAsync */ fun CompletionStage.thenCombineFastFailAsync( - cf2: CompletionStage, fn: BiFunction + other: CompletionStage, fn: BiFunction ): CompletableFuture = - CompletableFutureUtils.thenCombineFastFailAsync(this, cf2, fn) + CompletableFutureUtils.thenCombineFastFailAsync(this, other, fn) /** * Returns a new CompletableFuture that, when tow given stage both complete normally, @@ -439,9 +439,9 @@ fun CompletionStage.thenCombineFastFailAsync( * @see CompletableFuture.thenCombineAsync */ fun CompletionStage.thenCombineFastFailAsync( - cf2: CompletionStage, fn: BiFunction, executor: Executor + other: CompletionStage, fn: BiFunction, executor: Executor ): CompletableFuture = - CompletableFutureUtils.thenCombineFastFailAsync(this, cf2, fn, executor) + CompletableFutureUtils.thenCombineFastFailAsync(this, other, fn, executor) //////////////////////////////////////// //# allTupleOf* methods @@ -601,8 +601,8 @@ fun CompletionStage.allTupleOfFastFail( * @return the new CompletableFuture * @see CompletableFuture.runAfterEither */ -fun CompletionStage<*>.runAfterEitherSuccess(cf2: CompletionStage<*>, action: Runnable): CompletableFuture = - CompletableFutureUtils.runAfterEitherSuccess(this, cf2, action) +fun CompletionStage<*>.runAfterEitherSuccess(other: CompletionStage<*>, action: Runnable): CompletableFuture = + CompletableFutureUtils.runAfterEitherSuccess(this, other, action) /** * Returns a new CompletableFuture that, when either given stage success, executes the given action @@ -618,8 +618,10 @@ fun CompletionStage<*>.runAfterEitherSuccess(cf2: CompletionStage<*>, action: Ru * @return the new CompletableFuture * @see CompletableFuture.runAfterEitherAsync */ -fun CompletionStage<*>.runAfterEitherSuccessAsync(cf2: CompletionStage<*>, action: Runnable): CompletableFuture = - CompletableFutureUtils.runAfterEitherSuccessAsync(this, cf2, action) +fun CompletionStage<*>.runAfterEitherSuccessAsync( + other: CompletionStage<*>, action: Runnable +): CompletableFuture = + CompletableFutureUtils.runAfterEitherSuccessAsync(this, other, action) /** * Returns a new CompletableFuture that, when either given stage success, executes the given action @@ -636,9 +638,9 @@ fun CompletionStage<*>.runAfterEitherSuccessAsync(cf2: CompletionStage<*>, actio * @see CompletableFuture.runAfterEitherAsync */ fun CompletionStage<*>.runAfterEitherSuccessAsync( - cf2: CompletionStage<*>, action: Runnable, executor: Executor + other: CompletionStage<*>, action: Runnable, executor: Executor ): CompletableFuture = - CompletableFutureUtils.runAfterEitherSuccessAsync(this, cf2, action, executor) + CompletableFutureUtils.runAfterEitherSuccessAsync(this, other, action, executor) /** * Returns a new CompletableFuture that, when either given stage success, @@ -652,9 +654,9 @@ fun CompletionStage<*>.runAfterEitherSuccessAsync( * @see CompletableFuture.acceptEither */ fun CompletionStage.acceptEitherSuccess( - cf2: CompletionStage, action: Consumer + other: CompletionStage, action: Consumer ): CompletableFuture = - CompletableFutureUtils.acceptEitherSuccess(this, cf2, action) + CompletableFutureUtils.acceptEitherSuccess(this, other, action) /** * Returns a new CompletionStage that, when either given stage success, @@ -669,9 +671,9 @@ fun CompletionStage.acceptEitherSuccess( * @see CompletableFuture.acceptEitherAsync */ fun CompletionStage.acceptEitherSuccessAsync( - cf2: CompletionStage, action: Consumer + other: CompletionStage, action: Consumer ): CompletableFuture = - CompletableFutureUtils.acceptEitherSuccessAsync(this, cf2, action) + CompletableFutureUtils.acceptEitherSuccessAsync(this, other, action) /** * Returns a new CompletionStage that, when either given stage success, @@ -686,9 +688,9 @@ fun CompletionStage.acceptEitherSuccessAsync( * @see CompletableFuture.acceptEitherAsync */ fun CompletionStage.acceptEitherSuccessAsync( - cf2: CompletionStage, action: Consumer, executor: Executor + other: CompletionStage, action: Consumer, executor: Executor ): CompletableFuture = - CompletableFutureUtils.acceptEitherSuccessAsync(this, cf2, action, executor) + CompletableFutureUtils.acceptEitherSuccessAsync(this, other, action, executor) /** * Returns a new CompletionStage that, when either given stage success, @@ -703,9 +705,9 @@ fun CompletionStage.acceptEitherSuccessAsync( * @see CompletableFuture.applyToEither */ fun CompletionStage.applyToEitherSuccess( - cf2: CompletionStage, fn: Function + other: CompletionStage, fn: Function ): CompletableFuture = - CompletableFutureUtils.applyToEitherSuccess(this, cf2, fn) + CompletableFutureUtils.applyToEitherSuccess(this, other, fn) /** * Returns a new CompletionStage that, when either given stage success, @@ -721,9 +723,9 @@ fun CompletionStage.applyToEitherSuccess( * @see CompletableFuture.applyToEitherAsync */ fun CompletionStage.applyToEitherSuccessAsync( - cf2: CompletionStage, fn: Function + other: CompletionStage, fn: Function ): CompletableFuture = - CompletableFutureUtils.applyToEitherSuccessAsync(this, cf2, fn) + CompletableFutureUtils.applyToEitherSuccessAsync(this, other, fn) /** * Returns a new CompletionStage that, when either given stage success, @@ -739,9 +741,9 @@ fun CompletionStage.applyToEitherSuccessAsync( * @see CompletableFuture.applyToEitherAsync */ fun CompletionStage.applyToEitherSuccessAsync( - cf2: CompletionStage, fn: Function, executor: Executor + other: CompletionStage, fn: Function, executor: Executor ): CompletableFuture = - CompletableFutureUtils.applyToEitherSuccessAsync(this, cf2, fn, executor) + CompletableFutureUtils.applyToEitherSuccessAsync(this, other, fn, executor) //////////////////////////////////////////////////////////////////////////////// //# New enhanced methods