public static String asString ( Object object , String otherwise ) { return object != null ? object . toString ( ) : otherwise ; }
Returns the given object as a string if not null otherwise returns null .