Kris-Gerhard Aabrams
08/07/2020, 6:46 AMLeoColman
08/07/2020, 2:43 PMLeoColman
08/07/2020, 2:48 PMsam
08/07/2020, 3:00 PMKris-Gerhard Aabrams
08/07/2020, 3:21 PMsam
08/07/2020, 3:22 PMKris-Gerhard Aabrams
08/07/2020, 3:22 PMsam
08/07/2020, 3:23 PMsam
08/07/2020, 3:23 PMsam
08/07/2020, 3:23 PMKris-Gerhard Aabrams
08/07/2020, 3:24 PMLeoColman
08/07/2020, 3:24 PMLeoColman
08/07/2020, 3:24 PMKris-Gerhard Aabrams
08/07/2020, 3:24 PMLeoColman
08/07/2020, 3:24 PMKris-Gerhard Aabrams
08/07/2020, 3:25 PMKris-Gerhard Aabrams
08/07/2020, 3:25 PM{
"name": "kotlin.reflect.jvm.internal.KClassImpl",
"allPublicMethods": true,
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allDeclaredConstructors": true
},
{
"name": "kotlin.reflect.KClass",
"allPublicMethods": true,
"allDeclaredFields": true,
"allDeclaredMethods": true,
"allDeclaredConstructors": true
},
Kris-Gerhard Aabrams
08/07/2020, 3:25 PMsam
08/07/2020, 3:26 PMKClassifier
Kris-Gerhard Aabrams
08/07/2020, 3:28 PMKris-Gerhard Aabrams
08/07/2020, 3:28 PMKris-Gerhard Aabrams
08/07/2020, 3:34 PMsam
08/07/2020, 3:40 PMrequire(type.classifier is KClass<*>) { "Only instances of KClass are supported" }
sam
08/07/2020, 3:40 PMKris-Gerhard Aabrams
08/07/2020, 3:45 PMKris-Gerhard Aabrams
08/07/2020, 3:46 PMMyConfig::class.createType().classifier is KClass<*>`
Kris-Gerhard Aabrams
08/07/2020, 3:46 PMKris-Gerhard Aabrams
08/07/2020, 3:47 PMrequire(type.classifier is KClass<*>) { "Only instances of KClass are supported" }
or the actual type that is there is not registered for reflection.sam
08/07/2020, 3:47 PMsam
08/07/2020, 3:47 PMKris-Gerhard Aabrams
08/07/2020, 3:48 PMKris-Gerhard Aabrams
08/07/2020, 3:50 PMLeoColman
08/07/2020, 3:51 PMLeoColman
08/07/2020, 3:51 PMLeoColman
08/07/2020, 3:51 PMsam
08/07/2020, 3:56 PMKris-Gerhard Aabrams
08/07/2020, 3:57 PMsam
08/07/2020, 4:01 PMKris-Gerhard Aabrams
08/17/2020, 8:28 PMOnly instances of KClass are supported [was null]
Kris-Gerhard Aabrams
08/17/2020, 8:46 PMsam
08/24/2020, 2:02 PMsam
08/24/2020, 2:02 PMsam
08/24/2020, 2:02 PM/**
* The declaration of the classifier used in this type.
* For example, in the type `List<String>` the classifier would be the [KClass] instance for [List].
*
* Returns `null` if this type is not denotable in Kotlin, for example if it is an intersection type.
*/
@SinceKotlin("1.1")
public val classifier: KClassifier?
sam
08/24/2020, 2:02 PMKris-Gerhard Aabrams
08/25/2020, 8:58 AMMyCustomConfigClass::class.createType().classifier
works by the wayKris-Gerhard Aabrams
08/25/2020, 8:58 AMKris-Gerhard Aabrams
08/25/2020, 9:00 AMKris-Gerhard Aabrams
08/25/2020, 11:17 AM<http://log.info|log.info>("classifier: " + (Config::class.createType().classifier).toString()) <-- returns value
Config::class.constructors.first().parameters.map {
<http://log.info|log.info>("constructor parameter type: " + (it.type).toString()) <-- returns value
<http://log.info|log.info>("constructor parameter type classifier: " + (it.type.classifier).toString()) <-- returns null
}
Kris-Gerhard Aabrams
08/25/2020, 11:34 AMconstructor parameter type: kotlin.String
constructor parameter type classifier: null
Kris-Gerhard Aabrams
08/25/2020, 1:10 PM