This allows toString to be overridden by a closure field method attached to the expando object. @see java.lang.Object#toString()
()
| 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 |
nothing calls this directly
no test coverage detected