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

Commit f3072db

Browse files
committed
マッピング用のクラスを追加
1 parent 4f2a569 commit f3072db

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ private sealed class ParameterProcessor {
6262
override fun process(value: Any): Any? = converter.call(value)
6363
}
6464

65+
class UseKMapper(private val kMapper: KMapper<*>) : ParameterProcessor() {
66+
override fun process(value: Any): Any? = kMapper.map(value, PARAMETER_DUMMY)
67+
}
68+
69+
@Suppress("UNCHECKED_CAST")
70+
class UseBoundKMapper<T : Any>(private val boundKMapper: BoundKMapper<T, *>) : ParameterProcessor() {
71+
override fun process(value: Any): Any? = boundKMapper.map(value as T)
72+
}
73+
6574
class ToEnum(private val javaClazz: Class<*>) : ParameterProcessor() {
6675
override fun process(value: Any): Any? = EnumMapper.getEnum(javaClazz, value as String)
6776
}

0 commit comments

Comments
 (0)