10 February, 2016

Java object cloning

A note to myself from 15 August 2014:

To quickly clone an java object, including all the children and relationships, use SerializationUtils in Apache Commons Lang:

MyObject newObject = (MyObject) SerializationUtils.clone(objectToClone);

(http://www.kianworknotes.com/2014/08/how-to-quickily-clone-object-in-java.html)

No comments:

Post a Comment