Generic Object toString method using reflections in Java

You may also like...

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Dev Parker Recent comment authors
  Subscribe  
newest oldest
Notify of
Dev Parker
Guest
Dev Parker

Interesting alternative to the commons-lang3 technique; viz
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
….
Using commons-lang3 rel 3.3.2
yields
[email protected][engine=default,color=black]
[email protected][wheels=4,engine=default,color=black]