Here you can find the source of anyToString(Object o, boolean noneNull)
public static String anyToString(Object o, boolean noneNull)
//package com.java2s; public class Main { public static final String EMPTY_STRING = ""; public static String anyToString(Object o, boolean noneNull) { if (null == o && !noneNull) { return null; }//from w w w . j a va 2s . c o m return (null == o) ? EMPTY_STRING : o.toString(); } }