|
1 | | -package org.woehlke.simpleworklist.model.beans; |
2 | | - |
3 | | -import javax.validation.constraints.NotBlank; |
4 | | -import org.hibernate.validator.constraints.SafeHtml; |
5 | | - |
6 | | -import javax.persistence.Transient; |
7 | | -import javax.validation.constraints.NotNull; |
8 | | -import java.io.Serializable; |
9 | | - |
10 | | -/** |
11 | | - * Created by tw on 15.03.16. |
12 | | - */ |
13 | | -public class UserChangePasswordForm implements Serializable { |
14 | | - |
15 | | - private static final long serialVersionUID = 9149342594823222054L; |
16 | | - |
17 | | - //TODO: Messages i18n |
18 | | - @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
19 | | - @NotNull(message = "Password is compulsory") |
20 | | - @NotBlank(message = "Password is compulsory") |
21 | | - private String oldUserPassword; |
22 | | - |
23 | | - //TODO: Messages i18n |
24 | | - @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
25 | | - @NotNull(message = "Password is compulsory") |
26 | | - @NotBlank(message = "Password is compulsory") |
27 | | - private String userPassword; |
28 | | - |
29 | | - //TODO: Messages i18n |
30 | | - @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
31 | | - @NotNull(message = "Password is compulsory") |
32 | | - @NotBlank(message = "Password is compulsory") |
33 | | - private String userPasswordConfirmation; |
34 | | - |
35 | | - @Transient |
36 | | - public boolean passwordsAreTheSame() { |
37 | | - return this.userPassword.compareTo(userPasswordConfirmation) == 0; |
38 | | - } |
39 | | - |
40 | | - public String getOldUserPassword() { |
41 | | - return oldUserPassword; |
42 | | - } |
43 | | - |
44 | | - public void setOldUserPassword(String oldUserPassword) { |
45 | | - this.oldUserPassword = oldUserPassword; |
46 | | - } |
47 | | - |
48 | | - public String getUserPassword() { |
49 | | - return userPassword; |
50 | | - } |
51 | | - |
52 | | - public void setUserPassword(String userPassword) { |
53 | | - this.userPassword = userPassword; |
54 | | - } |
55 | | - |
56 | | - public String getUserPasswordConfirmation() { |
57 | | - return userPasswordConfirmation; |
58 | | - } |
59 | | - |
60 | | - public void setUserPasswordConfirmation(String userPasswordConfirmation) { |
61 | | - this.userPasswordConfirmation = userPasswordConfirmation; |
62 | | - } |
63 | | - |
64 | | - @Override |
65 | | - public boolean equals(Object o) { |
66 | | - if (this == o) return true; |
67 | | - if (o == null || getClass() != o.getClass()) return false; |
68 | | - |
69 | | - UserChangePasswordForm that = (UserChangePasswordForm) o; |
70 | | - |
71 | | - if (oldUserPassword != null ? !oldUserPassword.equals(that.oldUserPassword) : that.oldUserPassword != null) |
72 | | - return false; |
73 | | - if (userPassword != null ? !userPassword.equals(that.userPassword) : that.userPassword != null) return false; |
74 | | - return userPasswordConfirmation != null ? userPasswordConfirmation.equals(that.userPasswordConfirmation) : that.userPasswordConfirmation == null; |
75 | | - |
76 | | - } |
77 | | - |
78 | | - @Override |
79 | | - public int hashCode() { |
80 | | - int result = oldUserPassword != null ? oldUserPassword.hashCode() : 0; |
81 | | - result = 31 * result + (userPassword != null ? userPassword.hashCode() : 0); |
82 | | - result = 31 * result + (userPasswordConfirmation != null ? userPasswordConfirmation.hashCode() : 0); |
83 | | - return result; |
84 | | - } |
85 | | - |
86 | | -} |
| 1 | +package org.woehlke.simpleworklist.user.resetpassword; |
| 2 | + |
| 3 | +import javax.validation.constraints.NotBlank; |
| 4 | +import org.hibernate.validator.constraints.SafeHtml; |
| 5 | + |
| 6 | +import javax.persistence.Transient; |
| 7 | +import javax.validation.constraints.NotNull; |
| 8 | +import java.io.Serializable; |
| 9 | + |
| 10 | +/** |
| 11 | + * Created by tw on 15.03.16. |
| 12 | + */ |
| 13 | +public class UserChangePasswordForm implements Serializable { |
| 14 | + |
| 15 | + private static final long serialVersionUID = 9149342594823222054L; |
| 16 | + |
| 17 | + //TODO: Messages i18n |
| 18 | + @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
| 19 | + @NotNull(message = "Password is compulsory") |
| 20 | + @NotBlank(message = "Password is compulsory") |
| 21 | + private String oldUserPassword; |
| 22 | + |
| 23 | + //TODO: Messages i18n |
| 24 | + @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
| 25 | + @NotNull(message = "Password is compulsory") |
| 26 | + @NotBlank(message = "Password is compulsory") |
| 27 | + private String userPassword; |
| 28 | + |
| 29 | + //TODO: Messages i18n |
| 30 | + @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
| 31 | + @NotNull(message = "Password is compulsory") |
| 32 | + @NotBlank(message = "Password is compulsory") |
| 33 | + private String userPasswordConfirmation; |
| 34 | + |
| 35 | + @Transient |
| 36 | + public boolean passwordsAreTheSame() { |
| 37 | + return this.userPassword.compareTo(userPasswordConfirmation) == 0; |
| 38 | + } |
| 39 | + |
| 40 | + public String getOldUserPassword() { |
| 41 | + return oldUserPassword; |
| 42 | + } |
| 43 | + |
| 44 | + public void setOldUserPassword(String oldUserPassword) { |
| 45 | + this.oldUserPassword = oldUserPassword; |
| 46 | + } |
| 47 | + |
| 48 | + public String getUserPassword() { |
| 49 | + return userPassword; |
| 50 | + } |
| 51 | + |
| 52 | + public void setUserPassword(String userPassword) { |
| 53 | + this.userPassword = userPassword; |
| 54 | + } |
| 55 | + |
| 56 | + public String getUserPasswordConfirmation() { |
| 57 | + return userPasswordConfirmation; |
| 58 | + } |
| 59 | + |
| 60 | + public void setUserPasswordConfirmation(String userPasswordConfirmation) { |
| 61 | + this.userPasswordConfirmation = userPasswordConfirmation; |
| 62 | + } |
| 63 | + |
| 64 | + @Override |
| 65 | + public boolean equals(Object o) { |
| 66 | + if (this == o) return true; |
| 67 | + if (o == null || getClass() != o.getClass()) return false; |
| 68 | + |
| 69 | + UserChangePasswordForm that = (UserChangePasswordForm) o; |
| 70 | + |
| 71 | + if (oldUserPassword != null ? !oldUserPassword.equals(that.oldUserPassword) : that.oldUserPassword != null) |
| 72 | + return false; |
| 73 | + if (userPassword != null ? !userPassword.equals(that.userPassword) : that.userPassword != null) return false; |
| 74 | + return userPasswordConfirmation != null ? userPasswordConfirmation.equals(that.userPasswordConfirmation) : that.userPasswordConfirmation == null; |
| 75 | + |
| 76 | + } |
| 77 | + |
| 78 | + @Override |
| 79 | + public int hashCode() { |
| 80 | + int result = oldUserPassword != null ? oldUserPassword.hashCode() : 0; |
| 81 | + result = 31 * result + (userPassword != null ? userPassword.hashCode() : 0); |
| 82 | + result = 31 * result + (userPasswordConfirmation != null ? userPasswordConfirmation.hashCode() : 0); |
| 83 | + return result; |
| 84 | + } |
| 85 | + |
| 86 | +} |
0 commit comments