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 c6ad92e..eb67495 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 @@ -89,62 +89,50 @@ public final class BranchUtil { * Creates a {@code BranchUtil} instance to evaluate a logical OR operation on the provided * boolean expressions. * - * @param booleans the boolean expressions to be evaluated - * @param the type of the result to be handled by the methods + * @param values the boolean expressions to be evaluated + * @param the type of the result to be handled by the methods * @return a {@code BranchUtil} instance representing the result of the logical OR operation */ - public static BranchUtil or(Boolean... booleans) { - var result = Arrays.stream(booleans) - .filter(Objects::nonNull) - .anyMatch(Boolean::booleanValue); - return new BranchUtil<>(result); + public static BranchUtil or(Boolean... values) { + return new BranchUtil<>(BoolUtil.or(values)); } /** * Creates a {@code BranchUtil} instance to evaluate a logical AND operation on the provided * boolean expressions. * - * @param booleans the boolean expressions to be evaluated - * @param the type of the result to be handled by the methods + * @param values the boolean expressions to be evaluated + * @param the type of the result to be handled by the methods * @return a {@code BranchUtil} instance representing the result of the logical AND operation */ - public static BranchUtil and(Boolean... booleans) { - var result = Arrays.stream(booleans) - .filter(Objects::nonNull) - .allMatch(Boolean::booleanValue); - return new BranchUtil<>(result); + public static BranchUtil and(Boolean... values) { + return new BranchUtil<>(BoolUtil.and(values)); } /** * Creates a {@code BranchUtil} instance to evaluate a logical OR operation on the provided * boolean suppliers. * - * @param booleanSuppliers the boolean suppliers to be evaluated - * @param the type of the result to be handled by the methods + * @param valueSuppliers the boolean suppliers to be evaluated + * @param the type of the result to be handled by the methods * @return a {@code BranchUtil} instance representing the result of the * logical OR operation */ - public static BranchUtil or(BooleanSupplier... booleanSuppliers) { - var result = Arrays.stream(booleanSuppliers) - .filter(Objects::nonNull) - .anyMatch(BooleanSupplier::getAsBoolean); - return new BranchUtil<>(result); + public static BranchUtil or(BooleanSupplier... valueSuppliers) { + return new BranchUtil<>(BoolUtil.or(valueSuppliers)); } /** * Creates a {@code BranchUtil} instance to evaluate a logical AND operation on the provided * boolean suppliers. * - * @param booleanSuppliers the boolean suppliers to be evaluated - * @param the type of the result to be handled by the methods + * @param valueSuppliers the boolean suppliers to be evaluated + * @param the type of the result to be handled by the methods * @return a {@code BranchUtil} instance representing the result of the * logical AND operation */ - public static BranchUtil and(BooleanSupplier... booleanSuppliers) { - var result = Arrays.stream(booleanSuppliers) - .filter(Objects::nonNull) - .allMatch(BooleanSupplier::getAsBoolean); - return new BranchUtil<>(result); + public static BranchUtil and(BooleanSupplier... valueSuppliers) { + return new BranchUtil<>(BoolUtil.and(valueSuppliers)); } /**