Record Class ChangePasswordDto
java.lang.Object
java.lang.Record
com.app.controller.dto.user.ChangePasswordDto
- Record Components:
currentPassword
- the user's current passwordnewPassword
- the new password the user wants to setconfirmPassword
- confirmation of the new password to ensure correctness
public record ChangePasswordDto(String currentPassword, String newPassword, String confirmPassword)
extends Record
Data Transfer Object (DTO) used to request a password change.
Contains the current password and the new password (with confirmation).
-
Constructor Summary
ConstructorsConstructorDescriptionChangePasswordDto
(String currentPassword, String newPassword, String confirmPassword) Creates an instance of aChangePasswordDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfirmPassword
record component.Returns the value of thecurrentPassword
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 thenewPassword
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ChangePasswordDto
Creates an instance of aChangePasswordDto
record class.- Parameters:
currentPassword
- the value for thecurrentPassword
record componentnewPassword
- the value for thenewPassword
record componentconfirmPassword
- the value for theconfirmPassword
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)
. -
currentPassword
Returns the value of thecurrentPassword
record component.- Returns:
- the value of the
currentPassword
record component
-
newPassword
Returns the value of thenewPassword
record component.- Returns:
- the value of the
newPassword
record component
-
confirmPassword
Returns the value of theconfirmPassword
record component.- Returns:
- the value of the
confirmPassword
record component
-