Record Class TokensDto
java.lang.Object
java.lang.Record
com.app.security.dto.TokensDto
- Record Components:
accessToken
- the access token that grants access to protected resourcesrefreshToken
- the refresh token used to obtain a new access token
Data Transfer Object (DTO) used to represent both the access token and the refresh token.
This class encapsulates the two tokens used for user authentication and authorization:
- accessToken - A token used for accessing protected resources.
- refreshToken - A token used to refresh the access token when it expires.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessToken
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.Returns the value of therefreshToken
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
TokensDto
Creates an instance of aTokensDto
record class.- Parameters:
accessToken
- the value for theaccessToken
record componentrefreshToken
- the value for therefreshToken
record component
-
-
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)
. -
accessToken
Returns the value of theaccessToken
record component.- Returns:
- the value of the
accessToken
record component
-
refreshToken
Returns the value of therefreshToken
record component.- Returns:
- the value of the
refreshToken
record component
-