Tuesday, April 24, 2012

Quick toString implementation

Apache Commons Lang provides a quick implementation for a overridden toString method, the output looks clean too - for implementations which are primarily used for debugging purposes:

@Override
    public String toString() {
     return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

No comments:

Post a Comment