Record Class UserDetailsDto
java.lang.Object
java.lang.Record
com.app.security.dto.UserDetailsDto
- Record Components:
username
- the unique username of the userpassword
- the password (encoded) of the userenable
- indicates if the user's account is enabledrole
- the role of the user, used for authorization
public record UserDetailsDto(String username, String password, boolean enable, String role)
extends Record
Data Transfer Object (DTO) used to represent the details of a user.
This class encapsulates the information related to a user's authentication and authorization:
- username - The unique username of the user.
- password - The password of the user (in its encoded form).
- enable - A boolean indicating if the user account is enabled or not.
- role - The role assigned to the user (e.g., "USER", "ADMIN", etc.).
-
Constructor Summary
ConstructorsConstructorDescriptionUserDetailsDto
(String username, String password, boolean enable, String role) Creates an instance of aUserDetailsDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
enable()
Returns the value of theenable
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.password()
Returns the value of thepassword
record component.role()
Returns the value of therole
record component.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.
-
Constructor Details
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with thecompare
method from their corresponding wrapper classes. -
username
-
password
-
enable
-
role
-