I\'m finding it difficult to put the exact question into words, so I\'ll just give an example.
I have two Enum types:
enum Shape {
C
public static > T getInstance(final String value, final Class enumClass) {
return Enum.valueOf(enumClass, value);
}
And the method is to be used as:
final Shape shape = getInstance("CAT", Shape.class);
Then again, you can always use
final Shape shape = Shape.valueOf("CAT");
which is a shortcut for
Enum.valueOf(Shape.class, "CAT");