I am learning Dagger 2 for Android and implementin...
# dagger
s
I am learning Dagger 2 for Android and implementing it in my Android app in Kotlin. What is the equivalent of
RetentionPolicy.CLASS
in Kotlin?
Copy code
@Scope
@Retention(RetentionPolicy.CLASS)
public @interface ActivityScope {
}
to
Copy code
@Scope
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
annotation class ActivityScope
I see three options
RUNTIME
,
BINARY
, and
SOURCE
. Edit: - I suppose it is the
SOURCE
.
AnnotationRetention.SOURCE
- Annotation isn't stored in binary output.
RetentionPolicy.CLASS
- Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at run time.