public final class TypeMagic
extends java.lang.Object
| Constructor and Description |
|---|
TypeMagic() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Class<?> |
classForType(java.lang.reflect.Type t)
This is a surprisingly intractable problem in Java: "Type" pretty much represents all possible states of reified
and unreified type information, and each kind of Type has different, mutually exclusive, and often unintended
ways of uncovering its (un-reified) class.
|
@Nullable public static java.lang.Class<?> classForType(java.lang.reflect.Type t)
Generally it's much safer to use this for the type from a *field* than a blind type from an argument.