All Downloads are FREE. Search and download functionalities are using the official Maven repository.

arp.repository.copy.EntityFieldCopier Maven / Gradle / Ivy

The newest version!
package arp.repository.copy;

import java.lang.reflect.Field;

import arp.util.Unsafe;

public class EntityFieldCopier extends BaseFieldCopier {

	public EntityFieldCopier(Field field) {
		super(field);
	}

	@Override
	public void copyField(Object fromEntity, Object toEntity) {
		Object fromEntityField = Unsafe.getObjectFieldOfObject(fromEntity, fieldOffset);
		Object toEntityField = EntityCopier.copy(fromEntityField);
		Unsafe.setObjectFieldOfObject(toEntity, fieldOffset, toEntityField);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy