Skip to content

Commit 18174e1

Browse files
committed
made adjustems to IdMap to allow IdMap Merge
1 parent b5432f2 commit 18174e1

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/main/java/de/uniks/networkparser/IdMap.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,11 +1627,34 @@ else if (item instanceof Iterable<?>) {
16271627
this.withCreator((SendableEntityCreator) value);
16281628
}
16291629
}
1630+
if(item instanceof IdMap) {
1631+
IdMap oldIDMap = (IdMap) item;
1632+
this.withSession(oldIDMap.getSession());
1633+
this.withTimeStamp(oldIDMap.getTimeStamp());
1634+
SimpleKeyValueList<String, Object> objects = oldIDMap.getKeyValue();
1635+
for(int z=0;z<objects.size();z++) {
1636+
String id = objects.get(z);
1637+
Object value = objects.getValueByIndex(z);
1638+
this.put(id, value);
1639+
}
1640+
this.withGrammar(oldIDMap.getGrammar());
1641+
this.withFilter(oldIDMap.getFilter());
1642+
1643+
this.withListener(oldIDMap.getUpdateListener());
1644+
}
16301645
}
16311646
}
16321647
return true;
16331648
}
16341649

1650+
public Filter getFilter() {
1651+
return filter;
1652+
}
1653+
1654+
public ObjectCondition getUpdateListener() {
1655+
return updateListener;
1656+
}
1657+
16351658
public IdMap withTimeStamp(long newValue) {
16361659
this.timeStamp = newValue;
16371660
return this;

0 commit comments

Comments
 (0)