I am new to Guice and searched on google for this problem but couldn't find satisfactory answer.
public class X {
private Y y;
public X() {
y = new Y("abc", "xyz");
}
}
public class Y {
private String str1;
private String str2;
public Y(String str1, String str2) {
this.str1 = str1;
this.str2 = str2;
}
}
Now, I want to inject Y into constructor of class X.
I did find AssistedInject but isn't it for constructor which has parameters some of which are provided by Guice and some of them are provided by caller.
Here, in this case, all the parameters to the constructor are provided by caller only.
How can I do that?