From 373fbf90831ca0d10232b0388384f13e15dde668 Mon Sep 17 00:00:00 2001
From: Zihlu Wang tag between 2 paragraphs.
---
.../codecrafters/devkit/utils/Base64Util.java | 4 ++++
.../codecrafters/devkit/utils/BranchUtil.java | 17 +++++++++++++++--
.../devkit/utils/ChainedCalcUtil.java | 5 +++++
.../org/codecrafters/devkit/utils/HashUtil.java | 5 +++++
.../org/codecrafters/devkit/utils/MapUtil.java | 3 +++
.../codecrafters/devkit/utils/package-info.java | 1 +
.../exceptions/NotImplementedException.java | 5 +++++
7 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/Base64Util.java b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/Base64Util.java
index e1e9ccc..eff3ca7 100644
--- a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/Base64Util.java
+++ b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/Base64Util.java
@@ -29,10 +29,12 @@ import java.util.Base64;
* Java standard library for performing the encoding and decoding operations.
* This utility class offers convenient methods to encode and decode strings
* with different character sets.
+ *
* This class is designed as a final class with a private constructor to
* prevent instantiation. All methods in this class are static, allowing easy
* access to the Base64 encoding and decoding functionality.
+ *
* Example usage:
*
@@ -46,10 +48,12 @@ import java.util.Base64;
* String decoded = Base64Util.decode(encoded);
* System.out.println("Decoded string: " + decoded);
*
+ *
* Note: This utility class uses the default charset (UTF-8) if no * specific charset is provided. It is recommended to specify the charset * explicitly to ensure consistent encoding and decoding. + *
* * @author Zihlu Wang * @version 1.0.0 diff --git a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/BranchUtil.java b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/BranchUtil.java index 839acb1..9019414 100644 --- a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/BranchUtil.java +++ b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/BranchUtil.java @@ -29,10 +29,12 @@ import java.util.function.Supplier; * in Java development by leveraging lambda expressions. It offers convenient * methods to replace verbose if...else statements with more concise and * expressive functional constructs. + * ** Developers can use the methods in this utility class to streamline their * code, enhance readability, and promote a more functional style of * programming when dealing with branching logic and conditional statements. + *
** Example: *
@@ -64,11 +66,12 @@ import java.util.function.Supplier; * // do something * }); *- * + * + *
* Note: * The {@link #and(Boolean...)} and {@link #or(Boolean...)} methods accept any * number of boolean expressions. - *
+ *
* * @param* Handles the result of the boolean expressions by executing the * appropriate handler based on the result. + *
** If the result is {@code true}, the {@code ifHandler} is executed. If the * result is {@code false} and an {@code elseHandler} is provided, it is * executed. + *
** Returns the result of the executed handler. + *
* * @param ifHandler the handler to be executed if the result is * {@code true} @@ -190,10 +197,13 @@ public final class BranchUtil* Handles the result of the boolean expressions by executing the provided * handler if the result is {@code true}. + *
** Returns the result of the executed handler. + *
* * @param ifHandler the handler to be executed if the result is * {@code true} @@ -204,12 +214,15 @@ public final class BranchUtil* Handles the result of the boolean expressions by executing the * appropriate handler based on the result. + *
** If the result is {@code true}, the {@code ifHandler} is executed. If the * result is {@code false} and an {@code elseHandler} is provided, it is * executed. + *
* * @param ifHandler the handler to be executed if the result is * {@code true} diff --git a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/ChainedCalcUtil.java b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/ChainedCalcUtil.java index 07b8f6f..3c1651d 100644 --- a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/ChainedCalcUtil.java +++ b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/ChainedCalcUtil.java @@ -24,7 +24,9 @@ import java.util.function.BiFunction; import java.util.function.Function; /** + ** Utility class for chained high-precision calculations using BigDecimal. + *
** The ChainedCalcUtil class provides a convenient way to perform chained * high-precision calculations using BigDecimal. It allows users to perform @@ -32,6 +34,7 @@ import java.util.function.Function; * and division with customizable precision and scale. By using this utility * class, developers can achieve accurate results and avoid precision loss * in their calculations. + *
** Usage: *
@@ -80,12 +83,14 @@ import java.util.function.Function; ** The above expressions perform various mathematical calculations using the * ChainedCalcUtil class. + * *
* Note: * The ChainedCalcUtil class internally uses BigDecimal to handle * high-precision calculations. It is important to note that BigDecimal * operations can be memory-intensive and may have performance implications * for extremely large numbers or complex calculations. + *
* * @author sunzsh * @version 1.0.0 diff --git a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/HashUtil.java b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/HashUtil.java index a145777..fd6ac41 100644 --- a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/HashUtil.java +++ b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/HashUtil.java @@ -25,12 +25,15 @@ import java.util.Objects; import java.util.Optional; /** + ** Utility class for performing hash operations on strings. + *
** The HashUtil class provides convenient methods for calculating various hash * functions on strings, including MD2, MD5, SHA-1, SHA-224, SHA-256, SHA-384, * and SHA-512. It allows developers to easily obtain the hash value of a given * string using different algorithms. + *
** Example usage: *
@@ -57,12 +60,14 @@ import java.util.Optional; ** The above examples demonstrate how to use the HashUtil class to calculate * hash values for a given string using different algorithms. + * *
* Note: * The hash functions provided by the HashUtil class are one-way hash * functions, meaning the original data cannot be retrieved from the hash * value. These hash functions are commonly used for data integrity checks and * password storage, but they should not be used for encryption purposes. + *
* * @author Zihlu Wang * @version 1.0.0 diff --git a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/MapUtil.java b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/MapUtil.java index af5bcb0..9258772 100644 --- a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/MapUtil.java +++ b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/MapUtil.java @@ -24,11 +24,14 @@ import java.util.HashMap; import java.util.Map; /** + ** MapUtil is a utility class that provides methods for converting objects to * maps and maps to objects. + *
** It also provides methods for getting and setting field values using * reflection. + *
* * @author Zihlu Wang * @version 1.0.0 diff --git a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/package-info.java b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/package-info.java index 4267149..5ae9a3a 100644 --- a/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/package-info.java +++ b/dev-utils/src/main/java/cn/org/codecrafters/devkit/utils/package-info.java @@ -23,6 +23,7 @@ * enhance productivity. This package serves as the root package for the module * dev-utils, which contains a collection of common utility classes commonly * used in all Java Application development. + * * * @author Zihlu Wang * @since 1.0.0 diff --git a/devkit-core/src/main/java/cn/org/codecrafters/devkit/core/exceptions/NotImplementedException.java b/devkit-core/src/main/java/cn/org/codecrafters/devkit/core/exceptions/NotImplementedException.java index 78bd7f7..f10e78f 100644 --- a/devkit-core/src/main/java/cn/org/codecrafters/devkit/core/exceptions/NotImplementedException.java +++ b/devkit-core/src/main/java/cn/org/codecrafters/devkit/core/exceptions/NotImplementedException.java @@ -24,11 +24,13 @@ package cn.org.codecrafters.devkit.core.exceptions; * that represents a situation where a particular method or functionality is * not implemented or is currently unavailable in the codebase. It extends the * standard {@code RuntimeException} class, making it an unchecked exception. + * ** This exception is typically thrown when developers need to indicate that a * specific part of the code is incomplete or requires further implementation. * It serves as a placeholder to highlight unfinished sections of the * application during development and testing phases. + *
** Usage Example: *
@@ -39,9 +41,11 @@ package cn.org.codecrafters.devkit.core.exceptions; * """); * } *+ * *
* For more information and the latest version of JDevKit, please visit our * website codecrafters.org.cn. + *
**