Implement RichIterable.toMultimap().
Pull request 37 was to implement Iterate.toMultimap(), however the method should be added on RichIterable itself.
Full signature:
public <K, V> Multimap<K, V> toMultimap(
Function<? super T, ? extends K> keyFunction,
Function<? super T, ? extends Iterable<V>> valuesFunction)
@donraab @nikhilnanivadekar @motlin
(Just to avoid confusion, this is Hiroshi, changed my GitHub account in Eclipse Fundation to use itohiro73 instead of itohro)
Seeing this issue as minor-version, I was considering how to make this as a default method in RichIterable, but I think there are couple of challenges.
- We cannot decide the variant of Multimap (such as ListMutimap, SetMultimap etc.) at RichIterable level
- We cannot instantiate implementation of Multimap from RichIterable as it'll need inverse dependency to impl.
Should this (and other similar methods) be marked back to major-version, or does anyone have any good idea to make it default method in RichIterable?
If you want to attempt it in a minor version, you'd probably have to only do implementations (no interfaces) or make the default implementation to throw new UnsupportedOperationException and override the default.
If there's a version which takes a target, that one can go on the interfaces.
On Wed, Jan 31, 2018 at 3:15 AM Hiroshi Ito [email protected] wrote:
@donraab https://github.com/donraab @nikhilnanivadekar https://github.com/nikhilnanivadekar @motlin https://github.com/motlin
(Just to avoid confusion, this is Hiroshi, changed my GitHub account in Eclipse Fundation to use itohiro73 instead of itohro)
Seeing this issue as minor-version, I was considering how to make this as a default method in RichIterable, but I think there are couple of challenges.
- We cannot decide the variant of Multimap (such as ListMutimap, SetMultimap etc.) at RichIterable level
- We cannot instantiate implementation of Multimap from RichIterable as it'll need inverse dependency to impl.
Should this (and other similar methods) be marked back to major-version, or does anyone have any good idea to make it default method in RichIterable?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eclipse/eclipse-collections/issues/46#issuecomment-361856254, or mute the thread https://github.com/notifications/unsubscribe-auth/AAO6IibPQmDVIerBt0m-hSVDvzxa8ymgks5tQCEogaJpZM4HWqcT .