Record Class NewEmailDto
java.lang.Object
java.lang.Record
com.app.controller.dto.user.NewEmailDto
- Record Components:
currentPassword
- the user's current password for authenticationnewEmail
- the new email address to be setconfirmEmail
- confirmation of the new email address to avoid typos
public record NewEmailDto(String currentPassword, String newEmail, String confirmEmail)
extends Record
Data Transfer Object (DTO) used for requesting an email change.
Contains the current password for verification and the new email with confirmation.
-
Constructor Summary
ConstructorsConstructorDescriptionNewEmailDto
(String currentPassword, String newEmail, String confirmEmail) Creates an instance of aNewEmailDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfirmEmail
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.newEmail()
Returns the value of thenewEmail
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
NewEmailDto
Creates an instance of aNewEmailDto
record class.- Parameters:
currentPassword
- the value for thecurrentPassword
record componentnewEmail
- the value for thenewEmail
record componentconfirmEmail
- the value for theconfirmEmail
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
-
newEmail
-
confirmEmail
Returns the value of theconfirmEmail
record component.- Returns:
- the value of the
confirmEmail
record component
-