public class TypeUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TypeUtils.MethodInheritanceComparator |
Modifier and Type | Field and Description |
---|---|
static Function<Object,Object> |
castToTimestampFunction |
static boolean |
compatibleWithFieldName
根据field name的大小写输出输入数据
|
static boolean |
compatibleWithJavaBean |
static long |
fnv1a_64_magic_hashcode |
static long |
fnv1a_64_magic_prime |
Constructor and Description |
---|
TypeUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addMapping(String className,
Class<?> clazz) |
static SerializeBeanInfo |
buildBeanInfo(Class<?> beanType,
Map<String,String> aliasMap,
PropertyNamingStrategy propertyNamingStrategy) |
static SerializeBeanInfo |
buildBeanInfo(Class<?> beanType,
Map<String,String> aliasMap,
PropertyNamingStrategy propertyNamingStrategy,
boolean fieldBased) |
static byte |
byteValue(BigDecimal decimal) |
static <T> T |
cast(Object obj,
Class<T> clazz,
ParserConfig config) |
static <T> T |
cast(Object obj,
ParameterizedType type,
ParserConfig mapping) |
static <T> T |
cast(Object obj,
Type type,
ParserConfig mapping) |
static BigDecimal |
castToBigDecimal(Object value) |
static BigInteger |
castToBigInteger(Object value) |
static Boolean |
castToBoolean(Object value) |
static Byte |
castToByte(Object value) |
static byte[] |
castToBytes(Object value) |
static Character |
castToChar(Object value) |
static Date |
castToDate(Object value) |
static Date |
castToDate(Object value,
String format) |
static Double |
castToDouble(Object value) |
static <T> T |
castToEnum(Object obj,
Class<T> clazz,
ParserConfig mapping) |
static Float |
castToFloat(Object value) |
static Integer |
castToInt(Object value) |
static <T> T |
castToJavaBean(Map<String,Object> map,
Class<T> clazz,
ParserConfig config) |
static <T> T |
castToJavaBean(Object obj,
Class<T> clazz) |
static Long |
castToLong(Object value) |
static Short |
castToShort(Object value) |
static Object |
castToSqlDate(Object value) |
static Object |
castToSqlTime(Object value) |
static String |
castToString(Object value) |
static Object |
castToTimestamp(Object value) |
static Type |
checkPrimitiveArray(GenericArrayType genericArrayType) |
static void |
clearClassMapping() |
static List<FieldInfo> |
computeGetters(Class<?> clazz,
JSONType jsonType,
Map<String,String> aliasMap,
Map<String,Field> fieldCacheMap,
boolean sorted,
PropertyNamingStrategy propertyNamingStrategy) |
static List<FieldInfo> |
computeGetters(Class<?> clazz,
Map<String,String> aliasMap) |
static List<FieldInfo> |
computeGetters(Class<?> clazz,
Map<String,String> aliasMap,
boolean sorted) |
static List<FieldInfo> |
computeGettersWithFieldBase(Class<?> clazz,
Map<String,String> aliasMap,
boolean sorted,
PropertyNamingStrategy propertyNamingStrategy) |
static Collection |
createCollection(Type type) |
static Set |
createSet(Type type) |
static String |
decapitalize(String name) |
static long |
fnv1a_64_extract(String key) |
static long |
fnv1a_64_lower(String key) |
static long |
fnv1a_64(String key) |
static <A extends Annotation> |
getAnnotation(Class<?> targetClass,
Class<A> annotationClass) |
static <A extends Annotation> |
getAnnotation(Field field,
Class<A> annotationClass) |
static <A extends Annotation> |
getAnnotation(Method method,
Class<A> annotationClass) |
static Class<?> |
getClass(Type type) |
static Class<?> |
getClassFromMapping(String className) |
static Class<?> |
getCollectionItemClass(Type fieldType) |
static Type |
getCollectionItemType(Type fieldType) |
static Field |
getField(Class<?> clazz,
String fieldName,
Field[] declaredFields) |
static Type |
getGenericParamType(Type type) |
static String[] |
getKoltinConstructorParameters(Class clazz) |
static Constructor |
getKotlinConstructor(Constructor[] constructors) |
static Constructor |
getKotlinConstructor(Constructor[] constructors,
String[] paramNames) |
static Annotation[][] |
getParameterAnnotations(Constructor constructor) |
static Annotation[][] |
getParameterAnnotations(Method method) |
static int |
getParserFeatures(Class<?> clazz) |
static String |
getPropertyNameByMethodName(String methodName)
resolve property name from get/set method name
|
static Class<?> |
getRawClass(Type type) |
static int |
getSerializeFeatures(Class<?> clazz)
Deprecated.
|
static JSONField |
getSuperMethodAnnotation(Class<?> clazz,
Method method) |
static Annotation |
getXmlAccessorType(Class clazz) |
static int |
intValue(BigDecimal decimal) |
static boolean |
isAnnotationPresentManyToMany(Method method) |
static boolean |
isAnnotationPresentOneToMany(Method method) |
static boolean |
isClob(Class clazz) |
static boolean |
isGenericParamType(Type type) |
static boolean |
isHibernateInitialized(Object object) |
static boolean |
isJacksonCreator(Method method) |
static boolean |
isKotlin(Class clazz) |
static boolean |
isNumber(String str) |
static boolean |
isPath(Class<?> clazz) |
static boolean |
isProxy(Class<?> clazz) |
static boolean |
isTransient(Method method) |
static boolean |
isXmlField(Class clazz) |
static Class<?> |
loadClass(String className) |
static Class<?> |
loadClass(String className,
ClassLoader classLoader) |
static Class<?> |
loadClass(String className,
ClassLoader classLoader,
boolean cache) |
static long |
longExtractValue(Number number) |
static long |
longValue(BigDecimal decimal) |
static Object |
optionalEmpty(Type type) |
static double |
parseDouble(String str) |
static float |
parseFloat(String str) |
static short |
shortValue(BigDecimal decimal) |
static Locale |
toLocale(String strVal) |
static Type |
unwrapOptional(Type type) |
public static boolean compatibleWithJavaBean
public static boolean compatibleWithFieldName
public static final long fnv1a_64_magic_hashcode
public static final long fnv1a_64_magic_prime
public static boolean isXmlField(Class clazz)
public static Annotation getXmlAccessorType(Class clazz)
public static boolean isClob(Class clazz)
public static BigDecimal castToBigDecimal(Object value)
public static BigInteger castToBigInteger(Object value)
public static long longExtractValue(Number number)
public static boolean isNumber(String str)
public static byte byteValue(BigDecimal decimal)
public static short shortValue(BigDecimal decimal)
public static int intValue(BigDecimal decimal)
public static long longValue(BigDecimal decimal)
public static byte[] castToBytes(Object value)
public static <T> T cast(Object obj, Class<T> clazz, ParserConfig config)
public static <T> T castToEnum(Object obj, Class<T> clazz, ParserConfig mapping)
public static <T> T cast(Object obj, Type type, ParserConfig mapping)
public static <T> T cast(Object obj, ParameterizedType type, ParserConfig mapping)
public static <T> T castToJavaBean(Map<String,Object> map, Class<T> clazz, ParserConfig config)
public static void clearClassMapping()
public static boolean isPath(Class<?> clazz)
public static Class<?> loadClass(String className, ClassLoader classLoader)
public static Class<?> loadClass(String className, ClassLoader classLoader, boolean cache)
public static SerializeBeanInfo buildBeanInfo(Class<?> beanType, Map<String,String> aliasMap, PropertyNamingStrategy propertyNamingStrategy)
public static SerializeBeanInfo buildBeanInfo(Class<?> beanType, Map<String,String> aliasMap, PropertyNamingStrategy propertyNamingStrategy, boolean fieldBased)
public static List<FieldInfo> computeGettersWithFieldBase(Class<?> clazz, Map<String,String> aliasMap, boolean sorted, PropertyNamingStrategy propertyNamingStrategy)
public static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap)
public static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap, boolean sorted)
public static List<FieldInfo> computeGetters(Class<?> clazz, JSONType jsonType, Map<String,String> aliasMap, Map<String,Field> fieldCacheMap, boolean sorted, PropertyNamingStrategy propertyNamingStrategy)
public static JSONField getSuperMethodAnnotation(Class<?> clazz, Method method)
public static boolean isGenericParamType(Type type)
public static int getSerializeFeatures(Class<?> clazz)
public static int getParserFeatures(Class<?> clazz)
public static String getPropertyNameByMethodName(String methodName)
methodName
- get/set method namepublic static Type checkPrimitiveArray(GenericArrayType genericArrayType)
public static Collection createCollection(Type type)
public static boolean isProxy(Class<?> clazz)
public static boolean isTransient(Method method)
public static boolean isAnnotationPresentOneToMany(Method method)
public static boolean isAnnotationPresentManyToMany(Method method)
public static boolean isHibernateInitialized(Object object)
public static double parseDouble(String str)
public static float parseFloat(String str)
public static long fnv1a_64_extract(String key)
public static long fnv1a_64_lower(String key)
public static long fnv1a_64(String key)
public static boolean isKotlin(Class clazz)
public static Constructor getKotlinConstructor(Constructor[] constructors)
public static Constructor getKotlinConstructor(Constructor[] constructors, String[] paramNames)
public static <A extends Annotation> A getAnnotation(Class<?> targetClass, Class<A> annotationClass)
public static <A extends Annotation> A getAnnotation(Field field, Class<A> annotationClass)
public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationClass)
public static Annotation[][] getParameterAnnotations(Method method)
public static Annotation[][] getParameterAnnotations(Constructor constructor)
public static boolean isJacksonCreator(Method method)
Copyright © 2012–2022 Alibaba Group. All rights reserved.