Class TypeUtils

java.lang.Object
com.alibaba.fastjson.util.TypeUtils

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

    • compatibleWithJavaBean

      public static boolean compatibleWithJavaBean
    • compatibleWithFieldName

      public static boolean compatibleWithFieldName
  • Constructor Details

    • TypeUtils

      public TypeUtils()
  • Method Details

    • cast

      public static <T> T cast(Object obj, Class<T> clazz, ParserConfig config)
    • cast

      public static <T> T cast(Object obj, Type type, ParserConfig mapping)
    • cast

      public static <T> T cast(Object obj, ParameterizedType type, ParserConfig mapping)
    • castToJavaBean

      public static <T> T castToJavaBean(Map<String,Object> map, Class<T> clazz, ParserConfig config)
    • 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)
    • castToInt

      public static Integer castToInt(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)
    • castToChar

      public static Character castToChar(Object value)
    • 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)
    • castToDate

      public static Date castToDate(Object value, String format)
    • castToBytes

      public static byte[] castToBytes(Object value)
    • computeGetters

      public static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap)
    • computeGetters

      public static List<FieldInfo> computeGetters(Class<?> clazz, Map<String,String> aliasMap, boolean sorted)
    • computeGetters

      public static List<FieldInfo> computeGetters(Class<?> clazz, JSONType jsonType, Map<String,String> aliasMap, Map<String,Field> fieldCacheMap, boolean sorted, PropertyNamingStrategy propertyNamingStrategy)
    • isKotlin

      public static boolean isKotlin(Class clazz)
    • getKotlinConstructor

      public static Constructor getKotlinConstructor(Constructor[] constructors)
    • getKotlinConstructor

      public static Constructor getKotlinConstructor(Constructor[] constructors, String[] paramNames)
    • 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)