MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / toString

Method toString

src/main/java/field/utility/Log.java:144–156  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

142 }
143
144 static protected String toString(Object o) {
145
146
147 if (o == null) return "null";
148 if (o instanceof Throwable) {
149 StringWriter ps = new StringWriter();
150 ((Throwable) o).printStackTrace(new PrintWriter(ps));
151 return ps.toString();
152 }
153 if (o instanceof Collection) return "" + ((Collection)o).stream().map( x -> toString(x)).collect(Collectors.toList());
154 if (o.getClass().isArray()) return "" + Arrays.asList((Object[]) o).stream().map( x -> toString(x)).collect(Collectors.toList());
155 return ("" + o).trim();
156 }
157
158}

Callers 3

printlnDecoratedMethod · 0.95
asMap_setMethod · 0.45
asMap_deleteMethod · 0.45

Calls 4

collectMethod · 0.80
asListMethod · 0.80
mapMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected