This repository was archived by the owner on Jan 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
src/main/kotlin/com/mapk/kmapper Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,7 @@ internal sealed class BoundParameterForMap<S> {
3838 private val kMapper : KMapper <* >
3939 ) : BoundParameterForMap<S>() {
4040 // 1引数で呼び出すとMap/Pairが適切に処理されないため、2引数目にダミーを噛ませている
41- override fun map (src : S ): Any? = kMapper.map(propertyGetter.invoke(src), dummy)
42-
43- companion object {
44- private val dummy = " " to null
45- }
41+ override fun map (src : S ): Any? = kMapper.map(propertyGetter.invoke(src), PARAMETER_DUMMY )
4642 }
4743
4844 private class UseBoundKMapper <S : Any , T : Any >(
Original file line number Diff line number Diff line change @@ -52,3 +52,6 @@ private fun <T : Any> convertersFromCompanionObject(clazz: KClass<T>): Set<Pair<
5252// 引数の型がconverterに対して入力可能ならconverterを返す
5353internal fun <T : Any > Set <Pair <KClass <* >, KFunction<T>>>.getConverter (input : KClass <out T >): KFunction <T >? =
5454 this .find { (key, _) -> input.isSubclassOf(key) }?.second
55+
56+ // 再帰的マッピング時にKMapperでマップする場合、引数の数が1つだと正常にマッピングが機能しないため、2引数にするために用いるダミー
57+ internal val PARAMETER_DUMMY = " " to null
You can’t perform that action at this time.
0 commit comments