Generic Object toString method using reflections in Java

You may also like...

  • 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]