From 48714e599af9a73ea0f7d5665da2a881d92ad4e2 Mon Sep 17 00:00:00 2001 From: siujamo Date: Thu, 22 May 2025 11:52:51 +0800 Subject: [PATCH] feat: marked `BranchUtil#getResult` as deprecated and for removal in future releases --- .../com/onixbyte/devkit/utils/BranchUtil.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/devkit-utils/src/main/java/com/onixbyte/devkit/utils/BranchUtil.java b/devkit-utils/src/main/java/com/onixbyte/devkit/utils/BranchUtil.java index 8f11a02..158ffe6 100644 --- a/devkit-utils/src/main/java/com/onixbyte/devkit/utils/BranchUtil.java +++ b/devkit-utils/src/main/java/com/onixbyte/devkit/utils/BranchUtil.java @@ -137,14 +137,14 @@ public final class BranchUtil { * on the result. *

* If the result is {@code true}, the {@code trueHandler} is executed. If the result is - * {@code false} and an {@code elseHandler} is provided, it is executed. + * {@code false} and an {@code falseSupplier} is provided, it is executed. *

* Returns the result of the executed handler. * * @param the type of the result to be handled by the methods * @param trueHandler the handler to be executed if the result is {@code true} * @param falseSupplier the handler to be executed if the result is {@code false} (optional) - * @return the result of the executed handler, or {@code null} if no {@code elseHandler} is + * @return the result of the executed handler, or {@code null} if no {@code falseSupplier} is * provided and the result of the evaluation is {@code false} */ public T thenSupply(Supplier trueHandler, Supplier falseSupplier) { @@ -167,8 +167,7 @@ public final class BranchUtil { * * @param the type of the result to be handled by the methods * @param trueSupplier the handler to be executed if the result is {@code true} - * @return the result of the executed handler, or {@code null} if result of evaluation is - * {@code false} + * @return the result of the executed handler, or {@code null} if result of evaluation is {@code false} */ public T thenSupply(Supplier trueSupplier) { return thenSupply(trueSupplier, null); @@ -207,4 +206,18 @@ public final class BranchUtil { then(trueHandler, null); } + /** + * Get the boolean result. + *

+ * Note: {@link BranchUtil} is not responsible for getting a raw boolean result, consider use + * {@link BoolUtil} to replace. + * + * @see BoolUtil + * @return the result + */ + @Deprecated(forRemoval = true) + public boolean getResult() { + return result; + } + }