|
1 | | -package org.woehlke.simpleworklist.model.beans; |
2 | | - |
3 | | -import javax.validation.constraints.NotNull; |
4 | | - |
5 | | -import javax.validation.constraints.Email; |
6 | | -import javax.validation.constraints.NotBlank; |
7 | | -import org.hibernate.validator.constraints.SafeHtml; |
8 | | - |
9 | | -import java.io.Serializable; |
10 | | - |
11 | | -public class LoginForm implements Serializable { |
12 | | - |
13 | | - private static final long serialVersionUID = 5936886560348238355L; |
14 | | - |
15 | | - //TODO: Messages i18n |
16 | | - @NotNull(message = "Email Address is compulsory") |
17 | | - @NotBlank(message = "Email Address is compulsory") |
18 | | - @Email(message = "Email Address is not a valid format") |
19 | | - private String userEmail; |
20 | | - |
21 | | - //TODO: Messages i18n |
22 | | - @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
23 | | - @NotNull(message = "Password is compulsory") |
24 | | - @NotBlank(message = "Password is compulsory") |
25 | | - private String userPassword; |
26 | | - |
27 | | - public String getUserEmail() { |
28 | | - return userEmail; |
29 | | - } |
30 | | - |
31 | | - public void setUserEmail(String userEmail) { |
32 | | - this.userEmail = userEmail; |
33 | | - } |
34 | | - |
35 | | - public String getUserPassword() { |
36 | | - return userPassword; |
37 | | - } |
38 | | - |
39 | | - public void setUserPassword(String userPassword) { |
40 | | - this.userPassword = userPassword; |
41 | | - } |
42 | | - |
43 | | - @Override |
44 | | - public int hashCode() { |
45 | | - final int prime = 31; |
46 | | - int result = 1; |
47 | | - result = prime * result |
48 | | - + ((userEmail == null) ? 0 : userEmail.hashCode()); |
49 | | - result = prime * result |
50 | | - + ((userPassword == null) ? 0 : userPassword.hashCode()); |
51 | | - return result; |
52 | | - } |
53 | | - |
54 | | - @Override |
55 | | - public boolean equals(Object obj) { |
56 | | - if (this == obj) |
57 | | - return true; |
58 | | - if (obj == null) |
59 | | - return false; |
60 | | - if (getClass() != obj.getClass()) |
61 | | - return false; |
62 | | - LoginForm other = (LoginForm) obj; |
63 | | - if (userEmail == null) { |
64 | | - if (other.userEmail != null) |
65 | | - return false; |
66 | | - } else if (!userEmail.equals(other.userEmail)) |
67 | | - return false; |
68 | | - if (userPassword == null) { |
69 | | - if (other.userPassword != null) |
70 | | - return false; |
71 | | - } else if (!userPassword.equals(other.userPassword)) |
72 | | - return false; |
73 | | - return true; |
74 | | - } |
75 | | - |
76 | | -} |
| 1 | +package org.woehlke.simpleworklist.user.login; |
| 2 | + |
| 3 | +import javax.validation.constraints.NotNull; |
| 4 | + |
| 5 | +import javax.validation.constraints.Email; |
| 6 | +import javax.validation.constraints.NotBlank; |
| 7 | +import org.hibernate.validator.constraints.SafeHtml; |
| 8 | + |
| 9 | +import java.io.Serializable; |
| 10 | + |
| 11 | +public class LoginForm implements Serializable { |
| 12 | + |
| 13 | + private static final long serialVersionUID = 5936886560348238355L; |
| 14 | + |
| 15 | + //TODO: Messages i18n |
| 16 | + @NotNull(message = "Email Address is compulsory") |
| 17 | + @NotBlank(message = "Email Address is compulsory") |
| 18 | + @Email(message = "Email Address is not a valid format") |
| 19 | + private String userEmail; |
| 20 | + |
| 21 | + //TODO: Messages i18n |
| 22 | + @SafeHtml(whitelistType= SafeHtml.WhiteListType.NONE) |
| 23 | + @NotNull(message = "Password is compulsory") |
| 24 | + @NotBlank(message = "Password is compulsory") |
| 25 | + private String userPassword; |
| 26 | + |
| 27 | + public String getUserEmail() { |
| 28 | + return userEmail; |
| 29 | + } |
| 30 | + |
| 31 | + public void setUserEmail(String userEmail) { |
| 32 | + this.userEmail = userEmail; |
| 33 | + } |
| 34 | + |
| 35 | + public String getUserPassword() { |
| 36 | + return userPassword; |
| 37 | + } |
| 38 | + |
| 39 | + public void setUserPassword(String userPassword) { |
| 40 | + this.userPassword = userPassword; |
| 41 | + } |
| 42 | + |
| 43 | + @Override |
| 44 | + public int hashCode() { |
| 45 | + final int prime = 31; |
| 46 | + int result = 1; |
| 47 | + result = prime * result |
| 48 | + + ((userEmail == null) ? 0 : userEmail.hashCode()); |
| 49 | + result = prime * result |
| 50 | + + ((userPassword == null) ? 0 : userPassword.hashCode()); |
| 51 | + return result; |
| 52 | + } |
| 53 | + |
| 54 | + @Override |
| 55 | + public boolean equals(Object obj) { |
| 56 | + if (this == obj) |
| 57 | + return true; |
| 58 | + if (obj == null) |
| 59 | + return false; |
| 60 | + if (getClass() != obj.getClass()) |
| 61 | + return false; |
| 62 | + LoginForm other = (LoginForm) obj; |
| 63 | + if (userEmail == null) { |
| 64 | + if (other.userEmail != null) |
| 65 | + return false; |
| 66 | + } else if (!userEmail.equals(other.userEmail)) |
| 67 | + return false; |
| 68 | + if (userPassword == null) { |
| 69 | + if (other.userPassword != null) |
| 70 | + return false; |
| 71 | + } else if (!userPassword.equals(other.userPassword)) |
| 72 | + return false; |
| 73 | + return true; |
| 74 | + } |
| 75 | + |
| 76 | +} |
0 commit comments