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

Commit 20d736d

Browse files
committed
クラス名を修正
1 parent a2c4962 commit 20d736d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/kotlin/com/wrongwrong/mapk/annotations/SingleArgCreator.kt renamed to src/main/kotlin/com/wrongwrong/mapk/annotations/KConverter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ package com.wrongwrong.mapk.annotations
33
@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION)
44
@Retention(AnnotationRetention.RUNTIME)
55
@MustBeDocumented
6-
annotation class SingleArgCreator
6+
annotation class KConverter

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.wrongwrong.mapk.core
22

33
import com.wrongwrong.mapk.annotations.PropertyAlias
4-
import com.wrongwrong.mapk.annotations.SingleArgCreator
4+
import com.wrongwrong.mapk.annotations.KConverter
55
import kotlin.reflect.KClass
66
import kotlin.reflect.KFunction
77
import kotlin.reflect.KParameter
@@ -31,7 +31,7 @@ internal class ParameterForMap(val param: KParameter, propertyNameConverter: (St
3131
}
3232

3333
private fun Collection<KFunction<*>>.getCreatorMapFromFunctions(): Set<Pair<KClass<*>, (Any) -> Any?>> {
34-
return filter { it.annotations.any { annotation -> annotation is SingleArgCreator } }
34+
return filter { it.annotations.any { annotation -> annotation is KConverter } }
3535
.map { func ->
3636
val call = { it: Any ->
3737
func.call(it)
@@ -53,7 +53,7 @@ private fun creatorsFromStaticMethods(clazz: KClass<*>): Set<Pair<KClass<*>, (An
5353
private fun creatorsFromCompanionObject(clazz: KClass<*>): Set<Pair<KClass<*>, (Any) -> Any?>> {
5454
return clazz.companionObjectInstance?.let { companionObject ->
5555
companionObject::class.functions
56-
.filter { it.annotations.any { annotation -> annotation is SingleArgCreator } }
56+
.filter { it.annotations.any { annotation -> annotation is KConverter } }
5757
.map { function ->
5858
val params = function.parameters
5959
if (params.size != 2) {

0 commit comments

Comments
 (0)