Record Class PasswordChangeCommand
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.change.PasswordChangeCommand
- Record Components:
username- the user whose credential is being changedcurrentPassword- the present-day password — required for the explicit re-authentication step (CWE-620)newPassword- the proposed new password
public record PasswordChangeCommand(String username, SecretValue currentPassword, SecretValue newPassword)
extends Record
Input to
PasswordChangeService.change(PasswordChangeCommand).
The two SecretValues are owned by the caller and are
not destroyed by the service. Wrap the call in a
try-with-resources block when possible.
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordChangeCommand(String username, SecretValue currentPassword, SecretValue newPassword) Creates an instance of aPasswordChangeCommandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrentPasswordrecord component.final 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.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
PasswordChangeCommand
Creates an instance of aPasswordChangeCommandrecord class.- Parameters:
username- the value for theusernamerecord componentcurrentPassword- the value for thecurrentPasswordrecord componentnewPassword- the value for thenewPasswordrecord 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). -
username
-
currentPassword
Returns the value of thecurrentPasswordrecord component.- Returns:
- the value of the
currentPasswordrecord component
-
newPassword
Returns the value of thenewPasswordrecord component.- Returns:
- the value of the
newPasswordrecord component
-