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

Commit 082edec

Browse files
authored
Merge pull request #29 from k163377/refactors
Refactors.
2 parents c9f2285 + 4616d8d commit 082edec

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/kotlin/com/mapk/annotations/KGetterAlias.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ package com.mapk.annotations
22

33
@Target(AnnotationTarget.PROPERTY_GETTER)
44
@Retention(AnnotationRetention.RUNTIME)
5+
@MustBeDocumented
56
annotation class KGetterAlias(val value: String)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class KMapper<T : Any> private constructor(
4949

5050
val tempBinderArrayList = ArrayList<ArgumentBinder>()
5151

52-
src::class.memberProperties.forEach outer@{ property ->
52+
clazz.memberProperties.forEach outer@{ property ->
5353
// propertyが公開されていない場合は処理を行わない
5454
if (property.visibility != KVisibility.PUBLIC) return@outer
5555

@@ -130,11 +130,11 @@ class KMapper<T : Any> private constructor(
130130
}
131131

132132
private class ArgumentBinder(private val param: ParameterForMap<*>, private val javaGetter: Method) {
133-
fun bindArgument(value: Any, bucket: ArgumentBucket) {
133+
fun bindArgument(src: Any, bucket: ArgumentBucket) {
134134
// 初期化済みであれば高コストな取得処理は行わない
135135
if (!bucket.containsKey(param.param)) {
136136
// javaGetterを呼び出す方が高速
137-
bucket.putIfAbsent(param.param, javaGetter.invoke(value)?.let { param.mapObject(it) })
137+
bucket.putIfAbsent(param.param, javaGetter.invoke(src)?.let { param.mapObject(it) })
138138
}
139139
}
140140
}

0 commit comments

Comments
 (0)