Custom NodePath or IdentityStrategy
I want to define a custom IdentityStrategy because all my classes that i compare are based upon one base class.
Therefore i thought i can add a custom identity strategy like this:
DiffNode diff = ObjectDifferBuilder.startBuilding()
.identity()
.ofCollectionItems(new NodePath().all()).via((working, base) -> {
if(working instanceof Base && base instanceof Base) {
return ((Base) working).getId().equals(((Base) base).getId());
}
return Objects.isEqual(working, base);
})
This wont work, because i cant match on all paths to use my strategy.
Is there an easy way to define a global IdentityStrategy?
Hey, sorry for keeping you waiting so long. I've created a little pull request to help you with your use-case. Can you take a look at #168 and let me know if that helps?
Hey, i replied a few weeks in the PR but just to let you know, that is what I was looking for, good to merge.
This would also match one of my use cases very nicely, +1 for this
Hey guys, sorry for my recent lack of activity. I just have too much on my plate these days. I'll try to free an hour on the weekend to merge this, put out a new release and reply to some questions.
No worries, what you've done already with this library is awesome :)