Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit f4b4afd

Browse files
committed
creator -> converterの変換漏れを修正
1 parent 00a64f7 commit f4b4afd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/com/mapk/kmapper/KMapper.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ private fun <T : Any, R : Any> mapObject(param: ParameterForMap<R>, value: T): A
117117
// パラメータに対してvalueが代入可能(同じもしくは親クラス)であればそのまま用いる
118118
if (param.clazz.isSuperclassOf(valueClazz)) return value
119119

120-
val creator: KFunction<*>? = param.getCreator(valueClazz)
120+
val converter: KFunction<*>? = param.getConverter(valueClazz)
121121

122122
return when {
123-
// creatorに一致する組み合わせが有れば設定されていればそれを使う
124-
creator != null -> creator.call(value)
123+
// converterに一致する組み合わせが有れば設定されていればそれを使う
124+
converter != null -> converter.call(value)
125125
// 要求された値がenumかつ元が文字列ならenum mapperでマップ
126126
param.javaClazz.isEnum && value is String -> EnumMapper.getEnum(param.clazz.java, value)
127127
// 要求されているパラメータがStringならtoStringする

0 commit comments

Comments
 (0)