Class PropertyUtils

java.lang.Object
de.cronn.reflection.util.PropertyUtils

public final class PropertyUtils extends Object
  • Method Details

    • getPropertyDescriptorByName

      @Nullable public static @Nullable PropertyDescriptor getPropertyDescriptorByName​(Object bean, String propertyName)
    • getPropertyDescriptorByName

      @Nullable public static @Nullable PropertyDescriptor getPropertyDescriptorByName​(Class<?> beanClass, String propertyName)
    • getPropertyDescriptorByNameOrThrow

      @NotNull public static @NotNull PropertyDescriptor getPropertyDescriptorByNameOrThrow​(Object bean, String propertyName)
    • getPropertyDescriptorByNameOrThrow

      @NotNull public static @NotNull PropertyDescriptor getPropertyDescriptorByNameOrThrow​(Class<?> beanClass, String propertyName)
    • getPropertyDescriptors

      public static Collection<PropertyDescriptor> getPropertyDescriptors​(Class<?> type)
    • getPropertyDescriptors

      public static Collection<PropertyDescriptor> getPropertyDescriptors​(Object object)
    • getPropertyDescriptorsWithAnnotation

      public static <A extends Annotation> Map<PropertyDescriptor,​A> getPropertyDescriptorsWithAnnotation​(Object object, Class<A> annotationClass)
    • getPropertyDescriptorsWithAnnotation

      public static <A extends Annotation> Map<PropertyDescriptor,​A> getPropertyDescriptorsWithAnnotation​(Class<?> type, Class<A> annotationClass)
    • copyNonDefaultValues

      public static <T> T copyNonDefaultValues​(T source, T destination)
    • copyNonDefaultValues

      public static <T> T copyNonDefaultValues​(T source, T destination, PropertyDescriptor... excludedProperties)
    • copyNonDefaultValues

      public static <T> T copyNonDefaultValues​(T source, T destination, Collection<PropertyDescriptor> excludedProperties)
    • copyValue

      public static <T> Object copyValue​(T source, T destination, PropertyDescriptor propertyDescriptor)
    • hasDefaultValue

      public static <T> boolean hasDefaultValue​(T bean, PropertyDescriptor propertyDescriptor)
    • hasSameValue

      public static <T> boolean hasSameValue​(T a, T b, PropertyDescriptor propertyDescriptor)
    • hasDifferentValue

      public static <T> boolean hasDifferentValue​(T a, T b, PropertyDescriptor propertyDescriptor)
    • isDefaultValue

      public static <T> boolean isDefaultValue​(Class<T> objectClass, TypedPropertyGetter<T,​?> propertyGetter, Object value)
    • isDefaultValue

      public static <T> boolean isDefaultValue​(Class<T> objectClass, PropertyDescriptor propertyDescriptor, Object value)
    • getDefaultValue

      public static <T> Object getDefaultValue​(Class<T> objectClass, PropertyDescriptor propertyDescriptor)
    • write

      public static void write​(Object destination, String propertyName, Object value)
    • writeIfPropertyExists

      public static <T> void writeIfPropertyExists​(Object destination, String propertyName, Supplier<T> valueSupplier)
    • write

      public static void write​(Object destination, PropertyDescriptor propertyDescriptor, Object value)
    • write

      public static void write​(Object destination, PropertyDescriptor propertyDescriptor, Object value, boolean force)
    • writeDirectly

      public static void writeDirectly​(Object destination, PropertyDescriptor propertyDescriptor, Object value)
    • writeDirectly

      public static void writeDirectly​(Object destination, String propertyName, Object value)
    • writeDirectly

      public static void writeDirectly​(Object destination, Field field, Object value)
    • readDirectly

      public static <T> T readDirectly​(Object object, PropertyDescriptor propertyDescriptor)
    • readDirectly

      public static <T> T readDirectly​(Object object, String propertyName)
    • readDirectly

      public static <T> T readDirectly​(Object object, Field field)
    • read

      public static <T> T read​(Object source, PropertyDescriptor propertyDescriptor)
    • read

      public static <T> T read​(Object source, PropertyDescriptor propertyDescriptor, boolean force)
    • readIfPropertyExists

      public static <T> T readIfPropertyExists​(Object source, String propertyName)
    • readProperty

      public static <T> T readProperty​(Object entity, PropertyDescriptor propertyDescriptor, Class<T> expectedType)
    • getPropertyDescriptor

      @NotNull public static <T> @NotNull PropertyDescriptor getPropertyDescriptor​(T bean, TypedPropertyGetter<T,​?> propertyGetter)
    • getPropertyDescriptor

      @NotNull public static <T> @NotNull PropertyDescriptor getPropertyDescriptor​(Class<T> beanClass, TypedPropertyGetter<T,​?> propertyGetter)
    • getPropertyName

      @NotNull public static <T> @NotNull String getPropertyName​(Class<T> beanClass, TypedPropertyGetter<T,​?> propertyGetter)
    • getPropertyName

      @NotNull public static <T> @NotNull String getPropertyName​(T bean, TypedPropertyGetter<T,​?> propertyGetter)
    • getPropertyDescriptorByMethod

      @Nullable public static <T> @Nullable PropertyDescriptor getPropertyDescriptorByMethod​(Class<T> beanClass, Method method)
    • getPropertyDescriptorByField

      @Nullable public static <T> @Nullable PropertyDescriptor getPropertyDescriptorByField​(Class<T> beanClass, Field field)
    • getMethod

      @NotNull public static <T> @NotNull Method getMethod​(Class<T> beanClass, TypedPropertyGetter<T,​?> propertyGetter)
    • findMethodByGetter

      public static <T> Method findMethodByGetter​(Class<T> beanClass, TypedPropertyGetter<T,​?> propertyGetter)
    • hasAnnotationOfProperty

      public static boolean hasAnnotationOfProperty​(Class<?> entityType, PropertyDescriptor descriptor, Class<? extends Annotation> annotationClass)
    • getAnnotationOfProperty

      public static <T,​ A extends Annotation> A getAnnotationOfProperty​(Class<T> entityType, TypedPropertyGetter<T,​?> propertyGetter, Class<A> annotationClass)
    • getAnnotationOfProperty

      public static <A extends Annotation> A getAnnotationOfProperty​(Object object, PropertyDescriptor descriptor, Class<A> annotationClass)
    • getAnnotationOfProperty

      public static <A extends Annotation> A getAnnotationOfProperty​(Class<?> entityType, PropertyDescriptor descriptor, Class<A> annotationClass)
    • isFullyAccessible

      public static boolean isFullyAccessible​(PropertyDescriptor descriptor)
    • isWritable

      public static boolean isWritable​(PropertyDescriptor descriptor)
    • isReadable

      public static boolean isReadable​(PropertyDescriptor descriptor)
    • isDeclaredInClass

      public static boolean isDeclaredInClass​(PropertyDescriptor propertyDescriptor, Class<?> entityClass)
    • hasProperty

      public static boolean hasProperty​(Object bean, String propertyName)
    • hasProperty

      public static boolean hasProperty​(Class<?> beanClass, String propertyName)
    • getDefaultValueObject

      public static Object getDefaultValueObject​(Class<?> type)
    • getQualifiedPropertyName

      public static <T> String getQualifiedPropertyName​(T bean, TypedPropertyGetter<T,​?> propertyGetter)
    • getQualifiedPropertyName

      public static <T> String getQualifiedPropertyName​(Class<T> type, TypedPropertyGetter<T,​?> propertyGetter)
    • getQualifiedPropertyName

      public static String getQualifiedPropertyName​(Object bean, PropertyDescriptor propertyDescriptor)
    • getQualifiedPropertyName

      public static String getQualifiedPropertyName​(Class<?> type, PropertyDescriptor propertyDescriptor)
    • getQualifiedPropertyName

      public static String getQualifiedPropertyName​(Class<?> type, String name)
    • isCollectionType

      public static boolean isCollectionType​(PropertyDescriptor propertyDescriptor)
    • isNotCollectionType

      public static boolean isNotCollectionType​(PropertyDescriptor propertyDescriptor)