Hi everyone! I have an interface that is implemented by a few classes and I have a "List<Interface>" that I have to save in my Room DB.
Every class has its own DAO, but I have a BaseDao too which defines Insert/Update/Delete methods for all the other DAOs. At the moment I'm simply filtering the list with the "filterIsInstance" method to get the class of the objects(I'm doing it for every single class that implements the interface) and then I'm calling the specific class DAO to insert/update/delete the entity.
Is there a better way to do this? In particular, I'm pretty sure that I can avoid filtering the list for every type of class but I don't know how