feat: update demo

This commit is contained in:
2025-07-06 19:45:04 +08:00
parent 3714ea56d5
commit 9e6e223d73

View File

@@ -22,6 +22,7 @@
package com.highcapable.kavaref.demo package com.highcapable.kavaref.demo
import com.highcapable.kavaref.KavaRef import com.highcapable.kavaref.KavaRef
import com.highcapable.kavaref.KavaRef.Companion.asResolver
import com.highcapable.kavaref.KavaRef.Companion.resolve import com.highcapable.kavaref.KavaRef.Companion.resolve
import com.highcapable.kavaref.demo.test.Test import com.highcapable.kavaref.demo.test.Test
import com.highcapable.kavaref.runtime.KavaRefRuntime import com.highcapable.kavaref.runtime.KavaRefRuntime
@@ -43,7 +44,7 @@ fun main() {
parameters(String::class) parameters(String::class)
}.of(test).invoke("reflection test") }.of(test).invoke("reflection test")
// (2) Call from Object. // (2) Call from Object.
test.resolve() test.asResolver()
.firstMethod { .firstMethod {
name = "test" name = "test"
parameters(String::class) parameters(String::class)
@@ -56,7 +57,7 @@ fun main() {
type = String::class type = String::class
}.of(test).set("Hello modified reflection test") }.of(test).set("Hello modified reflection test")
// (2) Call from Object. // (2) Call from Object.
test.resolve() test.asResolver()
.firstField { .firstField {
name = "myTest" name = "myTest"
type = String::class type = String::class
@@ -69,7 +70,7 @@ fun main() {
emptyParameters() emptyParameters()
}.of(test).invoke<String>() }.of(test).invoke<String>()
// (2) Call from Object. // (2) Call from Object.
val testString2 = test.resolve() val testString2 = test.asResolver()
.firstMethod { .firstMethod {
name = "getTest" name = "getTest"
emptyParameters() emptyParameters()