v79

    v79

    4 years ago
    Can reflection tell me if a KClass is an enum or not? There doesn't seem to be an isEnum method.
    b

    beholder

    4 years ago
    Maybe
    kClass.isSubclassOf(Enum::class)
    v79

    v79

    4 years ago
    Thanks. I'll try that out. I hope nobody writes complex nested enums!
    r

    Rafael Chaves

    4 years ago
    On the JVM, you can use java.lang.Class#isEnum()