Versions of @ProvidesIntoSet, @ProvidesIntoMap which allow multiple bindings
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 1.7k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
Guice provides `@ProvidesIntoSet` and `@ProvidesIntoMap` to allow adding items to multibound `Set`s and `Map`s 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.
Contributor guide
Assessment
This issue has not been assessed yet.