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

Method hashCode

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

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

()

Source from the content-addressed store, hash-verified

181 * @see java.lang.Object#hashCode()
182 */
183 @Override
184 public int hashCode() {
185 Object method = getProperties().get("hashCode");
186 if (method instanceof Closure closure) {
187 // invoke overridden hashCode closure method
188 closure.setDelegate(this);
189 Integer ret = (Integer) closure.call();
190 return ret;
191 } else {
192 return super.hashCode();
193 }
194 }
195
196 /**
197 * Factory method to create a new Map used to store the expando properties map

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected