-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFieldsValues.java
89 lines (72 loc) · 2.51 KB
/
FieldsValues.java
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package check_fields;
/**
* Defines the checking parameters.
*
* @author Noris
* @date 2015/03/30
*/
public class FieldsValues {
/**
* Minimum length for the username that a user must be inserted for the registration on the server.
*/
public static final int USERNAME_MIN_LENGTH = 5;
/**
* Maximum length for the username that a user must be inserted for the registration on the server.
*/
public static final int USERNAME_MAX_LENGTH = 20;
/**
* Characters that can not be used for the username.
*/
public static final String USERNAME_FORBIDDEN_CHARS = ".*[ ]+.*";
/*
* Only these characters can be used for a username.
*/
// public static final String USERNAME_ONLY_CHARS = "";
/**
* The username must contain the characters defined by this regular expression.
*/
public static final String USERNAME_NEEDED_CHARS = ".*[a-zA-Z]+.*";
/**
* Minimum length for the password that a user must be inserted for the registration on the server.
*/
public static final int PASSWORD_MIN_LENGTH = 8;
/**
* Maximum length for the password that a user must be inserted for the registration on the server.
*/
public static final int PASSWORD_MAX_LENGTH = 35;
/*
* Characters that can not be used for the password.
*/
// public static final String PASSWORD_FORBIDDEN_CHARS = "";
/*
* Only these characters can be used for a password.
*/
// public static final String PASSWORD_ONLY_CHARS = "";
/**
* The password must contain the characters defined by this regular expression.
*/
public static final String PASSWORD_NEEDED_CHARS = "^"
+ "([a-zA-Z]+[0-9][a-zA-Z0-9]*)" + "|"
+ "([0-9]+[a-zA-Z][a-zA-Z0-9]*)" + "$";
/*
* These passwords can not be used.
*/
// public static final String[] PASSWORD_FORBIDDEN = {"password", "qwerty",
// "123456"};
/*
* These email domains can not be used.
*/
// public static final String[] EMAIL_FORBIDDEN_DOMAIN = {"@example.com"};
/**
* Minimum length for the room name that a user must be inserted when he creates a room.
*/
public static final int ROOMNAME_MIN_LENGTH = 3;
/**
* Maximum length for the room name that a user must be inserted when he creates a room.
*/
public static final int ROOMNAME_MAX_LENGTH = 30;
/*
* Characters that can not be used for a room name.
*/
// public static final String ROOMNAME_FORBIDDEN_CHARS =
}