New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Guava support #80
Comments
Well, true, Guava's MultiMaps are nice. But, JaVers can't have dependency on Guava (as it meant to be a lightweight library). Lets, assume that custom comparator could be bounded to specified class (e.g MultiMap) bests |
take a look at http://javers.org/javadoc_1.0.0/org/javers/core/diff/Change.html class hierarchy That is what core javers comparators produce. Suppose we need also new custom Change type for MultiMaps ... |
Short answer is yes, we can develop a feature for registering custom comparators as far as they would produce one of existing Change classes. So for this case it would be existing http://javers.org/javadoc_1.0.0/org/javers/core/diff/changetype/map/MapChange.html class. What do you think about that, would it solve your case? |
I respect lightweight decision and I'd also like to leave it like that. In my mind I was thinking of an API that would allow registering a Class type and a comparator for it which would be called wen such a class is encountered (maybe also expected ChangeType out of existing ones). That kind of API would allow users to simply generate custom diffs or even generating changes for unsupported types (Like Guava MultiMap). I'm not sure if this is possible right away without any extra dependencies, so as I said, will give it a closer look in a couple of days. KR, nejc |
ok, I'm starting to work on this issue, soon, I'll give you an insight into new API |
I have came up with this simple interface
|
I have noticed that Jackson had resolved similiar problem: The had MyMapLikeType and posibility to register custom modifiers |
unifying CustomPropertyComparator
done and released in 1.0.4, there is no documentation fot this feature yet, |
give us a star if you like javers |
This is more an 'enhancement' than a bug I suppose.
javers.compare() doesn't detect changes in the object variables of type com.google.common.collectMultiMap.
Since Guava is increasingly used this feature would be nice to have.
Is it possible to register my own comparator for custom types? Can't find that in the documentation.
Thanks, Nejc
The text was updated successfully, but these errors were encountered: