Here you can find the source of null2empty(Object s)
public static String null2empty(Object s)
//package com.java2s; //License from project: Apache License public class Main { public static String null2empty(Object s) { if (s == null) { return ""; }//from w w w .j a va 2s. c o m if (s instanceof String) { return (String) s; } return s.toString(); } }