I have many maps like Map(String, Object).
map1
map2
....
mapN
I need to receive map that contains only these key-value pairs where first parameter is equal in all maps.
Could it be done by using retainAll method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can do it using
retainAllAt last
map1will be intersection of all keys in your all maps so these keys are common now you can retrieve value easily