Hi,

I asked this question on SO <https://stackoverflow.com/questions/49903859> and 
to my surprise I didn't get any answer. Is there anyone here know the 
answer.
Thanks in advance.

Regards,
Rad

PS: the post is:

Objective: deep copy (or clone) of a Java object
> One of the suggested ways (almost everywhere) to do it is using Jackson:
>
 
>
MyPojo myPojo = new MyPojo();
> ObjectMapper mapper = new ObjectMapper();
> MyPojo newPojo = mapper.readValue(mapper.writeValueAsString(myPojo), 
> MyPojo.class);


>
> Question: is the following better in any way (e.g. performance)? is there 
> any drawbacks?
>
 

MyPojo myPojo = new MyPojo();
> ObjectMapper mapper = new ObjectMapper();
> MyPojo newPojo = mapper.treeToValue(mapper.valueToTree(myPojo), 
> MyPojo.class);

 

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to