I try to extract relevant information from a bundled object in Java. This object has a structure:
You have several options, each with own pros and cons.
You can implement toString method, but it defeats your purpose because to write it you need to know the structure of a variable.
You can use reflection, but this is a proprietary feature that might be gone in future releases.
Large projects typically have several huge global variables (like
session, that might store everything relevant to this session) and a zillion of local variables. The structure of local variables is simple. Since there is only a small number of global variables you should ask team leader about their structure.