public class Types extends Object
Modifier and Type | Method and Description |
---|---|
static Type |
getActualType(Type actualType,
Class<?> typeDefineClass,
Type typeVariable) |
static Type[] |
getActualTypes(Type actualType,
Class<?> typeDefineClass,
Type... typeVariables)
获取实际泛型类型
|
static Type |
getTypeArgument(Type type) |
static Type |
getTypeArgument(Type type,
int index) |
static Type[] |
getTypeArguments(Type type)
获取类型参数
|
static Class<?>[] |
getTypeParameterizedTypes(Type type)
获取类型的泛型类型
如果有返回数组
如果没有返回 null
|
static Class<?> |
getTypeRawClass(Type type)
获取 type 对应的原始 class
|
static boolean |
isUnknown(Type type)
是否未知类型
|
static ParameterizedType |
toParameterizedType(Type type)
类型装换为泛型类型
|
public static Class<?>[] getTypeParameterizedTypes(Type type)
如果有返回数组 如果没有返回 null
type
- 类型public static ParameterizedType toParameterizedType(Type type)
type
- typepublic static boolean isUnknown(Type type)
type
- typepublic static Class<?> getTypeRawClass(Type type)
type
- typepublic static Type[] getTypeArguments(Type type)
type
- typepublic static Type getActualType(Type actualType, Class<?> typeDefineClass, Type typeVariable)
Copyright © 2024. All rights reserved.