Java EnumSet Create toEnumSet( Class classValue, Collection stringValues)

Here you can find the source of toEnumSet( Class classValue, Collection stringValues)

Description

to Enum Set

License

Open Source License

Declaration

public static <E extends Enum<E>> EnumSet<E> toEnumSet(
            Class<E> classValue, Collection<String> stringValues) 

Method Source Code

//package com.java2s;

import java.util.Collection;

import java.util.EnumSet;

public class Main {
    public static <E extends Enum<E>> EnumSet<E> toEnumSet(
            Class<E> classValue, Collection<String> stringValues) {
        EnumSet<E> result = EnumSet.noneOf(classValue);
        for (String s : stringValues) {
            result.add(Enum.valueOf(classValue, s));
        }/*  ww w.ja va2  s  . co m*/
        return result;
    }
}

Related

  1. newEnumSet(Class klass)
  2. noneOf( Class elementType)
  3. of(E e1, E... e)
  4. of(E[] c)
  5. parseEnum(final Class klass, final String input)
  6. toEnumSet(Class enumClass, long vector)
  7. toEnumSet(Class clazz, T... ts)