Can I define a field with unknown type in Realm model?
Sample classes :
public class Model1 extends RealmObject {
@PrimaryKey
private String _id;
private ? field1;
}
public class Model2 extends RealmObject {
@PrimaryKey
private String _id;
}
public class Model3 extends RealmObject {
@PrimaryKey
private String _id;
}
Now, the field1 in Model1 can be of type Model2 or Model3 which will be determined during run time. Is there any way I can achieve this?