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
Overload of Maps.difference that accepts a custom Equivalence #589
Comments
Original comment posted by kevinb@google.com on 2011-03-31 at 02:17 PM The more details you can give about your use case, the better. |
Original comment posted by cloudyster on 2011-04-29 at 07:04 AM I would like to use Maps.difference in the following scenario: Some of our services are key-value based - the request is a Map<String,String>, the response is a Map<String,String>. we would like to use Maps.difference in our testsuite to compare the servers' response to an expected response pattern. We would like to use a reg-exp-based comparator in Maps.difference as some of the responses values are dynamically created (timespamp. salted hashes, ...) that would compare the response map's values with the expected map values. |
Original comment posted by cpovirk@google.com on 2011-06-22 at 07:07 PM Issue #640 has been merged into this issue. |
Original comment posted by kevinb@google.com on 2011-07-16 at 07:52 PM (No comment entered for this change.) Status: |
Original comment posted by kevinb@google.com on 2011-07-29 at 01:53 AM The custom Equivalence will only affect how values are compared. As for keys, it would be a very bad idea to pass in maps whose keys aren't compared using equals(), and we're creating plain HashMaps for what we return to you. Labels: |
Original comment posted by kevinb@google.com on 2011-08-04 at 08:36 PM (No comment entered for this change.) Status: |
Original issue created by cloudyster on 2011-03-31 at 01:24 PM
Maps.difference(left,right) uses Objects.equal to compare the values.
It would be nice to (optionally) use a custom Comparator, eg to compare Strings case insensitive
The text was updated successfully, but these errors were encountered: