Fixes
This commit is contained in:
parent
e7a711bde5
commit
8068b292cf
3 changed files with 13 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue