Delegate
class Delegate
A simple demonstration class for a delegated property.
This class implements the getValue and setValue operator functions, allowing its instances to be used as delegates for var properties of type String.
Example of usage:
class Example {
var p: String by Delegate()
}
val e = Example()
println(e.p) // Prints: "Example@..., thank you for delegating 'p' to me"
e.p = "NEW" // Prints: "NEW has been assigned to 'p' in Example@..."Content copied to clipboard