Supplying two collections of type, one of which is subset of another
I’m introducing Dagger into our application. I want to have access to two collection of a type, one of which is a subset of the other
Dagger dependency injected individually and @IntoSet at the same time. How do I implement it?
I’m learning Dagger. I’m a former Spring user. One of the things I noticed is I have to annotate each bean with @IntoSet
to inject beans of a certain type as a collection. In Spring, I’d directly declare, for example, Set<MyBeanClass>
as a parameter in an autowired method or constructor, and the framework would figure all out itself (granted, “framework figuring things out for you” is not always an advantage)
How do I inject a collection of beans with Dagger — without explicitly declaring a collection as a bean?
Suppose I want to inject a map of keys to matching instances. With Spring, I could do it very easily