Here you can find the source of valueOfIgnoreCase(Class
public static <E extends Enum<E>> E valueOfIgnoreCase(Class<E> cls, String value) throws IllegalArgumentException
//package com.java2s; //License from project: Open Source License public class Main { public static <E extends Enum<E>> E valueOfIgnoreCase(Class<E> cls, String value) throws IllegalArgumentException { for (E e : cls.getEnumConstants()) { if (e.toString().equalsIgnoreCase(value)) return e; }// w ww. j a v a 2s. c o m throw new IllegalArgumentException(String.format("Unknown enum.value: ", value)); } }