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 aUpdateUserDtorecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenewPasswordrecord component.Returns the value of theoldPasswordrecord component.phone()Returns the value of thephonerecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
UpdateUserDto
Creates an instance of aUpdateUserDtorecord class.- Parameters:
username- the value for theusernamerecord componentoldPassword- the value for theoldPasswordrecord componentnewPassword- the value for thenewPasswordrecord componentphone- the value for thephonerecord 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 theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
oldPassword
Returns the value of theoldPasswordrecord component.- Returns:
- the value of the
oldPasswordrecord component
-
newPassword
Returns the value of thenewPasswordrecord component.- Returns:
- the value of the
newPasswordrecord component
-
phone
Returns the value of thephonerecord component.- Returns:
- the value of the
phonerecord component
-