Mittwoch, 3. Dezember 2014

Bean Cloner




Sometimes you need a deep copy of bean structure but no clone constructors are available. Cloner offers a fast reflection based methods to clone object structures. It is also possible to integrate Cloner into Spring.


Code Snippet:

class CloneTest {
  private static final Cloner CLONER = new Cloner(); 
  
  public static void main(String[] args) {
    Object original = new Object();
    Object clone = CLONER.deepClone(tds);
  }
}


Details:
https://code.google.com/p/cloning/wiki/Usage

Maven:
 <dependency>
    <groupId>uk.com.robust-it</groupId>
    <artifactId>cloning</artifactId>
    <version>1.7.4</version>
</dependency>