|
|
@ -269,7 +269,7 @@ public enum DbManager { |
|
|
|
|
|
|
|
|
|
|
|
public static <E extends java.lang.Enum<E>> EnumSet<E> parseEnumSet(String mysqlSet, Class<E> enumClass) { |
|
|
|
public static <E extends java.lang.Enum<E>> EnumSet<E> parseEnumSet(String mysqlSet, Class<E> enumClass) { |
|
|
|
|
|
|
|
|
|
|
|
// Create empty EnumSet of the given class
|
|
|
|
// Create empty output set of the passed Enum class
|
|
|
|
|
|
|
|
|
|
|
|
EnumSet<E> enumSet = EnumSet.noneOf(enumClass); |
|
|
|
EnumSet<E> enumSet = EnumSet.noneOf(enumClass); |
|
|
|
|
|
|
|
|
|
|
@ -278,7 +278,7 @@ public enum DbManager { |
|
|
|
if (mysqlSet.isEmpty()) |
|
|
|
if (mysqlSet.isEmpty()) |
|
|
|
return enumSet; |
|
|
|
return enumSet; |
|
|
|
|
|
|
|
|
|
|
|
// Split set string and trim each element
|
|
|
|
// Split set string and trim each element
|
|
|
|
|
|
|
|
|
|
|
|
String[] elements = mysqlSet.split(","); |
|
|
|
String[] elements = mysqlSet.split(","); |
|
|
|
|
|
|
|
|
|
|
@ -286,13 +286,13 @@ public enum DbManager { |
|
|
|
|
|
|
|
|
|
|
|
element = element.trim(); |
|
|
|
element = element.trim(); |
|
|
|
|
|
|
|
|
|
|
|
// Parse the element into an enum and add to set
|
|
|
|
// Parse the element into an enum; add to the output set
|
|
|
|
|
|
|
|
|
|
|
|
E enumConstant = java.lang.Enum.valueOf(enumClass, element); |
|
|
|
E enumConstant = java.lang.Enum.valueOf(enumClass, element); |
|
|
|
enumSet.add(enumConstant); |
|
|
|
enumSet.add(enumConstant); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Return the EnumSet
|
|
|
|
// Return the output set
|
|
|
|
|
|
|
|
|
|
|
|
return enumSet; |
|
|
|
return enumSet; |
|
|
|
} |
|
|
|
} |
|
|
|