Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
got re set of class vals to work
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Dec 26, 2019
1 parent f409a71 commit 08c8b98
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/andromeda/araserver/iot/WriteNewVal.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package com.andromeda.araserver.iot

import kotlin.reflect.KClass
import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.memberProperties

class WriteNewVal {
fun main(classToMod: KClass<Any>, actionPair: List<String>?, any: Any) {
classToMod.memberProperties.forEach { member ->
classToMod.memberProperties.filterIsInstance<KMutableProperty<*>>()
.forEach { member ->
if (member.name == actionPair!![0]) {
println(member.name)
println(member.call(any, true))
println(member.setter.call(any, false))
println(member.getter.call(any))

}

Expand Down

0 comments on commit 08c8b98

Please sign in to comment.