Replace get() and set() to getValue() and setValue() (property delegates)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
package foo
|
||||
|
||||
object NumberDecrypter {
|
||||
fun get(instance: Any?, data: PropertyMetadata) = when (data.name) {
|
||||
fun getValue(instance: Any?, data: PropertyMetadata) = when (data.name) {
|
||||
"four" -> 4
|
||||
"two" -> 2
|
||||
else -> throw Exception()
|
||||
|
||||
+2
-2
@@ -4,11 +4,11 @@ package foo
|
||||
object Delegate {
|
||||
var value = "lol"
|
||||
|
||||
fun get(instance: Any?, data: PropertyMetadata): String {
|
||||
fun getValue(instance: Any?, data: PropertyMetadata): String {
|
||||
return value
|
||||
}
|
||||
|
||||
fun set(instance: Any?, data: PropertyMetadata, newValue: String) {
|
||||
fun setValue(instance: Any?, data: PropertyMetadata, newValue: String) {
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user