It's often times convenient that Groovy maps == to equals() but what do I do when I want to compare by identity? For example, GPathResult implements equals by calling text(), which is empty for most internal nodes. I'm trying to identify the root node but with that implementation it's not possible. It would be possible if I could compare by identity.
You use the is method. ie:
is
a.is( b )
See the docs for more description
Since groovy 3, you can use === (or !== for the opposite)
===
!==
1.4m articles
1.4m replys
5 comments
57.0k users