Consider the custom toString() implementation of a bean:
toString()
@Override public String toString() { String.format(\"this is %s\", this.someField); } <
With java 8 you can now use Optional class for this:
import static java.util.Optional.ofNullable; ... String myString = null; System.out.printf("myString: %s", ofNullable(myString).orElse("Not found") );