ParameterizedType理解笔记

首先分享这篇文章《ParameterizedType详解》 https://blog.csdn.net/JustBeauty/article/details/81116144 

ParameterizedType就是参数化类型的意思

声明类型中带有“<>”的都是参数化类型,比如List<Integer>,Map<String,Long>

getActualTypeArguments()返回Type[],即“<>”里的参数,比如Map<String,Integer>

getRawType()返回Tpye,得到“<>”前面的类型,比如List<String>

getOwnerType()返回Type,O<T>.I<S>类型变量调用时会返回O<T>,比如Map.Entry<Long,Short>

猜你喜欢

转载自www.cnblogs.com/Meiwah/p/10434893.html