Here you can find the source of castString(Object obj)
public static String castString(Object obj)
//package com.java2s; public class Main { public static String castString(Object obj) { return castString(obj, ""); }//from w ww. ja v a 2 s . c o m public static String castString(Object obj, String defaultValue) { return obj != null ? String.valueOf(obj) : defaultValue; } }