Here you can find the source of ConvertStringToEnumValue(String enumAsString, Class
public static <E extends Enum<E>> E ConvertStringToEnumValue(String enumAsString, Class<E> type)
//package com.java2s; //License from project: Open Source License public class Main { public static <E extends Enum<E>> E ConvertStringToEnumValue(String enumAsString, Class<E> type) { E userType = Enum.valueOf(type, enumAsString.toUpperCase()); return userType; }/* w w w . j a va 2 s. c o m*/ }