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

Method equals

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

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

(Object obj)

Source from the content-addressed store, hash-verified

162 * @see java.lang.Object#equals(java.lang.Object)
163 */
164 @Override
165 public boolean equals(Object obj) {
166 Object method = getProperties().get("equals");
167 if (method instanceof Closure closure) {
168 // invoke overridden equals closure method
169 closure.setDelegate(this);
170 Boolean ret = (Boolean) closure.call(obj);
171 return ret;
172 } else {
173 return super.equals(obj);
174 }
175 }
176
177 /**
178 * This allows hashCode to be overridden by a closure <i>field</i> method attached

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected