You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guice provides @ProvidesIntoSet and @ProvidesIntoMap to allow adding items to multibound Sets and Maps using provider methods. However, using this approach, only a single item may be added to the multibound collection for each provider method and for maps the key must be known at compile-time.
It would be helpful if there were annotations like @ProvidesAllIntoSet and @ProvidesAllIntoMap which could indicate the returned collections should be merged with the multibound collections (via addAll or putAll).
My use case for this is that the map bindings I wish to create are themselves determined by another injected map. This also has the advantage of allowing the use of provider methods for Map multibindings with non-String keys.
natros, nkartha, cogman, moodysalem, codemaster and 5 more