Skip to content

Instantly share code, notes, and snippets.

@andretietz
Created December 18, 2020 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andretietz/107a46dd01dcfe7e5d852b6e836fc70c to your computer and use it in GitHub Desktop.
Save andretietz/107a46dd01dcfe7e5d852b6e836fc70c to your computer and use it in GitHub Desktop.
Sample for multiple files
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Retention(RUNTIME)
annotation class SomeAnnotation(
val value: String
)
class SomeCustomAdapterFactory(
private val registration: MutableMap<Int, String> = mutableMapOf()
) : CallAdapter.Factory() {
private fun isAnnotated(annotations: Array<Annotation>): SomeAnnotation? {
for (annotation in annotations) {
if (SomeAnnotation::class == annotation.annotationClass) return annotation as SomeAnnotation
}
return null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment