MCPcopy Create free account
hub / github.com/apache/groovy / toString

Method toString

src/main/java/groovy/util/Expando.java:146–156  ·  view source on GitHub ↗

This allows toString to be overridden by a closure field method attached to the expando object. @see java.lang.Object#toString()

()

Source from the content-addressed store, hash-verified

144 * @see java.lang.Object#toString()
145 */
146 @Override
147 public String toString() {
148 Object method = getProperties().get("toString");
149 if (method instanceof Closure closure) {
150 // invoke overridden toString closure method
151 closure.setDelegate(this);
152 return closure.call().toString();
153 } else {
154 return expandoProperties.toString();
155 }
156 }
157
158 /**
159 * This allows equals to be overridden by a closure <i>field</i> method attached

Callers

nothing calls this directly

Calls 5

getPropertiesMethod · 0.95
getMethod · 0.65
toStringMethod · 0.65
callMethod · 0.65
setDelegateMethod · 0.45

Tested by

no test coverage detected