"copy constructor using reflection [closed]" Code Answer

4

if you need to populate a bean from some other having the same properties (more or less), you surely can find something here:

http://commons.apache.org/proper/commons-beanutils/

specifically

http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.1/apidocs/org/apache/commons/beanutils/beanutils.html

i guess beanutils.copyproperties(object orig, object dest) will do what you need without the burden to copy all your fields.

By Ben Clark-Robinson on April 21 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.