List of utility methods to do Object to String
String | objectToString(Object obj, String defaultvalue) object To String if (null == obj) { return defaultvalue; try { return obj.toString(); } catch (Exception e) { return defaultvalue; |
String | objectToString(Object object) object To String if (object != null) { if (object instanceof String) return (String) object; else return object.toString(); } else return null; |
String | objectToString(Object object, String defaultValue) Gives a default value if the object is null. return object == null ? defaultValue : String.valueOf(object);
|
String | objectToString(Object objectStr) object To String if (objectStr == null) objectStr = ""; if ("null".equalsIgnoreCase(String.valueOf(objectStr))) objectStr = ""; return String.valueOf(objectStr); |
String | ObjectToString(Object x) Object To String return x.toString();
|
String | objectToString(Object x) object To String String s; return (x == null || (s = x.toString()) == null) ? "null" : s; |
String | objectToString(Object[] obj) object To String if (obj == null) { return ""; StringBuffer sb = new StringBuffer(); for (int i = 0; i < obj.length; i++) { if (obj[i] == null) { sb.append("null,"); continue; ... |
String | objectToStringNoNull(Object obj) Converts an object to a string via it's toString() method. String msg = NullString; if (obj != null) msg = obj.toString(); return msg; |
String | objToString(Object obj) obj To String return obj == null ? "" : obj.toString(); |
String | objToString(Object obj) obj To String String result = ""; try { result = obj.toString(); } catch (Exception e) { result = null; return result; |