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 +6
-6
lines changed
src/main/kotlin/com/wrongwrong/mapk/core Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ class KMapper<T: Any>(private val function: KFunction<T>, propertyNameConverter:
9797 }
9898}
9999
100+ private fun Collection <KProperty1 <* , * >>.filterTargets (): Collection <KProperty1 <* , * >> {
101+ return filter {
102+ it.visibility == KVisibility .PUBLIC && it.annotations.none { annotation -> annotation is KPropertyIgnore }
103+ }
104+ }
105+
100106private fun <T : Any > getTarget (clazz : KClass <T >): KFunction <T > {
101107 val constructors: List <KFunction <T >> = clazz.constructors
102108 .filter { it.annotations.any { annotation -> annotation is KConstructor } }
@@ -108,12 +114,6 @@ private fun <T : Any> getTarget(clazz: KClass<T>): KFunction<T> {
108114 throw IllegalArgumentException (" Find multiple target." )
109115}
110116
111- private fun Collection <KProperty1 <* , * >>.filterTargets (): Collection <KProperty1 <* , * >> {
112- return filter {
113- it.visibility == KVisibility .PUBLIC && it.annotations.none { annotation -> annotation is KPropertyIgnore }
114- }
115- }
116-
117117private fun <T : Any , R : Any > mapObject (param : ParameterForMap <R >, value : T ): Any? {
118118 val valueClazz: KClass <* > = value::class
119119 val creator: ((T ) -> Any? )? by lazy {
You can’t perform that action at this time.
0 commit comments