List of utility methods to do Object to String
String | objectToString(Object in) object To String return (in != null) ? in.toString() : null;
|
String | objectToString(Object in, boolean ignoreNull) Convert object to string String strReturn = objectToString(in); if (strReturn == null) return strReturn; else if (ignoreNull) { if (in instanceof Double && ((Double) in).doubleValue() == 0.0) return null; else if (in instanceof Long && ((Long) in).longValue() == 0) return null; ... |
String | objectToString(Object o) Emulate Object.toString on an object even if toString() was overridden.
if (o == null) return "null"; return o.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(o)); |
String | objectToString(Object o) object To String if (o == null) { return ""; try { return o.toString(); } catch (Exception e) { return "Exception converting object to string FormatUtils.objectToString(): " + e.getMessage(); |
String | objectToString(Object o) object To String return String.format("%s {instance of: %s}", o, o.getClass()); |
String | objectToString(Object o, boolean quoteStrings) object To String if (o == null) { return "null"; if (o instanceof Number) { return o.toString(); if (quoteStrings) { return "'" + o.toString().replaceAll(",", "%2C") + "'"; ... |
String | objectToString(Object obj) object To String return objectToString(obj, null);
|
String | objectToString(Object obj) Helper method to create a string representation of an object. if (obj == null) { return "null"; if (obj instanceof CharSequence) { return "\"" + obj.toString() + "\""; return obj.toString(); |
String | objectToString(Object obj) object To String if (obj == null) { return ""; return String.valueOf(obj); |
String | objectToString(Object obj) object To String String result = "null"; if (obj != null) { String str = obj.toString(); int len = str.length(); if (len > MAX_CHARS) { len = MAX_CHARS; result = obj.toString().substring(0, len); ... |