Search in sources :

Example 1 with HabitEtl

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

the class ParentModule method habitEtlWill.

@Provides
@Named("will")
HabitEtl habitEtlWill(Injector injector) {
    SecretProvider secretProvider = injector.getInstance(SecretProvider.class);
    HabitEtl habitEtl = new HabitEtl() {

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

        @Override
        public String getPassword() {
            return secretProvider.getSecret(SecretType.TOODLEDO_WILL_PASSWORD);
        }
    };
    injector.injectMembers(habitEtl);
    return habitEtl;
}
Also used : HabitEtl(com.robertsanek.data.etl.remote.scrape.toodledo.HabitEtl) 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 HabitEtl (com.robertsanek.data.etl.remote.scrape.toodledo.HabitEtl)1 SecretProvider (com.robertsanek.util.SecretProvider)1