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

CollectionUtil: a function to merge maps #2238

Closed
01es opened this issue Apr 18, 2024 · 0 comments · Fixed by #2239
Closed

CollectionUtil: a function to merge maps #2238

01es opened this issue Apr 18, 2024 · 0 comments · Fixed by #2239
Assignees
Milestone

Comments

@01es
Copy link
Member

01es commented Apr 18, 2024

Description

The Map interface in Java has method putAll, which returns void. This is very inconvenient when several maps needs to be merged as an expression. In order to support this, CollectionUtil needs to be enhanced with method Map<K,V> merge(Map<K,V> map1, Map<K,V>... otherMaps) that would create a new map of the same type as its first argument and put all elements from all of the non-null maps in to the result.

Expected outcome

Ability to merge maps as expression.

@01es 01es added this to the v1.4.6 M2 milestone Apr 18, 2024
@01es 01es self-assigned this Apr 18, 2024
01es added a commit that referenced this issue Apr 18, 2024
homedirectory added a commit that referenced this issue May 7, 2024
sorted() was causing a runtime error due to StringBuffer and String not
being mutually comparable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant