Generic Object toString method using reflections in Java

You may also like...

Subscribe
Notify of
guest
1 Comment
Oldest
Newest
Inline Feedbacks
View all comments
Dev Parker
Dev Parker
August 4, 2016 23:54

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]

1
0
Would love your thoughts, please comment.x
()
x