Inject Map without any @IntoMap bindings

Viewed 12

I'm using Dagger to inject a Map<Int,Handler> into a class. It works perfectly when something like this is defined in a module:

@Binds
@IntoMap
@IntKey(FOO_KEY)
Handler bindFooHandler(FooHandler handler);

If no such methods exist, the project fails to build because it doesn't know of a Map<Integer,Handler> to inject. Is there any way to make Map<Integer,Handler> injectable when no @IntoMap bindings exist?

0 Answers
Related