public interface GenericType
| 限定符和类型 | 方法和说明 |
|---|---|
GenericType |
as(Class<?> type)
沿着当前类的继承和实现关系,找到指定的父类或者接口的泛型解析器
|
default GenericType |
asCompletableFuture()
作为CompletableFuture集合解析
|
default GenericType |
asList()
作为List集合解析
|
default GenericType |
asMap()
作为Map集合解析
|
default GenericType |
asOptional()
作为Optional解析
|
default GenericType |
asSet()
作为Set集合解析
|
static GenericType |
forField(Field field)
创建字段泛型解析器
|
static MethodGenericType |
forMethod(Method method)
创建方法泛型解析器
|
static GenericType |
forParameter(Parameter parameter)
创建参数泛型解析器
|
static GenericType |
forType(Type type)
创建泛型类型解析器
|
default boolean |
is(Class<?> clazz)
判断当前类是否跟指定的类相同
|
default boolean |
isArray()
判断当前类型是否是数组
|
default boolean |
isAssignableTo(Class<?> clazz)
判断当前的类是否可以赋值给指定类型类
|
default boolean |
isBasic()
判断当前类型是的是基本类型
|
default boolean |
isCollection()
判断当前类型是否是集合或者其子类型的子类
|
default boolean |
isCompletableFuture()
判断当前类型是否是
CompletableFuture类型 |
default boolean |
isOptional()
判断当前类型是否是
可选类型 |
default boolean |
isPage()
判断当前类型是否是
分页类型 |
default boolean |
isWrapped()
判断当前类型是的实际实体对象是否被包装过
|
default Class<?> |
resolve()
|
default Class<?> |
resolveGeneric(int... indices)
解析泛型类,如果指定位置泛型类型不存在,抛出异常
|
Optional<Class<?>> |
resolveGenericOptional(int... indices)
解析泛型类
|
Optional<Class<?>> |
resolveOptional()
|
GenericType |
resolveType(int... indices)
解析指定索引位置的泛型
|
static GenericType forType(Type type)
type - 类型static GenericType forField(Field field)
field - 字段static GenericType forParameter(Parameter parameter)
parameter - 字段static MethodGenericType forMethod(Method method)
method - 方法default boolean isCompletableFuture()
CompletableFuture类型CompletableFuture 类型,返回truedefault boolean isCollection()
集合类型或者其子类,返回truedefault boolean isArray()
truedefault boolean isWrapped()
truedefault boolean isBasic()
trueGenericType as(Class<?> type)
type - 继承类或者实现接口Optional<Class<?>> resolveGenericOptional(int... indices)
indices - 索引default Class<?> resolveGeneric(int... indices)
indices - 索引default Class<?> resolve()
GenericType resolveType(int... indices)
indices - 泛型索引default GenericType asCompletableFuture()
default GenericType asOptional()
default GenericType asMap()
default GenericType asList()
default GenericType asSet()
default boolean isAssignableTo(Class<?> clazz)
clazz - 父类或者接口truedefault boolean is(Class<?> clazz)
clazz - 类或者接口trueCopyright © 2020. All rights reserved.