In Hilt, can I reuse `@Qualifier` custom annotatio...
# dagger
m
In Hilt, can I reuse
@Qualifier
custom annotations? For my app I connect to a rest backend as well as an iot device. So I'm making these two annotations
Copy code
@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class Backend

@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class Device
I can use these annotations multiple times for different objects, right? Like use the
@Backend
custom annotation for the Retrofit instance as well as a provided String and maybe some other objects I will need later on.
f
yes you can, every qualifier is reusable, think of
@Singleton
m
yep, makes sense. thank you!
a
Yes, you can differentiate your Retrofit instances using those custom annotations yes
168 Views