-
This is a request to UpdateHierarchyManager.updateHierarchy(hierarchyRequest). hierarchyRequest:
I want to a make a deep copy of this request before updateHierarchy() call is made. It has to be a deep copy because updateHierarchy() modifies the request during its processing and I no longer can use the original request or a shallow copy once updateHierarchy has finished its execution. What is the recommended way to do this? Note: The goal is to use the same request with all nodes in nodesModified set as isNew=false, and replace all identifiers with appropriate do_ids and re-run the updateHierarchy(). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@joffinjoy In order to make a deep copy of Sunbird Request, you can serialize it and then deserialize back as a Request class object. For serialization and deserialization, you can use exiting files like JsonUtils or ScalaJsonUtils. |
Beta Was this translation helpful? Give feedback.
-
@Krishnaj20 you can update FAQ yourself right? I suggest you also do these doc/faq fixes (non code/tech portions) etc and become a contributor yourself (apologies if you are already doing non tech doc updates yourself). |
Beta Was this translation helpful? Give feedback.
@joffinjoy In order to make a deep copy of Sunbird Request, you can serialize it and then deserialize back as a Request class object. For serialization and deserialization, you can use exiting files like JsonUtils or ScalaJsonUtils.
cc: @pallakartheekreddy