We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a0b0e5a + 598a141 commit d854d1cCopy full SHA for d854d1c
src/main/java/de/rub/nds/tlsscanner/constants/AnsiColor.java
@@ -8,6 +8,9 @@
8
*/
9
package de.rub.nds.tlsscanner.constants;
10
11
+import java.util.HashMap;
12
+import java.util.Map;
13
+
14
/**
15
*
16
* @author Robert Merget <[email protected]>
@@ -36,10 +39,24 @@ public enum AnsiColor {
36
39
37
40
private String code;
38
41
42
+ private static final Map<String, AnsiColor> MAP;
43
44
private AnsiColor(String code) {
45
this.code = code;
46
}
47
48
+ static {
49
+ MAP = new HashMap<>();
50
+ for (AnsiColor c : AnsiColor.values()) {
51
+ MAP.put(c.code, c);
52
+ }
53
54
55
+ public static AnsiColor getAnsiColor(String code) {
56
+ return MAP.get(code);
57
58
59
60
public String getCode() {
61
return code;
62
0 commit comments