public static Class < ? > getFirstTypeArgument ( Type type ) { if ( type instanceof ParameterizedType ) { ParameterizedType p = ( ParameterizedType ) type ; return getRawClass ( p . getActualTypeArguments ( ) [ 0 ] ) ; } else { return null ; } }
Get declared type parameter of the type has one .