类 GenericsUtil
- java.lang.Object
-
- org.nutz.integration.nettice.core.utils.GenericsUtil
-
public class GenericsUtil extends Object
泛型操作的工具类,通过反射获得Class声明的范型Class.
-
-
方法详细资料
-
getMethodGenericParameterTypes
public static List<Class> getMethodGenericParameterTypes(Method method, int index)
通过反射,获得方法输入参数第index个输入参数的所有泛型参数的实际类型. 如: public void add(Mapmaps, List names){} - 参数:
Method- method 方法int- index 第几个输入参数- 返回:
- 输入参数的泛型参数的实际类型集合, 如果没有实现ParameterizedType接口,即不支持泛型,所以直接返回空集合
-
-