use of org.bson.codecs.pojo.entities.CollectionNestedPojoModel in project mongo-java-driver by mongodb.
the class PojoTestCase method getCollectionNestedPojoModel.
private static CollectionNestedPojoModel getCollectionNestedPojoModel(final boolean useNulls) {
List<SimpleModel> listSimple;
Set<SimpleModel> setSimple;
Map<String, SimpleModel> mapSimple;
if (useNulls) {
listSimple = null;
setSimple = null;
mapSimple = null;
} else {
SimpleModel simpleModel = getSimpleModel();
listSimple = singletonList(simpleModel);
setSimple = new HashSet<SimpleModel>(listSimple);
mapSimple = new HashMap<String, SimpleModel>();
mapSimple.put("s", simpleModel);
}
List<List<SimpleModel>> listListSimple = singletonList(listSimple);
Set<Set<SimpleModel>> setSetSimple = new HashSet<Set<SimpleModel>>(singletonList(setSimple));
Map<String, Map<String, SimpleModel>> mapMapSimple = new HashMap<String, Map<String, SimpleModel>>();
mapMapSimple.put("ms", mapSimple);
Map<String, List<SimpleModel>> mapListSimple = new HashMap<String, List<SimpleModel>>();
mapListSimple.put("ls", listSimple);
Map<String, List<Map<String, SimpleModel>>> mapListMapSimple = new HashMap<String, List<Map<String, SimpleModel>>>();
mapListMapSimple.put("lm", singletonList(mapSimple));
Map<String, Set<SimpleModel>> mapSetSimple = new HashMap<String, Set<SimpleModel>>();
mapSetSimple.put("s", setSimple);
List<Map<String, SimpleModel>> listMapSimple = singletonList(mapSimple);
List<Map<String, List<SimpleModel>>> listMapListSimple = singletonList(mapListSimple);
List<Map<String, Set<SimpleModel>>> listMapSetSimple = singletonList(mapSetSimple);
return new CollectionNestedPojoModel(listSimple, listListSimple, setSimple, setSetSimple, mapSimple, mapMapSimple, mapListSimple, mapListMapSimple, mapSetSimple, listMapSimple, listMapListSimple, listMapSetSimple);
}
Aggregations