T
- 需要自定义的参考类型public abstract class TypeReference<T> extends Object implements Type
TypeReference<List<String>> list = new TypeReference<List<String>>() {}; Type t = tr.getType();此类无法应用于通配符泛型参数(wildcard parameters),比如:
Class<?>
或者 List? extends CharSequence>
此类参考FastJSON的TypeReference实现
Constructor and Description |
---|
TypeReference()
构造
|
Modifier and Type | Method and Description |
---|---|
Type |
getType()
获取用户定义的泛型参数
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTypeName
Copyright © 2025. All rights reserved.