I have a class A that holds a class B like this:
class A {
private final B b;
@Inject
A(B b) {
this.b = b;
}
}
interface B {}
class B1 implements B {}
class B2 implements B {}
class Client() {
@Inject
Client(@AhasB1 A aHasB1, @AhasB2 A aHasB2) { }
}
I'd like to bind two different A's, one annotated @AhasB1
and another @AhasB2
. How can I bind these correctly?
Here's how I did it using
PrivateModule
.