Learn how to record complex user-defined object's properties
Estimated reading time: 1 min
Last edited: 12 Feb 2020
RevDeBug by default records deltas of changes to complex objects (non-deterministic data). Data processed while object’s creation (ie inside constructor) is preserved as a usual sequential recording of executed source code. In case there is a need to record a custom or serialized content of object’s at points where it is referenced in source code or content for objects originated from external sources to RevDeBug instrumentation, you would need to define a RDBDisplay configuration.
Example - recording complex objects
To enable this functionality create rdbDisplay file in project’s root directory. It will hold information on what methods should be used to serialize selected types of objects. You can pass a customized method that serializes only relevant bussiness logic data.
Each line within this file should contain information about a single type and it’s corresponding serialization method. The type name have to include its full namespace and after colon the object’s method or a fully qualified static method that accepts one parameter of the corresponding type that RevDeBug will use to serialize object’s contents.
The example above uses toString method of JSONObject to serialize contents of JSONObject’s passed in the source code of the application.
In our demo application the CalculateReconcilation(String id) method parses data from JSON file. When using RevDeBug recording the content of parsed file will be preserved and visible when inspecting the recording even when the file or the whole process no longer exist. Below the output of such a recoding is shown inside web interface of RevDeBug DevOps Monitor: