Record Class UpdateUserDto
java.lang.Object
java.lang.Record
dev.fernando.user_authentication_api.dto.UpdateUserDto
- Record Components:
username
- the new usernameoldPassword
- the current passwordnewPassword
- the new passwordphone
- the new phone number
public record UpdateUserDto(String username, String oldPassword, String newPassword, String phone)
extends Record
Data Transfer Object for updating user information.
Contains fields for username, old and new passwords, and phone number.
- Since:
- 1.0.0
- Author:
- Fernando Cruz Cavina
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateUserDto
(String username, String oldPassword, String newPassword, String phone) Creates an instance of aUpdateUserDto
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.Returns the value of thenewPassword
record component.Returns the value of theoldPassword
record component.phone()
Returns the value of thephone
record component.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.
-
Constructor Details
-
UpdateUserDto
Creates an instance of aUpdateUserDto
record class.- Parameters:
username
- the value for theusername
record componentoldPassword
- the value for theoldPassword
record componentnewPassword
- the value for thenewPassword
record componentphone
- the value for thephone
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
oldPassword
Returns the value of theoldPassword
record component.- Returns:
- the value of the
oldPassword
record component
-
newPassword
Returns the value of thenewPassword
record component.- Returns:
- the value of the
newPassword
record component
-
phone
Returns the value of thephone
record component.- Returns:
- the value of the
phone
record component
-