I am trying to get around a compile error ("Bound mismatch: ...") relating to dynamic enum lookup.
Basically I want to achieve something like this:
String enumName = whatever.getEnumName();
Class<? extends Enum<?>> enumClass = whatever.getEnumClass();
Enum<?> enumValue = Enum.valueOf(enumClass, enumName);
Whatever I do, I always end up with that compile error. Honestly, generics and enums are quite mindboggling to me...
What am I doing wrong here?