Convert about any object to a human readable string. Use Arrays#deepToString(Object[]) to convert an array or a collection. @param object object to be converted to a string @return a string representation of the object, the empty string if null.
(Object object)
| 185 | * @return a string representation of the object, the empty string if null. |
| 186 | */ |
| 187 | public static String toString(Object object) { |
| 188 | if (object == null) { |
| 189 | return ""; |
| 190 | } else if (object instanceof Object[]) { |
| 191 | return Arrays.deepToString((Object[])object); |
| 192 | } else if (object instanceof Collection) { |
| 193 | return Arrays.deepToString(((Collection<?>)object).toArray()); |
| 194 | } else { |
| 195 | return object.toString(); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Create a String representation of a Set of String with the format |
no test coverage detected