Search in sources :

Example 1 with HabitRepEtl

use of com.robertsanek.data.etl.remote.scrape.toodledo.HabitRepEtl in project core by z1lc.

the class ParentModule method habitRepEtlWill.

@Provides
@Named("will")
HabitRepEtl habitRepEtlWill(Injector injector) {
    SecretProvider secretProvider = injector.getInstance(SecretProvider.class);
    HabitRepEtl habitRepEtl = new HabitRepEtl() {

        @Override
        public String getUsername() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_USERNAME);
        }

        @Override
        public String getPassword() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_PASSWORD);
        }
    };
    injector.injectMembers(habitRepEtl);
    return habitRepEtl;
}
Also used : HabitRepEtl(com.robertsanek.data.etl.remote.scrape.toodledo.HabitRepEtl) SecretProvider(com.robertsanek.util.SecretProvider) Named(com.google.inject.name.Named) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 Named (com.google.inject.name.Named)1 HabitRepEtl (com.robertsanek.data.etl.remote.scrape.toodledo.HabitRepEtl)1 SecretProvider (com.robertsanek.util.SecretProvider)1