Here you can find the source of toStringWhenNull(Object src, String newValue)
public static String toStringWhenNull(Object src, String newValue)
//package com.java2s; public class Main { public static String toStringWhenNull(Object src, String newValue) { if (src == null) { return newValue; }// w w w . j a va2 s . c o m String srcStr = src.toString(); if (srcStr == null) { return newValue; } return srcStr; } }