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