-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPasswordConfig.java
More file actions
41 lines (29 loc) · 926 Bytes
/
Copy pathPasswordConfig.java
File metadata and controls
41 lines (29 loc) · 926 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
38
39
40
41
public class PasswordConfig{
private int length;
private boolean useUpperCase;
private boolean useNumber;
private boolean useSpecialCaracter;
public PasswordConfig(int length, boolean useUpperCase, boolean useNumber,boolean useSpecialCaracter){
this.length = length;
this.useUpperCase = useUpperCase;
this.useSpecialCaracter = useSpecialCaracter;
this.useNumber = useNumber;
}
public int getLength() {
return length;
}
public boolean isUseUpperCase() {
return useUpperCase;
}
public boolean isUseNumber() {
return useNumber;
}
public boolean isUseSpecialCaracter() {
return useSpecialCaracter;
}
public void validate() throws IllegalArgumentException{
if(length < 8){
throw new IllegalArgumentException("La contraseña de tener al menos 8 caracteres");
}
}
}