<Kotlin - Refactor common code inside lambdas for ...
# stackoverflow
u
Kotlin - Refactor common code inside lambdas for classes implementing same interface I have two classes(Class1 and Class2) which implements an interface(SampleInterface). The two classes represent DB models which has common fields but different series (InfluxDB). I'm trying to access the class properties inside lambdas and apply functions. Even though they have a common interface, Kotlin does not allow to use the properties without type checking. public interface SampleInterface { String school = ""; String mark = ""; Double num1 = 0d; Double num2 = 0d; }...