I'm migrating a project from Guice to Dagger, and I'm trying to understand what to do with injection of values at runtime. Let's say I have a Guice module with the following configure method:
void configure() {
install(new FactoryModuleBuilder()
.build(InterfaceXFactory.class));
}
Factory interface,
public interface InterfaceXFactory{
ClassX getClassX(
@Assisted("a") String a,
@Assisted("b") Integer b);
}
and finally:
ClassX(
final @Assisted("a") String a,
final @Assisted("b") Integer b) {
/.../
}
What is the dagger equivalent of this configuration? Based on what I've found I could use AutoFactory, but I don't understand the API well enough and I'm lost on what this would look like in Dagger. Maybe that also isn't the best way to do this.
How would this example translate to Dagger, such that I can get the same functionality as the Guice implementation? I really appreciate the help!