Per this static factory and this helper method:
Multibinder<Runnable> multibinder = Multibinder.newSetBinder(
binder(), Runnable.class, Names.named("work"));
Pergunta
We have a Multibinder and would like to have two so we need the @Named annotation so we can do
@Inject @Named("work")
private Set<Runnable> work;
@Inject @Named("otherWork");
private Set<Runnable> otherWork;
IS there a way to bind Multibinder with names?
thanks, Dean
Solução
Per this static factory and this helper method:
Multibinder<Runnable> multibinder = Multibinder.newSetBinder(
binder(), Runnable.class, Names.named("work"));