You can always have the setters delegate to a more...
# getting-started
f
You can always have the setters delegate to a more complex private function:
Copy code
var myProp: String
    set(value) { field = constrainMyProp(value) }
...
private fun constrainMyProp(value: String): String {
   if(value.isBlank()) throw IllegalArgumentException("myProp must be non-blank.")
    return value + " modification"
}