I have a Module that uses a flag to decide whether or not to install another module. Is there a way to achive that by injection, or do I need to explicitly pass the flag's value in the ctor?
public class MyModule implements Module {
private final Boolean shouldInstallOtherModule;
@Inject public MyModule(Boolean shouldInstallOtherModule) {
this.shouldInstallOtherModule = shouldInstallOtherModule;
}
public void configure() {
if(shouldInstallOtherModule) {
install(SomeOtherModule);
}
}
}