One interface is 'org.springframework.data.domain.Persistable', it's a java interface with a method ID getId()
in 3rd-party lib.
Another interface is a Kotlin interface interface IdEntry { val id: String}
.
Now my business entry needs to implement these two interfaces:
data class MyEntry(
override val id: String,
....// more properties
) : IdEntry, Persistable<String>
I use IntelliJ IDE to code and the error is:
Class 'MyEntry' is not abstract and does not implement abstract member
@Nullable public abstract fun getId(): String!
defined in org.springframework.data.domain.Persistable
How can I fix this?
I also tried below code: (idea from here)
data class MyEntry(
private val id: String,
....// more properties
) : IdEntry, Persistable<String> {
override fun getId() = id
...
}
But this also failed:
Cannot weaken access privilege 'public' for 'id' in 'IdEntry'