jvmMain.com.huanshankeji.kotlin.reflect.Sealed.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-common-reflect-jvm Show documentation
Show all versions of kotlin-common-reflect-jvm Show documentation
Huanshankeji's common code libraries in Kotlin
The newest version!
package com.huanshankeji.kotlin.reflect
import kotlin.reflect.KClass
// This implementation currently has poor performance (O(depth * size) time complexity).
fun KClass.sealedLeafSubclasses(): List> =
if (isSealed) sealedSubclasses.flatMap { it.sealedLeafSubclasses() }
else listOf(this)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy