Just for fun :)
Example clone: SerializationUtils.clone(obj)
Example clone: new Gson().fromJson(gson.toJson(obj), Object.class)
cons:
- problems with java.util.Date, must create adapter, see:
GsonJsonCloneTest.java
Example clone: new ObjectMapper().readValue(objectMapper.writeValueAsString(obj), Object.class)
cons:
- need to add the default constructor
- checked exceptions