i have a marker interface
interface RoomModel
and an entity that implements this interface
@Entity(tableName = "ContentAuthorModule")
ContentAuthorModule : RoomModel {}
now if i have a
List<RoomModel>
how do i check if its a
List<ContentAuthorModule>
I tried to do
roomModels is List<ContentAuthorModule>
override fun saveRoomModels(roomModels: List<RoomModel>) {
when(roomModels) {
is List<ContentAuthorModule> ->
contentAuthorModuleDao.insertAll(roomModels)
}
}
but it gives my a syntax error that says
Cannot check for instance of erased type : List<ContentAuthorModule>
is there another way to do this?