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.
1 parent 9285b62 commit 6c4750dCopy full SHA for 6c4750d
src/com/gramercysoftware/utils/EnumUtils.java
@@ -0,0 +1,21 @@
1
+package com.gramercysoftware.utils;
2
+
3
+public class EnumUtils {
4
+ public static <E extends Enum<E>> E fromValue(Class<E> enumClass, String enumValue) {
5
+ for(E value : enumClass.getEnumConstants()) {
6
+ if(value.toString().equals(enumValue)) {
7
+ return value;
8
+ }
9
10
+ return null;
11
12
13
+ public static <E extends Enum<E>> E fromValueIgnoreCase(Class<E> enumClass, String enumValue) {
14
15
+ if(value.toString().equalsIgnoreCase(enumValue)) {
16
17
18
19
20
21
+}
0 commit comments