All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.reflect.ReflectionDumper.kt Maven / Gradle / Ivy

There is a newer version: 12.0.0
Show newest version
package ch.softappeal.yass2.reflect

import ch.softappeal.yass2.*
import java.util.concurrent.*
import kotlin.reflect.*
import kotlin.reflect.full.*

public fun KClass<*>.properties(): List> = memberProperties
    .filter { !isSubclassOf(Throwable::class) || (it.name != "cause" && it.name != "message") }
    .sortedBy { it.name }
    .map { @Suppress("UNCHECKED_CAST") (it as KProperty1) }

private val Class2dumperProperties = ConcurrentHashMap, List>>()
public val ReflectionDumperProperties: DumperProperties = { type ->
    Class2dumperProperties.computeIfAbsent(type) { type.properties() }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy