List of utility methods to do Object to String
String | objToString(Object obj) obj To String return obj != null ? obj.toString() : ""; |
String[] | objToString(Object[] obj) obj To String if (obj == null) return null; String[] str = new String[obj.length]; for (int i = 0; i < obj.length; i++) { str[i] = obj[i].toString(); return str; |
String | toString(Object o) to String if (o instanceof Object[]) return Arrays.deepToString((Object[]) o); else if (o instanceof byte[]) return Arrays.toString((byte[]) o); else if (o instanceof short[]) return Arrays.toString((short[]) o); else if (o instanceof int[]) return Arrays.toString((int[]) o); ... |
String | toString(Object obj) Converts the object to a string. return ""; |
String | toString(Object obj) If the obj is an array, toString() method of Arrays is called. if (obj == null) { return "null"; final Class<?> clazz = obj.getClass(); if (!clazz.isArray()) { return obj.toString(); final Class<?> componentType = obj.getClass().getComponentType(); ... |
String | toString(Object object) Returns a String representation of the given object. if (object == null) { return "null"; Class c = object.getClass(); StringBuffer sb = new StringBuffer(); if (Map.class.isAssignableFrom(c)) { Map map = (Map) object; sb.append("{ "); ... |
String | toString(Object object) to String return Objects.toString(object);
|
String | toString(Object object) to String if (object instanceof Object[]) { return Arrays.deepToString((Object[]) object); } else { return String.valueOf(object); |
String | toString(Object object) to String String result; if (object.getClass().isArray()) { Class readingClass = object.getClass().getComponentType(); if (Integer.TYPE.equals(readingClass)) { result = Arrays.toString((int[]) object); } else if (Long.TYPE.equals(readingClass)) { result = Arrays.toString((long[]) object); } else if (Double.TYPE.equals(readingClass)) { ... |
String | toString(Object object, Class> objectClass) to String if (null == object) { return "null"; final String toString = object.toString(); if (isStringEmpty(toString)) { return "\"\""; } else if (String.class.equals(objectClass)) { return "\"" + toString + '\"'; ... |