I want to check whether a java.lang.reflect.Type
instance represents an Emum object or not.
I can check whether it\'s an instance of a specific class us
Why don't you use .equals method to compare this type of comparisons. == is mostly used for primitive types.
type.equals(Enum.class)
or maybe you will need compare your own classes.
type.equals(MyClass.class)
Class.isEnum() will do it for you.
Refer to Oracle Doc
if(type instanceof Class && (Class)type.getClass().isEnum()) {...}
if(type instanceof Class && ((Class<?>)type).isEnum())