caipivara
3/4/2016 - 1:34 AM

Android / Kotlin - Typedef Annotations example

Android / Kotlin - Typedef Annotations example

import android.support.annotation.IntDef
import kotlin.annotation.AnnotationRetention

class MyClass {

  companion object {
      const val ITEM_SERVICES = 0L
      const val ITEM_PORTFOLIO = 1L
  }
  
  @IntDef(ITEM_SERVICES, ITEM_PORTFOLIO)
  @Retention(AnnotationRetention.SOURCE)
  annotation class ITEM
  
}