docs: optimised docs

This commit is contained in:
siujamo
2025-05-22 11:57:27 +08:00
parent 48714e599a
commit 7abb6954d0
@@ -136,20 +136,20 @@ public final class BranchUtil {
* Handles the result of the boolean expressions by executing the appropriate handler based * Handles the result of the boolean expressions by executing the appropriate handler based
* on the result. * on the result.
* <p> * <p>
* If the result is {@code true}, the {@code trueHandler} is executed. If the result is * If the result is {@code true}, the {@code trueSupplier} is executed. If the result is
* {@code false} and an {@code falseSupplier} is provided, it is executed. * {@code false} and an {@code falseSupplier} is provided, it is executed.
* <p> * <p>
* Returns the result of the executed handler. * Returns the result of the executed supplier.
* *
* @param <T> the type of the result to be handled by the methods * @param <T> 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 trueSupplier the supplier to be executed if the result is {@code true}
* @param falseSupplier the handler to be executed if the result is {@code false} (optional) * @param falseSupplier the supplier to be executed if the result is {@code false} (optional)
* @return the result of the executed handler, or {@code null} if no {@code falseSupplier} is * @return the result of the executed supplier, or {@code null} if no {@code falseSupplier} is
* provided and the result of the evaluation is {@code false} * provided and the result of the evaluation is {@code false}
*/ */
public <T> T thenSupply(Supplier<T> trueHandler, Supplier<T> falseSupplier) { public <T> T thenSupply(Supplier<T> trueSupplier, Supplier<T> falseSupplier) {
if (this.result && Objects.nonNull(trueHandler)) { if (this.result && Objects.nonNull(trueSupplier)) {
return trueHandler.get(); return trueSupplier.get();
} }
if (Objects.isNull(falseSupplier)) { if (Objects.isNull(falseSupplier)) {
@@ -166,7 +166,7 @@ public final class BranchUtil {
* Returns the result of the executed handler. * Returns the result of the executed handler.
* *
* @param <T> the type of the result to be handled by the methods * @param <T> the type of the result to be handled by the methods
* @param trueSupplier the handler to be executed if the result is {@code true} * @param trueSupplier the supplier 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> T thenSupply(Supplier<T> trueSupplier) { public <T> T thenSupply(Supplier<T> trueSupplier) {
@@ -212,8 +212,8 @@ public final class BranchUtil {
* <b>Note:</b> {@link BranchUtil} is not responsible for getting a raw boolean result, consider use * <b>Note:</b> {@link BranchUtil} is not responsible for getting a raw boolean result, consider use
* {@link BoolUtil} to replace. * {@link BoolUtil} to replace.
* *
* @see BoolUtil
* @return the result * @return the result
* @see BoolUtil
*/ */
@Deprecated(forRemoval = true) @Deprecated(forRemoval = true)
public boolean getResult() { public boolean getResult() {