Consider using http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/ObjectUtils.html#toString(java.lang.Object)