How can I generically tell if a Java Class is a primitive type?

java

Solution

There is a method on the Class object called isPrimitive.

Problem

Is there any way to take a Class and determine if it represents a primitive type (is there a solution that doesn't require specifically enumerating all the primitive types)? NOTE: I've seen this question. I'm asking basically the opposite. I have the Class, I want to know if it's a primitive.

Original source

Related problems