-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlphabet.java
More file actions
26 lines (17 loc) · 842 Bytes
/
Alphabet.java
File metadata and controls
26 lines (17 loc) · 842 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
public class Alphabet {
public static final String UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static final String LOWERCASE_LETTERS = "abcdefghijklmnopqrstuvwxyz";
public static final String NUMBERS = "1234567890";
public static final String SYMBOLS = "!@#$%^&*()-_=+\\\\/~?";
private final StringBuilder pool;
public Alphabet(boolean uppercaseIncluded, boolean lowercaseIncluded, boolean numbersIncluded, boolean specialCharactersIncluded){
pool = new StringBuilder();
if (uppercaseIncluded) pool.append(UPPERCASE_LETTERS);
if (lowercaseIncluded) pool.append(LOWERCASE_LETTERS);
if (numbersIncluded) pool.append(NUMBERS);
if (specialCharactersIncluded) pool.append(SYMBOLS);
}
public String getAlphabet(){
return pool.toString();
}
}