Last active
November 15, 2020 09:04
-
-
Save arifvn/4b4030a35c14a982e5d950997102cf79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Delegate : ReadWriteProperty<Any, String> { | |
private var stringResult: String = "" | |
override fun getValue(thisRef: Any, property: KProperty<*>): String = | |
stringResult | |
override fun setValue(thisRef: Any, property: KProperty<*>, value: String) { | |
val formatedString = "${property.name}'s value is $value" | |
stringResult = formatedString.toLowerCase().capitalize() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment