Guest User

Untitled

a guest
Feb 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. @MustBeDocumented
  2. @Target(AnnotationTarget.CLASS)
  3. @Retention(AnnotationRetention.RUNTIME)
  4. annotation class MyAnnotation
  5.  
  6. abstract class MyFactory<in t: Any> {
  7. ...
  8. abstract fun genericMethod(model: T): Int
  9. ...
  10. }
  11.  
  12. class MyFactoryImplementation<MyAnnotationType> {
  13. ...
  14. override fun genericMethod(model: MyAnnotation): Int {
  15. return when (model) {
  16. is UsesAnnotation -> 1
  17. else -> 0
  18. }
  19. ...
  20. }
  21.  
  22. @MyAnnotation
  23. class UsesAnnotation
Add Comment
Please, Sign In to add comment