List of utility methods to do EnumSet Create
EnumSet | of(E e1, E... e) of return EnumSet.of(e1, e);
|
EnumSet | of(E[] c) of if (c.length == 0) { throw new IllegalArgumentException("Collection is empty"); EnumSet<E> result = EnumSet.of(c[0]); if (c.length > 1) { for (int i = 1; i < c.length; i++) { result.add(c[i]); return result; |
EnumSet | parseEnum(final Class parse Enum return parseEnum(klass, input, "\\s*,\\s*"); |
EnumSet | toEnumSet(Class to Enum Set EnumSet<E> result = EnumSet.noneOf(classValue); for (String s : stringValues) { result.add(Enum.valueOf(classValue, s)); return result; |
EnumSet | toEnumSet(Class to Enum Set EnumSet<E> set = EnumSet.noneOf(enumClass); long mask = 1; for (E e : enumClass.getEnumConstants()) { if ((mask & vector) == mask) { set.add(e); mask <<= 1; return set; |
EnumSet | toEnumSet(Class Turns an array of enumeration values into an enum set if (ts == null) return null; EnumSet<T> res = EnumSet.noneOf(clazz); for (T t : ts) { res.add(t); return res; |