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

Add Seq.toMap() with mergeFunction #377

Closed
mujun0312 opened this issue Jul 20, 2020 · 1 comment
Closed

Add Seq.toMap() with mergeFunction #377

mujun0312 opened this issue Jul 20, 2020 · 1 comment

Comments

@mujun0312
Copy link

As the title, the method toMap() throws an exception by default when the keys are the same, whether to overload method toMap() by a merge function, used to resolve collisions between values associated with the same key.
The version i used is 0.9.12.

@lukaseder
Copy link
Member

Thanks for your suggestion.

I see, we could offer this, because Collector also offers a version that has a BinaryOperator<U> mergeFunction, and our own Collectable.toMap() methods are merely convenience for the Collector version.

Of course, the workaround is to use the Collector API from the JDK

@lukaseder lukaseder changed the title Issue:overload method toMap() Add Seq.toMap() with mergeFunction Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants