Class TypeUtils


  • public class TypeUtils
    extends Object
    Author:
    wenshao[szujobs@hotmail.com]
    • Field Detail

      • compatibleWithJavaBean

        public static boolean compatibleWithJavaBean
      • compatibleWithFieldName

        public static boolean compatibleWithFieldName
    • Constructor Detail

      • TypeUtils

        public TypeUtils()
    • Method Detail

      • checkPrimitiveArray

        public static Type checkPrimitiveArray​(GenericArrayType genericArrayType)
      • isProxy

        public static boolean isProxy​(Class<?> clazz)
      • isGenericParamType

        public static boolean isGenericParamType​(Type type)
      • getGenericParamType

        public static Type getGenericParamType​(Type type)
      • isTransient

        public static boolean isTransient​(Method method)
      • castToString

        public static String castToString​(Object value)
      • fnv1a_64_lower

        public static long fnv1a_64_lower​(String key)
      • fnv1a_64

        public static long fnv1a_64​(String key)
      • fnv1a_64_extract

        public static long fnv1a_64_extract​(String key)
      • castToLong

        public static Long castToLong​(Object value)
      • castToBoolean

        public static Boolean castToBoolean​(Object value)
      • longExtractValue

        public static long longExtractValue​(Number number)
      • getAnnotation

        public static <A extends Annotation> A getAnnotation​(Class<?> targetClass,
                                                             Class<A> annotationClass)
      • getAnnotation

        public static <A extends Annotation> A getAnnotation​(Field field,
                                                             Class<A> annotationClass)
      • getAnnotation

        public static <A extends Annotation> A getAnnotation​(Method method,
                                                             Class<A> annotationClass)
      • castToDouble

        public static Double castToDouble​(Object value)
      • castToJavaBean

        public static <T> T castToJavaBean​(Object obj,
                                           Class<T> clazz)
      • getClass

        public static Class<?> getClass​(Type type)
      • castToBigDecimal

        public static BigDecimal castToBigDecimal​(Object value)
      • castToBigInteger

        public static BigInteger castToBigInteger​(Object value)
      • castToTimestamp

        public static Timestamp castToTimestamp​(Object value)
      • castToSqlDate

        public static Date castToSqlDate​(Object value)
      • byteValue

        public static byte byteValue​(BigDecimal decimal)
      • shortValue

        public static short shortValue​(BigDecimal decimal)
      • intValue

        public static int intValue​(BigDecimal decimal)
      • longValue

        public static long longValue​(BigDecimal decimal)
      • castToShort

        public static Short castToShort​(Object value)
      • castToByte

        public static Byte castToByte​(Object value)
      • castToFloat

        public static Float castToFloat​(Object value)
      • castToDate

        public static Date castToDate​(Object value)
      • castToBytes

        public static byte[] castToBytes​(Object value)
      • isKotlin

        public static boolean isKotlin​(Class clazz)
      • getKoltinConstructorParameters

        public static String[] getKoltinConstructorParameters​(Class clazz)
      • getSuperMethodAnnotation

        public static JSONField getSuperMethodAnnotation​(Class<?> clazz,
                                                         Method method)
      • decapitalize

        public static String decapitalize​(String name)
      • getPropertyNameByMethodName

        public static String getPropertyNameByMethodName​(String methodName)
        resolve property name from get/set method name
        Parameters:
        methodName - get/set method name
        Returns:
        property name
      • getParameterAnnotations

        public static Annotation[][] getParameterAnnotations​(Constructor constructor)