Skip to content

Instantly share code, notes, and snippets.

@kobeumut
Last active October 3, 2017 13:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobeumut/d0c36381f1cb4755b8f086bfe65aab4d to your computer and use it in GitHub Desktop.
Save kobeumut/d0c36381f1cb4755b8f086bfe65aab4d to your computer and use it in GitHub Desktop.
if you only want to use within your restriction you use vetoable
//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