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