Last active
October 3, 2017 13:25
-
-
Save kobeumut/d0c36381f1cb4755b8f086bfe65aab4d to your computer and use it in GitHub Desktop.
if you only want to use within your restriction you use vetoable
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
//if you only want to use within your restriction you use vetoable | |
var name by vetoable("adali") { property: KProperty<*>, oldValue, newValue -> | |
newValue.startsWith("A") | |
} | |
name = "umut" | |
// # : name = "adali" ->because name not startwith S so | |
name = "Adanalı" | |
// # : name = "adanali" -> that's it | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment