BeanUtils.cloneBean() deep copy

前端 未结 3 1462
北海茫月
北海茫月 2021-02-12 13:57

If all the objects within the bean implement Serializable interface, will BeanUtils.cloneBean() do a deep copy?

3条回答
  •  灰色年华
    2021-02-12 14:26

    Use SerializationUtils.clone method from the Apache Commons Lang for the deep copy. It copies the entire class hierarchy.

    SerializationUtils.clone(object);
    

提交回复
热议问题