trying to get mongo repositories to work with Fongo
@@ -322,6 +322,21 @@ public final class BsonEncoding {
return list.size();
}
+ @Override
+ public Iterator<DBObject> iterator() {
+ return new Iterator<DBObject>() {
+ int i = 0;
+ @Override
+ public boolean hasNext() {
+ return i < list.size();
+ }
+ @Override
+ public DBObject next() {
+ return get(i++);
+ }
+ };
+ }
+
@Override
public Object put(String key, Object v) {
throw new UnsupportedOperationException();
@@ -423,11 +438,6 @@ public final class BsonEncoding {
return false;
}
- @Override
- public Iterator<DBObject> iterator() {
- return ImmutableSet.<DBObject>of().iterator();
- }
-
@Override
public int lastIndexOf(Object o) {
throw new UnsupportedOperationException();
