public class MethodFieldUtil extends Object
| 构造器和说明 |
|---|
MethodFieldUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
checkClazzType(Class<?> cla,
Type type)
检查 class 类型,用于显示的类型
|
static <T extends ParamChildrenVo<?>> |
checkFieldRepeat(List<T> vos,
String field)
检查是否重复
|
static FieldType |
checkFieldType(Type type)
判断类型,不考虑二维数组
|
static boolean |
checkIsArray(Class<?> cla)
判断是不是数组或集合类型
|
static FieldTypeInfo |
checkType(Type type,
Type genType,
Boolean array)
检查类型
|
static int |
checkTypeIsBaseOrString(Class<?> cla)
判断对象是不是基本数据类型或String
|
static Class<?> |
extractClassByType(Type type,
FieldType ct)
提取类型
|
static <T extends ParamChildrenVo<?>> |
extractField(Field field,
T t,
Type genType,
int count) |
static <T extends ParamBaseVo> |
extractFieldByList(List<T> vos,
String field)
从集合中提取
|
static KVEntity<Class<?>,Type> |
extractGenType(Type type,
ParameterizedType pt,
Type genType)
查询指定泛型
|
static List<ParameterVo> |
extractMothodParamerField(Method method,
Integer index,
ApiParam[] params) |
static List<ResponseVo> |
extractMothodReturnField(Method method,
ApiResponseParam[] params)
提取方法上的返回值
|
static <T extends ParamBaseVo> |
isDuplicate(List<T> vos,
ParamBaseVo vo)
判断是否重复
|
static boolean |
isEmpty(String str)
判断是否为空
|
static Boolean |
isGeneric(FieldType ct)
判断是不是泛型
|
static void |
replaceResponseField(ApiResponseParam param,
ResponseVo vo) |
public static String checkClazzType(Class<?> cla, Type type)
cla - claa 对象type - 类型public static boolean checkIsArray(Class<?> cla)
cla - 对象public static List<ParameterVo> extractMothodParamerField(Method method, Integer index, ApiParam[] params)
public static <T extends ParamBaseVo> boolean isDuplicate(List<T> vos, ParamBaseVo vo)
T - 具体数据vos - 集合数据vo - 查询对象public static List<ResponseVo> extractMothodReturnField(Method method, ApiResponseParam[] params)
method - 方法params - 参数public static void replaceResponseField(ApiResponseParam param, ResponseVo vo)
public static <T extends ParamChildrenVo<?>> T extractField(Field field, T t, Type genType, int count)
public static FieldTypeInfo checkType(Type type, Type genType, Boolean array)
type - 类型genType - 上级类型array - 是否是集合public static KVEntity<Class<?>,Type> extractGenType(Type type, ParameterizedType pt, Type genType)
type - 类型pt - 反射类型genType - 上级类型public static Class<?> extractClassByType(Type type, FieldType ct)
type - 类型ct - 对象public static FieldType checkFieldType(Type type)
type - 对象public static int checkTypeIsBaseOrString(Class<?> cla)
cla - 对象public static <T extends ParamChildrenVo<?>> boolean checkFieldRepeat(List<T> vos, String field)
T - 数据类型vos - 集合数据field - 字段public static <T extends ParamBaseVo> T extractFieldByList(List<T> vos, String field)
T - 数据类型vos - 集合数据field - 字段public static boolean isEmpty(String str)
str - 字符串Copyright © 2020. All rights reserved.