Another thought: What about having something similar to ReflectionToStringBuilder
for Camunda API objects?
Could be a class CamundaObjectFormatter
that has a static toString(Object)
method. It will then detect all implemented public API interfaces and build a String based on the interfaces’ getter methods (probably only those that return String or a primitive value). That could go into a standalone library/community extension so that it works with any Camunda version and in addition we could shade it into the core codebase and use it for toString
implementations there. That way, the effort for maintaining toString
implementations is zero (e.g. when adding new public API methods), and you can still easily help yourself when we forgot implementing toString
.
I’d prefer such a solution that solves the problem once and for good over a solution that requires ongoing development effort, even if it is a small one.
Cheers,
Thorben