public static Type getMapKeyType ( Type mapType ) { Type componentType = GenericTypeReflector . getTypeParameter ( mapType , Map . class . getTypeParameters ( ) [ 0 ] ) ; if ( componentType == null ) // if it was a raw type, just assume Object return Object . class ; else return componentType ; }
Get the key type of a Map .