docs: Fix all docs from one <p> represents for a paragraph
This commit is contained in:
@@ -22,19 +22,18 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* Utility class for Base64 encoding and decoding of strings.
|
||||
* <p>
|
||||
* The {@code Base64Util} class provides static methods to encode and decode
|
||||
* strings using Base64 encoding. It utilizes the {@link Base64} class from the
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Example usage:
|
||||
* <pre>
|
||||
@@ -48,12 +47,12 @@ import java.util.Base64;
|
||||
* String decoded = Base64Util.decode(encoded);
|
||||
* System.out.println("Decoded string: " + decoded);
|
||||
* </pre>
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* <b>Note:</b> 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.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @version 1.0.0
|
||||
|
||||
@@ -23,18 +23,19 @@ import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Utility class to simplify if...else logic using lambda expressions.
|
||||
* <p>
|
||||
* The BranchUtil class provides static methods to simplify conditional logic
|
||||
* in Java development by leveraging lambda expressions. It offers convenient
|
||||
* methods to replace verbose if...else statements with more concise and
|
||||
* expressive functional constructs.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* <b>Example:</b>
|
||||
* <pre>
|
||||
@@ -66,12 +67,11 @@ import java.util.function.Supplier;
|
||||
* // do something
|
||||
* });
|
||||
* </pre>
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* <b>Note:</b>
|
||||
* The {@link #and(Boolean...)} and {@link #or(Boolean...)} methods accept any
|
||||
* number of boolean expressions.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type of the result to be handled by the methods
|
||||
* @author Zihlu Wang
|
||||
@@ -167,15 +167,14 @@ public final class BranchUtil<T> {
|
||||
* <p>
|
||||
* Handles the result of the boolean expressions by executing the
|
||||
* appropriate handler based on the result.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Returns the result of the executed handler.
|
||||
* </p>
|
||||
*
|
||||
* @param ifHandler the handler to be executed if the result is
|
||||
* {@code true}
|
||||
@@ -200,10 +199,9 @@ public final class BranchUtil<T> {
|
||||
* <p>
|
||||
* Handles the result of the boolean expressions by executing the provided
|
||||
* handler if the result is {@code true}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Returns the result of the executed handler.
|
||||
* </p>
|
||||
*
|
||||
* @param ifHandler the handler to be executed if the result is
|
||||
* {@code true}
|
||||
@@ -217,12 +215,11 @@ public final class BranchUtil<T> {
|
||||
* <p>
|
||||
* Handles the result of the boolean expressions by executing the
|
||||
* appropriate handler based on the result.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @param ifHandler the handler to be executed if the result is
|
||||
* {@code true}
|
||||
|
||||
@@ -26,7 +26,8 @@ import java.util.function.Function;
|
||||
/**
|
||||
* <p>
|
||||
* Utility class for chained high-precision calculations using BigDecimal.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* The ChainedCalcUtil class provides a convenient way to perform chained
|
||||
* high-precision calculations using BigDecimal. It allows users to perform
|
||||
@@ -34,7 +35,8 @@ 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.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* <b>Usage:</b>
|
||||
* <pre>
|
||||
@@ -83,14 +85,13 @@ import java.util.function.Function;
|
||||
* </pre>
|
||||
* The above expressions perform various mathematical calculations using the
|
||||
* ChainedCalcUtil class.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* <b>Note:</b>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @author sunzsh
|
||||
* @version 1.0.0
|
||||
|
||||
@@ -27,13 +27,13 @@ import java.util.Optional;
|
||||
/**
|
||||
* <p>
|
||||
* Utility class for performing hash operations on strings.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Example usage:
|
||||
* <pre>
|
||||
@@ -60,14 +60,13 @@ import java.util.Optional;
|
||||
* </pre>
|
||||
* The above examples demonstrate how to use the HashUtil class to calculate
|
||||
* hash values for a given string using different algorithms.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* <b>Note:</b>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @version 1.0.0
|
||||
|
||||
@@ -27,11 +27,10 @@ import java.util.Map;
|
||||
* <p>
|
||||
* MapUtil is a utility class that provides methods for converting objects to
|
||||
* maps and maps to objects.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* It also provides methods for getting and setting field values using
|
||||
* reflection.
|
||||
* </p>
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @version 1.0.0
|
||||
@@ -150,6 +149,7 @@ public final class MapUtil {
|
||||
* field
|
||||
* @throws InvocationTargetException if an error occurs while invoking the
|
||||
* field getter method
|
||||
* @throws NoSuchMethodException if the specified getter is not present
|
||||
*/
|
||||
public static <T> T getFieldValue(Object obj, String fieldName, Class<T> fieldType) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
|
||||
var methodName = getMethodName("get", fieldName);
|
||||
@@ -170,6 +170,7 @@ public final class MapUtil {
|
||||
* field setter method
|
||||
* @throws IllegalAccessException if an error occurs while accessing the
|
||||
* field
|
||||
* @throws NoSuchMethodException if the specific setter is not present
|
||||
*/
|
||||
public static void setFieldValue(Object obj, String fieldName, Object fieldValue) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
|
||||
var objectClass = obj.getClass();
|
||||
|
||||
@@ -16,14 +16,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* <h3>JDevKit Dev-Utils - Common Utility Classes</h3>
|
||||
* <p>
|
||||
* This package is part of JDevKit, an open-source Java Development Kit that
|
||||
* provides a set of convenient tools to streamline code development and
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @since 1.0.0
|
||||
|
||||
Reference in New Issue
Block a user