Record Class UsernamePasswordAuthenticationTokenDto
java.lang.Object
java.lang.Record
com.app.security.dto.UsernamePasswordAuthenticationTokenDto
- Record Components:
username
- the unique username of the userrole
- the role assigned to the user (e.g., "USER", "ADMIN", etc.)
Data Transfer Object (DTO) used to represent the username and role
of a user during authentication.
This DTO is commonly used to carry authentication information after a successful login, typically containing the user's username and the role they are assigned in the system.
-
Constructor Summary
ConstructorsConstructorDescriptionUsernamePasswordAuthenticationTokenDto
(String username, String role) Creates an instance of aUsernamePasswordAuthenticationTokenDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.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
-
UsernamePasswordAuthenticationTokenDto
-
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
username
-
role
-