test_class.file: alien4cloud-common/src/test/java/alien4cloud/utils/ReflectionUtilTest.java
test_class.identifier: ReflectionUtilTest
test_case.body: @Test
      public void mergeObjectTest() throws JsonProcessingException {
          MergedObject mergedObject = new MergedObject();
          mergedObject.setId("an id");
          mergedObject.setText("text");
          mergedObject.setNumber(4);
  
          MergeRequest mergeRequest = new MergeRequest();
          mergeRequest.setText("another text");
          mergeRequest.setNumber("5");
  
          ReflectionUtil.mergeObject(mergeRequest, mergedObject);
  
          Assert.assertEquals(5, mergedObject.getNumber().intValue());
          Assert.assertEquals("another text", mergedObject.getText());
          Assert.assertEquals("an id", mergedObject.getId());
      }
test_case.class_method_signature: ReflectionUtilTest.mergeObjectTest()
test_case.full_signature: @Test public void mergeObjectTest()
test_case.identifier: mergeObjectTest
test_case.invocations: setId setText setNumber setText setNumber mergeObject assertEquals intValue getNumber assertEquals getText assertEquals getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void mergeObjectTest()
focal_class.file: alien4cloud-common/src/main/java/alien4cloud/utils/ReflectionUtil.java
focal_class.identifier: ReflectionUtil
focal_class.class_method_signature: ReflectionUtil.ReflectionUtil()
focal_class.full_signature: private  ReflectionUtil()
focal_class.identifier: ReflectionUtil
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ReflectionUtil()
focal_class.class_method_signature: ReflectionUtil.getGenericArgumentType(Class<? extends T> implementationClass, Class<T> genericClass, int index)
focal_class.full_signature: public static Class<?> getGenericArgumentType(Class<? extends T> implementationClass, Class<T> genericClass, int index)
focal_class.identifier: getGenericArgumentType
focal_class.modifiers: public static
focal_class.parameters: (Class<? extends T> implementationClass, Class<T> genericClass, int index)
focal_class.return: Class<?>
focal_class.signature: Class<?> getGenericArgumentType(Class<? extends T> implementationClass, Class<T> genericClass, int index)
focal_class.class_method_signature: ReflectionUtil.getGenericArgumentTypes(Class<? extends T> currentClass, Class<T> genericClass, Type... resolvedTypes)
focal_class.full_signature: private static Type[] getGenericArgumentTypes(Class<? extends T> currentClass, Class<T> genericClass, Type... resolvedTypes)
focal_class.identifier: getGenericArgumentTypes
focal_class.modifiers: private static
focal_class.parameters: (Class<? extends T> currentClass, Class<T> genericClass, Type... resolvedTypes)
focal_class.return: Type[]
focal_class.signature: Type[] getGenericArgumentTypes(Class<? extends T> currentClass, Class<T> genericClass, Type... resolvedTypes)
focal_class.class_method_signature: ReflectionUtil.getDirectGenericInterfaces(Class<?> clazz, Class<?> expectedClazz)
focal_class.full_signature: private static Set<Type> getDirectGenericInterfaces(Class<?> clazz, Class<?> expectedClazz)
focal_class.identifier: getDirectGenericInterfaces
focal_class.modifiers: private static
focal_class.parameters: (Class<?> clazz, Class<?> expectedClazz)
focal_class.return: Set<Type>
focal_class.signature: Set<Type> getDirectGenericInterfaces(Class<?> clazz, Class<?> expectedClazz)
focal_class.class_method_signature: ReflectionUtil.isAssignableFrom(Type type, Class<?> clazz)
focal_class.full_signature: private static boolean isAssignableFrom(Type type, Class<?> clazz)
focal_class.identifier: isAssignableFrom
focal_class.modifiers: private static
focal_class.parameters: (Type type, Class<?> clazz)
focal_class.return: boolean
focal_class.signature: boolean isAssignableFrom(Type type, Class<?> clazz)
focal_class.class_method_signature: ReflectionUtil.getAnnotation(Class<?> clazz, final Class<T> annotationClass, final PropertyDescriptor property)
focal_class.full_signature: public static T getAnnotation(Class<?> clazz, final Class<T> annotationClass, final PropertyDescriptor property)
focal_class.identifier: getAnnotation
focal_class.modifiers: public static
focal_class.parameters: (Class<?> clazz, final Class<T> annotationClass, final PropertyDescriptor property)
focal_class.return: T
focal_class.signature: T getAnnotation(Class<?> clazz, final Class<T> annotationClass, final PropertyDescriptor property)
focal_class.class_method_signature: ReflectionUtil.getPropertyDescriptors(Class<?> clazz)
focal_class.full_signature: public static PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz)
focal_class.identifier: getPropertyDescriptors
focal_class.modifiers: public static
focal_class.parameters: (Class<?> clazz)
focal_class.return: PropertyDescriptor[]
focal_class.signature: PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz)
focal_class.class_method_signature: ReflectionUtil.mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_class.full_signature: public static void mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_class.identifier: mergeObject
focal_class.modifiers: public static
focal_class.parameters: (Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_class.return: void
focal_class.signature: void mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_class.class_method_signature: ReflectionUtil.mergeObject(Object from, Object to, String... ignores)
focal_class.full_signature: public static void mergeObject(Object from, Object to, String... ignores)
focal_class.identifier: mergeObject
focal_class.modifiers: public static
focal_class.parameters: (Object from, Object to, String... ignores)
focal_class.return: void
focal_class.signature: void mergeObject(Object from, Object to, String... ignores)
focal_class.class_method_signature: ReflectionUtil.getPropertyValue(Object object, String property)
focal_class.full_signature: public static Object getPropertyValue(Object object, String property)
focal_class.identifier: getPropertyValue
focal_class.modifiers: public static
focal_class.parameters: (Object object, String property)
focal_class.return: Object
focal_class.signature: Object getPropertyValue(Object object, String property)
focal_class.class_method_signature: ReflectionUtil.setPropertyValue(Object object, String property, Object value)
focal_class.full_signature: public static void setPropertyValue(Object object, String property, Object value)
focal_class.identifier: setPropertyValue
focal_class.modifiers: public static
focal_class.parameters: (Object object, String property, Object value)
focal_class.return: void
focal_class.signature: void setPropertyValue(Object object, String property, Object value)
focal_class.class_method_signature: ReflectionUtil.getDeclaredField(Class<?> clazz, String fieldName)
focal_class.full_signature: public static Field getDeclaredField(Class<?> clazz, String fieldName)
focal_class.identifier: getDeclaredField
focal_class.modifiers: public static
focal_class.parameters: (Class<?> clazz, String fieldName)
focal_class.return: Field
focal_class.signature: Field getDeclaredField(Class<?> clazz, String fieldName)
focal_class.class_method_signature: ReflectionUtil.getDeclaredField(Class<?> clazz, Class<? extends Annotation> annotationClass)
focal_class.full_signature: public static Field getDeclaredField(Class<?> clazz, Class<? extends Annotation> annotationClass)
focal_class.identifier: getDeclaredField
focal_class.modifiers: public static
focal_class.parameters: (Class<?> clazz, Class<? extends Annotation> annotationClass)
focal_class.return: Field
focal_class.signature: Field getDeclaredField(Class<?> clazz, Class<? extends Annotation> annotationClass)
focal_class.class_method_signature: ReflectionUtil.isPrimitiveOrWrapperOrString(Class<?> clazz)
focal_class.full_signature: public static boolean isPrimitiveOrWrapperOrString(Class<?> clazz)
focal_class.identifier: isPrimitiveOrWrapperOrString
focal_class.modifiers: public static
focal_class.parameters: (Class<?> clazz)
focal_class.return: boolean
focal_class.signature: boolean isPrimitiveOrWrapperOrString(Class<?> clazz)
focal_method.body: public static void mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores) {
          try {
              Map<String, Object> settablePropertiesMap = Maps.newHashMap();
              PropertyDescriptor[] propertyDescriptors = getPropertyDescriptors(from.getClass());
              for (PropertyDescriptor property : propertyDescriptors) {
                  if (property.getReadMethod() == null || property.getWriteMethod() == null) {
                      continue;
                  }
                  Object value = property.getReadMethod().invoke(from);
                  if ((value != null || !ignoreNullValue) && !ignores.contains(property.getName())) {
                      settablePropertiesMap.put(property.getName(), value);
                  }
              }
              for (Map.Entry<String, Object> settableProperty : settablePropertiesMap.entrySet()) {
                  // Set new values
                  String propertyName = settableProperty.getKey();
                  Object propertyValue = settableProperty.getValue();
                  setPropertyValue(to, propertyName, propertyValue);
              }
          } catch (IllegalAccessException | InvocationTargetException | BeansException e) {
              throw new InvalidArgumentException("Cannot merge object", e);
          }
      }
focal_method.class_method_signature: ReflectionUtil.mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_method.full_signature: public static void mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_method.identifier: mergeObject
focal_method.invocations: newHashMap getPropertyDescriptors getClass getReadMethod getWriteMethod invoke getReadMethod contains getName put getName entrySet getKey getValue setPropertyValue
focal_method.modifiers: public static
focal_method.parameters: (Object from, Object to, boolean ignoreNullValue, Set<String> ignores)
focal_method.return: void
focal_method.signature: void mergeObject(Object from, Object to, boolean ignoreNullValue, Set<String> ignores)