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 <T> Object |
getDefaultValue(Class<T> objectClass,
PropertyDescriptor propertyDescriptor) |
static Object |
getDefaultValueObject(Class<?> type) |
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 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 Map<String,Object> |
getRawAttributes(Object bean) |
static <T> boolean |
hasDefaultValue(T bean,
PropertyDescriptor propertyDescriptor) |
static <T> boolean |
hasDifferentValue(T a,
T b,
PropertyDescriptor propertyDescriptor) |
static <T> boolean |
hasSameValue(T a,
T b,
PropertyDescriptor propertyDescriptor) |
static boolean |
isCollectionType(PropertyDescriptor propertyDescriptor) |
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 |
read(Object source,
String propertyName) |
static boolean |
supportRawAttribute(Object bean) |
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 |
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 <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 void write(Object destination, PropertyDescriptor propertyDescriptor, Object value)
public static void write(Object destination, PropertyDescriptor propertyDescriptor, Object value, boolean force)
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 boolean supportRawAttribute(Object bean)
public static boolean isFullyAccessible(PropertyDescriptor descriptor)
public static boolean isWritable(PropertyDescriptor descriptor)
public static boolean isReadable(PropertyDescriptor descriptor)
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.