In the meantime you can swap out the interface wit...
# getting-started
b
In the meantime you can swap out the interface with a lambda reference (i.e.
public void callingMethod(TestInterface interface)
to
fun callingMethod(lambda: (string) -> String)
👍 1
r
Or to keep the naming convention:
fun callingMethod(apply: (String) -> String)
👍 1
n
doesn't really work in many cases
for example you need to pass a list of implementations as a parameter
there are restrictions you have based on the code design you choose
b
If you need some cases that need the
TestInterface
you can keep the original interface method and create a new one that takes a lambda (for those use cases) which then does the conversion to the Interface method (so you only have 1 path)
n
yup.... saw it in the thread you linked ... and also posted below, with a slight mistake
thanks for the help
b
You’re welcome 🙂