Here you can find the source of objectToString(Object objectStr)
public static String objectToString(Object objectStr)
//package com.java2s; //License from project: Open Source License public class Main { public static String objectToString(Object objectStr) { if (objectStr == null) objectStr = ""; if ("null".equalsIgnoreCase(String.valueOf(objectStr))) objectStr = ""; return String.valueOf(objectStr); }/*from w w w . j a v a 2 s.c o m*/ public static String objectToString(Object objectStr, String e) { if (objectStr == null) objectStr = e; if ("null".equalsIgnoreCase(String.valueOf(objectStr))) objectStr = e; return String.valueOf(objectStr); } }