Skip to content
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

Closed
gissuebot opened this issue Oct 31, 2014 · 6 comments
Closed

Overload of Maps.difference that accepts a custom Equivalence #589

gissuebot opened this issue Oct 31, 2014 · 6 comments
Labels
status=fixed type=enhancement Make an existing feature better
Milestone

Comments

@gissuebot
Copy link

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

@gissuebot
Copy link
Author

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.

@gissuebot
Copy link
Author

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.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2011-06-22 at 07:07 PM


Issue #640 has been merged into this issue.

@gissuebot
Copy link
Author

Original comment posted by kevinb@google.com on 2011-07-16 at 07:52 PM


(No comment entered for this change.)


Status: Accepted
Labels: Type-Enhancement

@gissuebot
Copy link
Author

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: Milestone-Release10

@gissuebot
Copy link
Author

Original comment posted by kevinb@google.com on 2011-08-04 at 08:36 PM


(No comment entered for this change.)


Status: Fixed

@gissuebot gissuebot added status=fixed migrated type=enhancement Make an existing feature better labels Oct 31, 2014
@cgdecker cgdecker modified the milestone: 10.0 Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status=fixed type=enhancement Make an existing feature better
Projects
None yet
Development

No branches or pull requests

2 participants