Class PasswordChangeRecord

java.lang.Object
uk.ac.manchester.spinnaker.alloc.model.PasswordChangeRecord

public class PasswordChangeRecord
extends Object
Describes basic information about a user that they'd use to change their password.
Author:
Donal Fellows
  • Constructor Details

    • PasswordChangeRecord

      public PasswordChangeRecord()
      Make an instance.
    • PasswordChangeRecord

      public PasswordChangeRecord​(int userId, String username)
      Make an instance.
      Parameters:
      userId - The user ID.
      username - The user name.
  • Method Details

    • getUserId

      public final int getUserId()
      Returns:
      the user id
    • setUserId

      public void setUserId​(int userId)
      Parameters:
      userId - the user id
    • getUsername

      public final String getUsername()
      Returns:
      the username
    • setUsername

      public void setUsername​(String username)
      Parameters:
      username - the username
    • getOldPassword

      @NotBlank(message="old password must be supplied") public @NotBlank(message="old password must be supplied") String getOldPassword()
      Returns:
      the old password
    • setOldPassword

      public void setOldPassword​(String password)
      Parameters:
      password - the old password
    • getNewPassword

      @NotBlank(message="new password must be supplied") public @NotBlank(message="new password must be supplied") String getNewPassword()
      Returns:
      the first copy of the new password
    • setNewPassword

      public void setNewPassword​(String newPassword)
      Parameters:
      newPassword - the first copy of the new password
    • getNewPassword2

      @NotBlank(message="second copy of new password must be supplied") public @NotBlank(message="second copy of new password must be supplied") String getNewPassword2()
      Returns:
      the second copy of the new password
    • setNewPassword2

      public void setNewPassword2​(String newPassword2)
      Parameters:
      newPassword2 - the second copy of the new password
    • isNewPasswordSameAsOld

      @AssertFalse(message="old and new passwords must be different") public @javax.validation.constraints.AssertFalse(message="old and new passwords must be different") boolean isNewPasswordSameAsOld()
      Returns:
      whether the password is being changed at all
    • isNewPasswordMatched

      @AssertTrue(message="second copy of new password must be same as first") public @javax.validation.constraints.AssertTrue(message="second copy of new password must be same as first") boolean isNewPasswordMatched()
      Returns:
      whether the two copies of the new password are the same