I normally like to have toString tell me as much as possible about my objects. With some of my objects, 80% of the properties are lazy. Now my toString is down to just a few basic fields:
Code:
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return new ToStringBuilder(this)
.appendSuper(super.toString())
.append(this.type)
.append(this.status)
.append(this.contact)
.toString();
}
Is there a slick way I am unaware of to have a property return LAZY or at least null in a case like this?
(I am using 3.2 CR1 and Annotations Beta 9)