In java if I want to intercept the method calls on a class I can use Proxy.newProxyInstance()
and provide an InvocationHandler
implementing invoke()
.
I've seen that in kotlin you can use delegated properties to kind of intercept property access.
Is there any feature of kotlin that could be used to provide similar functionality for methods?