This repository was archived by the owner on Jan 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/kotlin/com/mapk/krowmapper Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -81,17 +81,18 @@ internal sealed class ParameterForMap {
81
81
}
82
82
}
83
83
84
- private fun KParameter.getDeserializer (): AbstractKColumnDeserializer <* , * , * >? {
84
+ @Suppress(" UNCHECKED_CAST" )
85
+ private fun <T : Any > ValueParameter<T>.getDeserializer (): AbstractKColumnDeserializer <* , * , T >? {
85
86
val deserializers = this .annotations.mapNotNull { paramAnnotation ->
86
87
paramAnnotation.annotationClass
87
88
.findAnnotation<KColumnDeserializeBy >()
88
89
?.let { it.deserializer.primaryConstructor!! .call(paramAnnotation) }
89
90
}
90
91
91
92
if (1 < deserializers.size)
92
- throw IllegalArgumentException (" Find multiple deserializer from ${(this .type.classifier as KClass < * > ).jvmName} " )
93
+ throw IllegalArgumentException (" Find multiple deserializer from ${(this .requiredClazz ).jvmName} " )
93
94
94
- return deserializers.singleOrNull()
95
+ return deserializers.singleOrNull() as AbstractKColumnDeserializer < * , * , T > ?
95
96
}
96
97
97
98
private fun <T : Any > KClass<T>.getDeserializer (): KFunction <T >? {
You can’t perform that action at this time.
0 commit comments