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

Commit f95b14f

Browse files
committed
セカンダリコンストラクタ呼び出しのひな型を追加
1 parent 84c5ac1 commit f95b14f

File tree

1 file changed

+8
-0
lines changed
  • src/main/kotlin/com/wrongwrong/mapk/core

1 file changed

+8
-0
lines changed

src/main/kotlin/com/wrongwrong/mapk/core/KMapper.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import kotlin.reflect.full.isSuperclassOf
1111
import kotlin.reflect.full.memberProperties
1212

1313
class KMapper<T: Any>(private val function: KFunction<T>, propertyNameConverter: (String) -> String = { it }) {
14+
constructor(clazz: KClass<T>, propertyNameConverter: (String) -> String = { it }): this(
15+
getTarget(clazz), propertyNameConverter
16+
)
17+
1418
private val parameters: Set<ParameterForMap>
1519

1620
init {
@@ -87,6 +91,10 @@ class KMapper<T: Any>(private val function: KFunction<T>, propertyNameConverter:
8791
}
8892
}
8993

94+
private fun <T : Any> getTarget(clazz: KClass<T>): KFunction<T> {
95+
TODO()
96+
}
97+
9098
private fun Collection<KProperty1<*, *>>.filterTargets(): Collection<KProperty1<*, *>> {
9199
return filter {
92100
it.visibility == KVisibility.PUBLIC && it.annotations.none { annotation -> annotation is PropertyIgnore }

0 commit comments

Comments
 (0)