back to blog index..

Invisible existence of toString()

October 13, 2005

Example below presents very simple aspect that handles so common toString() property of a class. I found myself putting the same code in almost every class. Here's the code:

public class Extension
{
    ...


    public String toString()
    {
        return ToStringBuilder.reflectionToString(
            this,
            ToStringStyle.MULTI_LINE_STYLE);
                                            
    }
}

Designed with CSS| Get Firefox!| | Opel Omega Forum|

Copyright © Tomasz Nazar 2007
Revision: $Id: blog_testing_aspects.gtml 3768 2005-07-25 23:47:33Z nthx $