-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
37 lines (28 loc) · 741 Bytes
/
User.java
File metadata and controls
37 lines (28 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.io.Serializable;
import java.util.regex.Pattern;
public class User implements Serializable{
private String id;
private String password;
String idregex = "^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$";
String pwRegex = "^[a-zA-Z0-9]{8,}$";
public boolean valID(String str) {
boolean bl = str.matches(idregex);
return bl;
}
public boolean valPassword(String str) {
boolean bl = str.matches(pwRegex);
return bl;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}