Package com.alibaba.fastjson2.util
Class BeanUtils
java.lang.Object
com.alibaba.fastjson2.util.BeanUtils
- Author:
- Bob Lee, Jesse Wilson, Shaojin Wen
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidannotationMethods(Class objectClass, Consumer<Method> methodConsumer) static GenericArrayTypeReturns an array type whose elements are all instances ofcomponentType.static MethodbuildMethod(Class objectClass, String methodName) static Typecanonicalize(Type type) Returns a type that is functionally equal but not necessarily equal according toObject.equals().static <T> TcheckNotNull(T obj) static voidcleanupCache(Class objectClass) static voidcleanupCache(ClassLoader classLoader) static voidconstructor(Class objectClass, Consumer<Constructor> constructorConsumer) static voiddeclaredFields(Class objectClass, Consumer<Field> fieldConsumer) static booleanReturns true ifaandbare equal.static Stringstatic voidstatic Constructor[]getConstructor(Class objectClass) static FieldgetDeclaredField(Class objectClass, String fieldName) static ConstructorgetDefaultConstructor(Class objectClass, boolean includeNoneStaticMember) static MembergetEnumValueField(Class clazz, ObjectCodecProvider mixinProvider) static TypegetFieldType(TypeReference type, Class<?> raw, Member field, Type fieldType) static voidgetKotlinConstructor(Class<?> objectClass, BeanInfo beanInfo) static String[]getKotlinConstructorParameters(Class<?> clazz) static Methodstatic Class<?>getRawType(Type type) static String[]getRecordFieldNames(Class<?> recordType) static StringgetterName(Method method, String namingStrategy) static StringgetterName(String methodName, String namingStrategy) static voidstatic booleanisNoneStaticMemberClass(Class objectClass, Class memberClass) static booleanstatic booleanisWriteEnumAsJavaBean(Class clazz) static ParameterizedTypenewParameterizedTypeWithOwner(Type ownerType, Type rawType, Type... typeArguments) Returns a new parameterized type, applyingtypeArgumentstorawTypeand enclosed byownerType.static voidprocessJacksonJsonJsonIgnore(FieldInfo fieldInfo, Annotation annotation) static voidprocessJSONType1x(BeanInfo beanInfo, Annotation jsonType1x, Method method) static Typestatic voidsetNoneStaticMemberClassParent(Object object, Object parent) static StringsetterName(String methodName, int prefixLength) static StringsetterName(String methodName, String namingStrategy) static voidstatic voidstatic voidstaticMethod(Class objectClass, Consumer<Method> methodConsumer) static WildcardTypeReturns a type that represents an unknown type that extendsbound.static WildcardTypesupertypeOf(Type bound) Returns a type that represents an unknown supertype ofbound.static StringtypeToString(Type type)
-
Constructor Details
-
BeanUtils
public BeanUtils()
-
-
Method Details
-
getRecordFieldNames
-
getKotlinConstructor
-
getKotlinConstructorParameters
-
fields
-
getMethod
-
getDeclaredField
-
declaredFields
-
staticMethod
-
buildMethod
-
constructor
-
getConstructor
-
getDefaultConstructor
-
setters
-
setters
-
annotationMethods
-
isWriteEnumAsJavaBean
-
getEnumValueField
-
getters
-
isRecord
-
setterName
-
setterName
-
getterName
-
getterName
-
fieldName
-
getFieldType
-
newParameterizedTypeWithOwner
public static ParameterizedType newParameterizedTypeWithOwner(Type ownerType, Type rawType, Type... typeArguments) Returns a new parameterized type, applyingtypeArgumentstorawTypeand enclosed byownerType.- Returns:
- a
serializableparameterized type.
-
arrayOf
Returns an array type whose elements are all instances ofcomponentType.- Returns:
- a
serializablegeneric array type.
-
subtypeOf
Returns a type that represents an unknown type that extendsbound. For example, ifboundisCharSequence.class, this returns? extends CharSequence. IfboundisObject.class, this returns?, which is shorthand for? extends Object. -
supertypeOf
Returns a type that represents an unknown supertype ofbound. For example, ifboundisString.class, this returns? super String. -
canonicalize
Returns a type that is functionally equal but not necessarily equal according toObject.equals(). The returned type isSerializable. -
getRawType
-
equals
Returns true ifaandbare equal. -
typeToString
-
resolve
-
checkNotNull
public static <T> T checkNotNull(T obj) -
processJacksonJsonJsonIgnore
-
isNoneStaticMemberClass
-
setNoneStaticMemberClassParent
-
cleanupCache
-
cleanupCache
-
processJSONType1x
-