Posted By

mcaordie on 01/15/14


Tagged

debug java print


Versions (?)

Java: print values of all get-methods of an object


 / Published in: Java
 

Surprisingly often I want to print all the values of some object for debugging reasons, and if the object has a lot of different get methods (and toString is not good for this), it is a pain to write all the print commands. That's when this snippet is useful (yes, it is not perfect, and if get methods are not named as "getXXX", it does not find those, but it is your own fault then).

Report this snippet  

You need to login to post a comment.