Class BeanUtil

java.lang.Object
org.laxture.sbp.util.BeanUtil

public class BeanUtil extends Object
  • Method Details

    • getField

      public static Field getField(@NonNull @NonNull Class<?> clazz, @NonNull @NonNull String fieldName)
    • getFieldValue

      public static <T> T getFieldValue(@NonNull @NonNull Object target, @NonNull @NonNull String path)
    • getFieldClass

      public static Class<?> getFieldClass(@NonNull @NonNull Object target, @NonNull @NonNull String fieldName)
    • setFieldValue

      public static void setFieldValue(@NonNull @NonNull Object target, @NonNull @NonNull String fieldName, Object value)
    • deepClone

      public static <T extends Serializable> T deepClone(@NonNull T o)
    • getDeclaredMethod

      public static Method getDeclaredMethod(@NonNull @NonNull Class<?> clazz, @NonNull @NonNull String methodName, Class<?>... parameterTypes)
    • getMethod

      public static Method getMethod(@NonNull @NonNull Class<?> clazz, @NonNull @NonNull String methodName, Class<?>... parameterTypes)
    • callMethod

      public static <R, O> R callMethod(O object, @NonNull @NonNull String methodName, Object... parameters)
    • callMethod

      public static <R> R callMethod(Class<?> clazz, Object object, @NonNull @NonNull String methodName, Object... parameters)
      This method doesn't always function as expected. Be 100% sure and tested when you use it. As known, this method is not worked for following case: * parameter type is primitive number, e.g. int.class * parameter type is general type, e.g. Object.class
    • getBeanName

      public static String getBeanName(org.springframework.beans.factory.BeanFactory beanFactory, Object bean)
    • createProxy

      public static <T> T createProxy(Class<T> clazz, T source, BiFunction<T,net.bytebuddy.dynamic.DynamicType.Builder<T>,net.bytebuddy.dynamic.DynamicType.Builder<T>> customizer)
    • createProxy

      public static <T> T createProxy(T source, BiFunction<T,net.bytebuddy.dynamic.DynamicType.Builder<T>,net.bytebuddy.dynamic.DynamicType.Builder<T>> customizer)