BeanCopy ia a bean mapper that works annotation based.
Example code:
Fields with different name:
@Copy(copyTo = "testString2")
private String testString;
Fields with the same name:
private String testString;
Fields that should not be copied:
@IgnoreCopy
private String testString;
How to copy from one bean to the other:
In this case the testBean has the value and the emptyTestBean is the one where it is copied to.
TestBean testBean = new TestBean();
EmptyTestBean emptyTestBean = new EmptyTestBean();
BeanCopier beanBeanCopier = new BeanCopier();
beanBeanCopier.beanCopy(testBean,emptyTestBean);
This is the easy way to convert one bean to another