Ejemplo n.º 1
0
 /**
  * Sets the reference to a {@link DynamicRealmList} on the given field.
  *
  * @param fieldName the field name.
  * @param list the list of references.
  * @throws IllegalArgumentException if field name doesn't exists, it doesn't contain a list of
  *     links or the type of the object represented by the DynamicRealmObject doesn't match.
  */
 public void setList(String fieldName, DynamicRealmList list) {
   long columnIndex = row.getColumnIndex(fieldName);
   LinkView links = row.getLinkList(columnIndex);
   links.clear();
   for (DynamicRealmObject obj : list) {
     links.add(obj.row.getIndex());
   }
 }
Ejemplo n.º 2
0
 @Override
 public void setClassCategoryIds(RealmList<ClassCategoryIds> value) {
   LinkView links = row.getLinkList(INDEX_CLASSCATEGORYIDS);
   if (value == null) {
     return;
   }
   for (RealmObject linkedObject : (RealmList<? extends RealmObject>) value) {
     links.add(linkedObject.row.getIndex());
   }
 }