Kotlin Annotation IntDef
<p>I have this code sample:</p>

<pre><code>class MeasureTextView: TextView {
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)

    companion object{
        val UNIT_NONE = -1
        val UNIT_KG = 1
        val UNIT_LB = 0            
    }

    fun setMeasureText(number: Float, unitType: Int){

        val suffix = when(unitType){
            UNIT_NONE -&gt; {
                EMPTY_STRING
            }
            UNIT_KG -&gt; {
                KG_SUFIX
            }
            UNIT_LB -&gt; {
                LB_SUFIX
            }
            else -&gt; throw IllegalArgumentException("Wrong unitType passed to formatter: MeasureTextView.setMeasureText")
        }

        // set the final text
        text = "$number $suffix"
    }
}
</code></pre>

<p>I want to be able to use, at compile time, the auto complete feature in conjunction with IntDef annotation, so when i invoke <code>setMeasureText(...)</code>,
the static variables are shown as options to the argument of this method.</p>

<p>I have searched about this, and i couldn't find if Kotlin supported this java-style annotations (intdef for example). So i have tried it, and made an annotation for this, but it won't show in autocompletion.</p>

<p>My question:
- Is Java annotation IntDef supported in Kotlin (latest version)</p>

<ul>
<li><p>If it is, how can i turn in ON in the Android Studio IDE (if it works, i can't get the compiler to suggest it).</p></li>
<li><p>If it is not, is there any Kotlin-way of make this compile time checks</p></li>
</ul>