public final class PropertyUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
copyNonDefaultValues(T source,
T destination,
Collection<PropertyDescriptor> excludedProperties) |
static <T> Object |
copyValue(T source,
T destination,
PropertyDescriptor propertyDescriptor) |
static <A extends Annotation> |
getAnnotationOfProperty(Class<?> entityType,
PropertyDescriptor descriptor,
Class<A> annotationClass) |
static <A extends Annotation> |
getAnnotationOfProperty(Object object,
PropertyDescriptor descriptor,
Class<A> annotationClass) |
static <T> Object |
getDefaultValue(Class<T> objectClass,
PropertyDescriptor propertyDescriptor) |
static Object |
getDefaultValueObject(Class<?> type) |
static <T> PropertyDescriptor |
getPropertyDescriptorByField(Class<T> beanClass,
Field field) |
static <T> PropertyDescriptor |
getPropertyDescriptorByMethod(Class<T> beanClass,
Method method) |
static PropertyDescriptor |
getPropertyDescriptorByName(Class<?> beanClass,
String propertyName) |
static PropertyDescriptor |
getPropertyDescriptorByName(Object bean,
String propertyName) |
static PropertyDescriptor |
getPropertyDescriptorByNameOrThrow(Class<?> beanClass,
String propertyName) |
static PropertyDescriptor |
getPropertyDescriptorByNameOrThrow(Object bean,
String propertyName) |
static Collection<PropertyDescriptor> |
getPropertyDescriptors(Class<?> type) |
static Collection<PropertyDescriptor> |
getPropertyDescriptors(Object object) |
static <A extends Annotation> |
getPropertyDescriptorsWithAnnotation(Class<?> type,
Class<A> annotationClass) |
static <A extends Annotation> |
getPropertyDescriptorsWithAnnotation(Object object,
Class<A> annotationClass) |
static String |
getQualifiedPropertyName(Class<?> type,
PropertyDescriptor propertyDescriptor) |
static String |
getQualifiedPropertyName(Class<?> type,
String name) |
static String |
getQualifiedPropertyName(Object bean,
PropertyDescriptor propertyDescriptor) |
static Object |
getRawAttribute(Object bean,
String name) |
static boolean |
hasAnnotationOfProperty(Class<?> entityType,
PropertyDescriptor descriptor,
Class<? extends Annotation> annotationClass) |
static <T> boolean |
hasDefaultValue(T bean,
PropertyDescriptor propertyDescriptor) |
static <T> boolean |
hasDifferentValue(T a,
T b,
PropertyDescriptor propertyDescriptor) |
static boolean |
hasProperty(Class<?> beanClass,
String propertyName) |
static boolean |
hasProperty(Object bean,
String propertyName) |
static <T> boolean |
hasSameValue(T a,
T b,
PropertyDescriptor propertyDescriptor) |
static boolean |
isCollectionType(PropertyDescriptor propertyDescriptor) |
static boolean |
isDeclaredInClass(PropertyDescriptor propertyDescriptor,
Class<?> entityClass) |
static <T> boolean |
isDefaultValue(Class<T> objectClass,
PropertyDescriptor propertyDescriptor,
Object value) |
static boolean |
isFullyAccessible(PropertyDescriptor descriptor) |
static boolean |
isNotCollectionType(PropertyDescriptor propertyDescriptor) |
static boolean |
isReadable(PropertyDescriptor descriptor) |
static boolean |
isWritable(PropertyDescriptor descriptor) |
static void |
populate(Object bean,
Map<String,? extends Object> properties) |
static void |
populate(Object bean,
Map<String,? extends Object> properties,
boolean underline) |
static <T> T |
read(Object source,
PropertyDescriptor propertyDescriptor) |
static <T> T |
read(Object source,
PropertyDescriptor propertyDescriptor,
boolean force) |
static <T> T |
readDirectly(Object object,
Field field) |
static <T> T |
readDirectly(Object object,
PropertyDescriptor propertyDescriptor) |
static <T> T |
readDirectly(Object object,
String propertyName) |
static <T> T |
readIfPropertyExists(Object source,
String propertyName) |
static <T> T |
readProperty(Object entity,
PropertyDescriptor propertyDescriptor,
Class<T> expectedType) |
static void |
write(Object destination,
PropertyDescriptor propertyDescriptor,
Object value) |
static void |
write(Object destination,
PropertyDescriptor propertyDescriptor,
Object value,
boolean force) |
static void |
write(Object destination,
String propertyName,
Object value) |
static void |
writeDirectly(Object destination,
Field field,
Object value) |
static void |
writeDirectly(Object destination,
PropertyDescriptor propertyDescriptor,
Object value) |
static void |
writeDirectly(Object destination,
String propertyName,
Object value) |
static <T> void |
writeIfPropertyExists(Object destination,
String propertyName,
Supplier<T> valueSupplier) |
static void |
writeRawAttribute(Object bean,
String name,
Object value) |
public static PropertyDescriptor getPropertyDescriptorByName(Object bean, String propertyName)
public static PropertyDescriptor getPropertyDescriptorByName(Class<?> beanClass, String propertyName)
public static PropertyDescriptor getPropertyDescriptorByNameOrThrow(Object bean, String propertyName)
public static PropertyDescriptor getPropertyDescriptorByNameOrThrow(Class<?> beanClass, String propertyName)
public static Collection<PropertyDescriptor> getPropertyDescriptors(Class<?> type)
public static Collection<PropertyDescriptor> getPropertyDescriptors(Object object)
public static <A extends Annotation> Map<PropertyDescriptor,A> getPropertyDescriptorsWithAnnotation(Object object, Class<A> annotationClass)
public static <A extends Annotation> Map<PropertyDescriptor,A> getPropertyDescriptorsWithAnnotation(Class<?> type, Class<A> annotationClass)
public static <T> T copyNonDefaultValues(T source,
T destination,
Collection<PropertyDescriptor> excludedProperties)
public static <T> Object copyValue(T source, T destination, PropertyDescriptor propertyDescriptor)
public static <T> boolean hasDefaultValue(T bean,
PropertyDescriptor propertyDescriptor)
public static <T> boolean hasSameValue(T a,
T b,
PropertyDescriptor propertyDescriptor)
public static <T> boolean hasDifferentValue(T a,
T b,
PropertyDescriptor propertyDescriptor)
public static <T> boolean isDefaultValue(Class<T> objectClass, PropertyDescriptor propertyDescriptor, Object value)
public static <T> Object getDefaultValue(Class<T> objectClass, PropertyDescriptor propertyDescriptor)
public static <T> void writeIfPropertyExists(Object destination, String propertyName, Supplier<T> valueSupplier)
public static void write(Object destination, PropertyDescriptor propertyDescriptor, Object value)
public static void write(Object destination, PropertyDescriptor propertyDescriptor, Object value, boolean force)
public static void writeDirectly(Object destination, PropertyDescriptor propertyDescriptor, Object value)
public static void writeDirectly(Object destination, String propertyName, Object value)
public static <T> T readDirectly(Object object, PropertyDescriptor propertyDescriptor)
public static <T> T read(Object source, PropertyDescriptor propertyDescriptor)
public static <T> T read(Object source, PropertyDescriptor propertyDescriptor, boolean force)
public static void populate(Object bean, Map<String,? extends Object> properties) throws ReflectionException
public static void populate(Object bean, Map<String,? extends Object> properties, boolean underline) throws ReflectionException
public static <T> T readProperty(Object entity, PropertyDescriptor propertyDescriptor, Class<T> expectedType)
public static <T> PropertyDescriptor getPropertyDescriptorByMethod(Class<T> beanClass, Method method)
public static <T> PropertyDescriptor getPropertyDescriptorByField(Class<T> beanClass, Field field)
public static boolean hasAnnotationOfProperty(Class<?> entityType, PropertyDescriptor descriptor, Class<? extends Annotation> annotationClass)
public static <A extends Annotation> A getAnnotationOfProperty(Object object, PropertyDescriptor descriptor, Class<A> annotationClass)
public static <A extends Annotation> A getAnnotationOfProperty(Class<?> entityType, PropertyDescriptor descriptor, Class<A> annotationClass)
public static boolean isFullyAccessible(PropertyDescriptor descriptor)
public static boolean isWritable(PropertyDescriptor descriptor)
public static boolean isReadable(PropertyDescriptor descriptor)
public static boolean isDeclaredInClass(PropertyDescriptor propertyDescriptor, Class<?> entityClass)
public static String getQualifiedPropertyName(Object bean, PropertyDescriptor propertyDescriptor)
public static String getQualifiedPropertyName(Class<?> type, PropertyDescriptor propertyDescriptor)
public static boolean isCollectionType(PropertyDescriptor propertyDescriptor)
public static boolean isNotCollectionType(PropertyDescriptor propertyDescriptor)
Copyright © 2020 com.github.braisdom. All rights reserved.