public static Class < ? > getTypeArgument ( Type genericType ) { if ( ! ( genericType instanceof ParameterizedType ) ) return null ; ParameterizedType parameterizedType = ( ParameterizedType ) genericType ; Class < ? > typeArg = ( Class < ? > ) parameterizedType . getActualTypeArguments ( ) [ 0 ] ; return typeArg ; }
Returns the type argument from a parameterized type