mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 08:15:48 +00:00
[fixes #3781] Replace inefficient Javadoc Regex
This commit is contained in:
1 parent
9f9668f18b
commit
03fb4cb110
5 files changed
+419
-6
No files matched your search
@@ -62,3 +62,67 @@ class GetterSetterJavadoc5 {
|
||||
*/
|
||||
@lombok.Getter @lombok.Setter private int fieldName;
|
||||
}
|
||||
|
||||
@lombok.Data
|
||||
class GetterSetterJavadocLong {
|
||||
/**
|
||||
* This field represents the unique identifier for a user in the system. It is used
|
||||
* throughout the application to uniquely identify and retrieve user-related data.
|
||||
* The ID is typically generated by the database and is guaranteed to be unique
|
||||
* within the context of the system.
|
||||
*
|
||||
* <p>The ID is an integral part of various operations, including but not limited to:
|
||||
* <ul>
|
||||
* <li>Authenticating users during login processes.</li>
|
||||
* <li>Associating user-specific preferences and settings.</li>
|
||||
* <li>Tracking user activity and logs for auditing purposes.</li>
|
||||
* <li>Facilitating relationships between users and other entities such as orders,
|
||||
* messages, or roles within the system.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Key characteristics of the {@code userId} field:
|
||||
* <ul>
|
||||
* <li><strong>Immutability:</strong> Once assigned, the ID must not be modified to
|
||||
* ensure data integrity.</li>
|
||||
* <li><strong>Security:</strong> Access to this field should be controlled to prevent
|
||||
* unauthorized modifications or data leakage.</li>
|
||||
* <li><strong>Uniqueness:</strong> The ID must be unique within the system. For
|
||||
* distributed systems, consider using GUIDs or UUIDs to avoid collisions.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Example usage:
|
||||
* <pre>
|
||||
* User user = userService.getUserById(userId);
|
||||
* if (user != null) {
|
||||
* System.out.println("User found: " + user.getName());
|
||||
* } else {
|
||||
* System.out.println("User not found.");
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p>Developers should ensure that the ID complies with constraints imposed by the
|
||||
* database schema, such as length and format restrictions. Furthermore, it is
|
||||
* recommended to validate the ID before persisting or using it in critical operations.
|
||||
*
|
||||
* <p>For methods or constructors that accept the {@code userId} as a parameter, the
|
||||
* following guidelines should be followed:
|
||||
* <ul>
|
||||
* <li>Validate the format of the ID to ensure it adheres to system requirements.</li>
|
||||
* <li>Handle null or empty values gracefully, providing appropriate error messages
|
||||
* or default behavior where necessary.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param userId the unique identifier assigned to a user. This value must be non-null
|
||||
* and conform to the format defined by the system. Passing a null or
|
||||
* invalid ID may result in an {@link IllegalArgumentException} or
|
||||
* similar error.
|
||||
* @param databaseConnection the connection to the database used for retrieving or
|
||||
* persisting the user ID. This parameter is required for
|
||||
* database-related operations and must be properly closed
|
||||
* after use to prevent resource leaks.
|
||||
* @param userRole the role associated with the user (e.g., "admin", "user", "guest").
|
||||
* This parameter may influence access control and permissions
|
||||
* granted to the user within the system.
|
||||
*/
|
||||
private String userId;
|
||||
}
|
||||
Reference in new issue
Block a user