본문
171208(금) - @Qualifiers
Mobile/RxJava2 2017. 12. 8. 15:01
@Qualifiers
- type 만으로 dependency를 판별하기에는 부족하다.
- interest field or parameter에 적용
class ExpensiveCoffeeMaker {
@Inject @Named("water") Heater waterHeater;
@Inject @Named("hot plate") Heater hotPlateHeater;
...
}
@Provides @Named("hot plate") static Heater provideHotPlateHeater() {
return new ElectricHeater(70);
}
@Provides @Named("water") static Heater provideWaterHeater() {
return new ElectricHeater(93);
}
'Mobile > RxJava2' 카테고리의 다른 글
171211(월) - @Volatile (0) | 2017.12.11 |
---|---|
171211(월) - @Target (0) | 2017.12.11 |
171206(수) - @Scope, @Retention (0) | 2017.12.06 |
170904(월) - RxJava2 (Infinite scroll with RxJava2, Kotlin) (0) | 2017.09.04 |
160812(금) - RxJava (0) | 2016.08.12 |
댓글