public class PluginUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
METHOD_GET_GENERIC_INFO |
| Constructor and Description |
|---|
PluginUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendGenericParamMap(Map<String,Class<?>> genericParamMap,
Type genericParameterType)
将泛型实际参数存储到genericParamMap中。
Result |
static void |
copyPropertiesIgnoreNull(Object from,
Object to,
String... ignoreProperties)
属性拷贝,第一个参数中的属性值拷贝到第二个参数中
注意:当第一个参数中的属性有null值时,不会拷贝进去 |
static String |
getDataType(Class<?> type) |
static String |
getGenericParamKey(Class<?> rawType,
String name) |
static Type |
getGenericRawType(Type type)
获取泛型参数的原理类型,如:List<String> 返回List
|
static Type |
getGenericType(Field field) |
static Type |
getGenericType(Type type)
获取泛型参数类型,如:List<String> 返回String
|
static Type |
getGenericTypeDeeply(Type type) |
static String |
getParameterType(Parameter parameter) |
static boolean |
hasAnyAnnotation(Field field,
List<String> annotationClassname)
字段是否包含某些注解
|
static boolean |
isCollection(Class<?> type) |
static boolean |
isCollectionOrArray(Class<?> type) |
static boolean |
isEnableFeature(TornaConfig config,
PushFeature feature) |
static <T extends Annotation> |
isExistAnnotation(Annotation[] annotations,
Class<T> annoClass) |
static boolean |
isFileParameter(Parameter parameter) |
static boolean |
isGenericType(Type type)
是否是泛型类型
|
static boolean |
isPojo(Class<?> clazz)
是否普通的java类
|
static boolean |
isTransientField(Field field)
字段是否被transient关键字修饰或有@Transient注解
|
public static final String METHOD_GET_GENERIC_INFO
public static boolean isPojo(Class<?> clazz)
clazz - 类classpublic static boolean isTransientField(Field field)
field - public static <T extends Annotation> boolean isExistAnnotation(Annotation[] annotations, Class<T> annoClass)
public static Type getGenericType(Type type)
type - 泛型参数public static Type getGenericRawType(Type type)
type - 泛型参数public static boolean isGenericType(Type type)
type - 类型public static boolean isCollectionOrArray(Class<?> type)
public static boolean isCollection(Class<?> type)
public static void appendGenericParamMap(Map<String,Class<?>> genericParamMap, Type genericParameterType)
genericParamMap - 存储泛型信息genericParameterType - 泛型类型public static void copyPropertiesIgnoreNull(Object from, Object to, String... ignoreProperties) throws org.springframework.beans.BeansException
from - 源对象to - 目标对象org.springframework.beans.BeansExceptionpublic static boolean isFileParameter(Parameter parameter)
public static boolean hasAnyAnnotation(Field field, List<String> annotationClassname)
field - 字段annotationClassname - 注解名称public static boolean isEnableFeature(TornaConfig config, PushFeature feature)
Copyright © 2023. All Rights Reserved.