Let's same I have an abstract class with several subclasses:
public abstract AbstractFoo { }
public FooA extends AbstractFoo {}
public FooB extends AbstractFoo {}
public FooC extends AbstractFoo {}
There's also a class with following injection:
class Bar {
@Inject
public Bar(Foo foo) { }
}
Is it possible to add Bar multiple times into multibinder with different concrete Foo classes?
Multibinder<Bar> binder = Multibinder.newSetBinder(binder(), new Bar.class);
binder.addBinding .... // Now what?
Or did I completely miss the point of Guice here? I'm new to java world, BTW.