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 voidconstructor(Class objectClass, Consumer<Constructor> constructorConsumer) static voiddeclaredFields(Class objectClass, Consumer<Field> fieldConsumer) static booleanReturns true ifaandbare equal.static Stringstatic voidstatic FieldgetDeclaredField(Class objectClass, String fieldName) static ConstructorgetDefaultConstructor(Class objectClass) static MembergetEnumValueField(Class clazz) static TypegetFieldType(TypeReference type, Class<?> raw, Member field, Type fieldType) static voidgetKotlinConstructor(Class objectClass, BeanInfo beanInfo) static String[]static Class<?>getRawType(Type type) static String[]getRecordFieldNames(Class<?> recordType) static StringgetterName(String methodName, String namingStrategy) static voidstatic booleanstatic ParameterizedTypenewParameterizedTypeWithOwner(Type ownerType, Type rawType, Type... typeArguments) Returns a new parameterized type, applyingtypeArgumentstorawTypeand enclosed byownerType.static Typestatic 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
-
getDeclaredField
-
declaredFields
-
staticMethod
-
buildMethod
-
constructor
-
getDefaultConstructor
-
setters
-
setters
-
annotationMethods
-
getEnumValueField
-
getters
-
isRecord
-
setterName
-
setterName
-
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)
-