This commit is contained in:
Norbi Peti 2016-08-02 15:10:39 +02:00
parent e7a711bde5
commit 8068b292cf
3 changed files with 13 additions and 4 deletions

View file

@ -14,6 +14,7 @@ public class LoaderCollection<T extends ChatDatabaseEntity> implements List<T>,
private static final long serialVersionUID = 5426152406394894301L;
private List<Long> contacts;
private Class<T> cl;
private transient boolean forsave = false;
/**
* Only used for serialization
@ -39,7 +40,10 @@ public class LoaderCollection<T extends ChatDatabaseEntity> implements List<T>,
@Override
public Iterator<T> iterator() {
return new LoaderIterator<T>(contacts.iterator(), cl);
if (forsave)
return contacts.iterator(); // TODO: Fix
else
return new LoaderIterator<T>(contacts.iterator(), cl);
}
@Override
@ -205,4 +209,12 @@ public class LoaderCollection<T extends ChatDatabaseEntity> implements List<T>,
sb.append("]");
return sb.toString();
}
public boolean isForsave() {
return forsave;
}
public void setForsave(boolean forsave) {
this.forsave = forsave;
}
}

View file

@ -1,8 +1,6 @@
package io.github.norbipeti.chat.server.data;
import java.util.Iterator;
import java.util.ListIterator;
import io.github.norbipeti.chat.server.db.domain.ChatDatabaseEntity;
public final class LoaderIterator<T extends ChatDatabaseEntity> implements Iterator<T> {

View file

@ -1,7 +1,6 @@
package io.github.norbipeti.chat.server.db.domain;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;