1.0.4 #4

Merged
fabio.sinibaldi merged 10 commits from 1.0.4 into master 2021-01-14 17:01:03 +01:00
1 changed files with 15 additions and 8 deletions
Showing only changes of commit b1e88ad283 - Show all commits

View File

@ -4,6 +4,7 @@ import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import org.bson.Document;
import org.bson.types.ObjectId;
@ -105,16 +106,22 @@ public class ConcessioniMongoManager extends MongoManager{
return asConcessione(replace(asDocument(toReturn),collectionName));
}
public List<Concessione> list(){
ArrayList<Concessione> toReturn=new ArrayList<>();
iterate(null, collectionName).forEach((Document d)->{
try {
toReturn.add(asConcessione(d));
}catch(Throwable t) {
log.error("Unable to read Document as concessione ",t);
log.debug("Document was "+d.toJson());
}
});
iterate(null, collectionName).forEach(
new Consumer<Document>() {
@Override
public void accept(Document d) {
try {
toReturn.add(asConcessione(d));
}catch(Throwable t) {
log.error("Unable to read Document as concessione ",t);
log.debug("Document was "+d.toJson());
}
}
});
return toReturn;
}