Java String to List convertStringToEnumList(Class enumType, List stringList)

Here you can find the source of convertStringToEnumList(Class enumType, List stringList)

Description

convert String To Enum List

License

Open Source License

Declaration

public static <T extends Enum<T>> List<T> convertStringToEnumList(Class<T> enumType, List<String> stringList) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <T extends Enum<T>> List<T> convertStringToEnumList(Class<T> enumType, List<String> stringList) {
        List<T> enumList = new ArrayList<T>();
        for (String string : stringList) {
            enumList.add(Enum.valueOf(enumType, string));
        }/*from w  w  w  .  j  a v  a 2 s . c  o  m*/
        return enumList;
    }
}

Related

  1. convertStringToList(String str)
  2. convertStringToList(String string, String delimiter, boolean trim)
  3. convertStringToList(String value, String delimiter)
  4. convertTextToStringList(String tagText)