Suppose I have an abstract superclass A
. That class has a property abstract val predicate: (ModelClass) -> Boolean
.
Let B
be a subclass.
I want to be able to do both of the following:
- Use the predicate from an instance
aInstance.predicate
- Also use that predicate elsewhere, without having to create an instance to get that predicate
B.predicate
How can I do this.