Skip to content

Commit f1b56fd

Browse files
author
seal
committed
Release version 1.0.1
Update API name
1 parent 62b9f63 commit f1b56fd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This is a tool library for Kotlin to use reflect APIs in Kotlin simply method.It
3232
| changeClassPropertyValueByNameIgnoreType | change the class inner property value to any other type of value |
3333
| getClassPropertyValueByName | get the class inner property value by property name |
3434
| invokeTopMethodByMethodName | invoke the top level method with method name |
35-
| invokeMethodByMethodName | invoke any method with method name |
35+
| invokeClassMethodByMethodName | invoke class obj inner method with method name |
3636
3737
All method don't care what the property or method visibility it is
3838

src/main/kotlin/wu/seal/jvm/kotlinreflecttools/ReflectTools.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fun getTopPropertyValueByName(otherCallableReference: CallableReference, propert
245245
/**
246246
* invoke a method by name from a classObj,no matter whether the property is public ,private or internal
247247
*/
248-
fun invokeMethodByMethodName(classObj: Any, methodName: String, vararg methodArgs: Any?): Any? {
248+
fun invokeClassMethodByMethodName(classObj: Any, methodName: String, vararg methodArgs: Any?): Any? {
249249
val containerClass: Class<*> = classObj::class.java
250250

251251
containerClass.declaredMethods.forEach { method ->

src/test/kotlin/ReflectToolsKtTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class ReflectToolsKtTest {
111111
fun invokeMethodByMethodName() {
112112
val demoObj = TestDemo()
113113
val expectedObjMethodValue = true
114-
val getMethodValue = invokeMethodByMethodName(demoObj, "isMan")
114+
val getMethodValue = invokeClassMethodByMethodName(demoObj, "isMan")
115115

116116
assertEquals(expectedObjMethodValue, getMethodValue)
117117

0 commit comments

Comments
 (0)