This file contains hidden or 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 Car { | |
var name:String by Delegate() | |
var brand:String by Delegate() | |
var origin:String by Delegate() | |
} |
This file contains hidden or 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() | |
} |
This file contains hidden or 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
{ | |
"employees":[ | |
{ | |
"name" : { | |
"firstName" : "mahera", | |
"lastName" : "abdi" | |
}, | |
"isActive" : true, | |
"age" : 21, | |
"active" : [ "Monday", "Tuesday" ], |
NewerOlder