docs: Fix all docs from one <p> represents for a paragraph
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 CodeCraftersCN.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The package provides all exceptions be used by module guid.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
package cn.org.codecrafters.devkit.guid.exceptions;
|
||||
+4
-1
@@ -15,13 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.devkit.guid;
|
||||
package cn.org.codecrafters.guid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* The {@code GuidCreator} is a generic interface for generating globally unique
|
||||
* identifiers (GUIDs) of a specific type.
|
||||
* </p>
|
||||
* <p>
|
||||
* The type of ID is determined by the class implementing this interface.
|
||||
* </p>
|
||||
*
|
||||
* @param <IdType> this represents the type of the Global Unique Identifier
|
||||
* @author Zihlu Wang
|
||||
+11
-8
@@ -15,28 +15,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.devkit.guid;
|
||||
package cn.org.codecrafters.guid;
|
||||
|
||||
import cn.org.codecrafters.devkit.guid.exceptions.TimingException;
|
||||
import cn.org.codecrafters.guid.exceptions.TimingException;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SnowflakeGuidCreator - GUID generator based on the Snowflake algorithm.
|
||||
*
|
||||
* </p>
|
||||
* <p>
|
||||
* The SnowflakeGuidCreator generates unique identifiers using the Snowflake
|
||||
* algorithm, which combines a timestamp, worker ID, and data center ID to
|
||||
* create 64-bit long integers. The bit distribution for the generated IDs is
|
||||
* as follows:
|
||||
* <ul>
|
||||
* <li>1 bit for sign</li>
|
||||
* <li>41 bits for timestamp (in milliseconds)</li>
|
||||
* <li>5 bits for data center ID</li>
|
||||
* <li>5 bits for worker ID</li>
|
||||
* <li>12 bits for sequence number (per millisecond)</li>
|
||||
* <li>1 bit for sign</li>
|
||||
* <li>41 bits for timestamp (in milliseconds)</li>
|
||||
* <li>5 bits for data center ID</li>
|
||||
* <li>5 bits for worker ID</li>
|
||||
* <li>12 bits for sequence number (per millisecond)</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* When initializing the SnowflakeGuidCreator, you must provide the worker ID
|
||||
@@ -45,6 +47,7 @@ import java.time.ZoneOffset;
|
||||
* increments for IDs generated within the same millisecond. If the system
|
||||
* clock moves backward, an exception is thrown to prevent generating IDs with
|
||||
* repeated timestamps.
|
||||
* </p>
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @version 1.0.0
|
||||
+6
-1
@@ -15,25 +15,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.devkit.guid.exceptions;
|
||||
package cn.org.codecrafters.guid.exceptions;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* The TimingException class represents an exception that is thrown when there
|
||||
* is an error related to time sequence.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class extends the RuntimeException class, which means that instances of
|
||||
* TimingException do not need to be declared in a method or constructor's
|
||||
* throws clause.
|
||||
* </p>
|
||||
* <p>
|
||||
* Instances of TimingException can be created with or without a message and a
|
||||
* cause. The message provides a description of the exception, while the cause
|
||||
* represents the underlying cause of the exception and provides additional
|
||||
* information about the error.
|
||||
* </p>
|
||||
* <p>
|
||||
* TimingException is typically used to handle exceptions related to timing,
|
||||
* such as timeouts or synchronization issues. It is a subclass of
|
||||
* RuntimeException, which means it is an unchecked exception and does not need
|
||||
* to be caught or declared.
|
||||
* </p>
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @since 1.0.0
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2023 CodeCraftersCN.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This package contains the custom exception classes related to GUID
|
||||
* generation. These exceptions are thrown when there are issues or errors
|
||||
* during the generation or processing of global unique identifiers (GUIDs).
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* The main exception class in this package is {@link
|
||||
* cn.org.codecrafters.guid.exceptions.TimingException}, which is a runtime
|
||||
* exception and serves as the base exception for all other custom exceptions
|
||||
* related to GUID generation.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Custom exceptions in this package provide specific information about the
|
||||
* type of error that occurred during GUID generation, making it easier for
|
||||
* developers to handle and respond to different scenarios when dealing with
|
||||
* GUIDs. They are designed to enhance the robustness and reliability of the
|
||||
* GUID generation process by providing clear and meaningful error messages to
|
||||
* the developers.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Developers using the GUID generation module should be aware of the possible
|
||||
* exceptions that can be thrown and handle them appropriately to ensure smooth
|
||||
* operation and error handling in their applications.
|
||||
* </p>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
package cn.org.codecrafters.guid.exceptions;
|
||||
+5
-1
@@ -16,12 +16,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* The package provides a set of tools for generating globally unique
|
||||
* identifiers (GUIDs).
|
||||
* </p>
|
||||
* <p>
|
||||
* The goal of this library is to provide an efficient, reliable way to
|
||||
* generate globally unique identifiers without requiring any specific
|
||||
* environment or configuration.
|
||||
* </p>
|
||||
* <p>
|
||||
* Key features include:
|
||||
* <ul>
|
||||
@@ -29,7 +32,8 @@
|
||||
* <li>High performance and quick response</li>
|
||||
* <li>Easy to integrate</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
package cn.org.codecrafters.devkit.guid;
|
||||
package cn.org.codecrafters.guid;
|
||||
Reference in New Issue
Block a user