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 Summary
Constructors Constructor Description PasswordChangeRecord()
Make an instance.PasswordChangeRecord(int userId, String username)
Make an instance. -
Method Summary
Modifier and Type Method Description @NotBlank(message="new password must be supplied") String
getNewPassword()
@NotBlank(message="second copy of new password must be supplied") String
getNewPassword2()
@NotBlank(message="old password must be supplied") String
getOldPassword()
int
getUserId()
String
getUsername()
@javax.validation.constraints.AssertTrue(message="second copy of new password must be same as first") boolean
isNewPasswordMatched()
@javax.validation.constraints.AssertFalse(message="old and new passwords must be different") boolean
isNewPasswordSameAsOld()
void
setNewPassword(String newPassword)
void
setNewPassword2(String newPassword2)
void
setOldPassword(String password)
void
setUserId(int userId)
void
setUsername(String username)
-
Constructor Details
-
PasswordChangeRecord
public PasswordChangeRecord()Make an instance. -
PasswordChangeRecord
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
- Returns:
- the username
-
setUsername
- 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
- 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
- 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
- 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
-