Skip to content

Commit 003be56

Browse files
Maximillian ArrudaMaximillian Arruda
authored andcommitted
refactor: replace Stream.collector(Collectors.toList()) to Stream.toList()
Signed-off-by: Maximillian Arruda <[email protected]>
1 parent 34b054a commit 003be56

File tree

1 file changed

+3
-3
lines changed
  • jnosql-mongodb/src/main/java/org/eclipse/jnosql/databases/mongodb/communication

1 file changed

+3
-3
lines changed

jnosql-mongodb/src/main/java/org/eclipse/jnosql/databases/mongodb/communication/MongoDBUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static Object convert(Value value) {
5858
}
5959
if (isSudDocumentList(val)) {
6060
return StreamSupport.stream(Iterable.class.cast(val).spliterator(), false)
61-
.map(MongoDBUtils::getMap).collect(toList());
61+
.map(MongoDBUtils::getMap).toList();
6262
}
6363
return val;
6464
}
@@ -70,7 +70,7 @@ public static List<org.eclipse.jnosql.communication.document.Document> of(Map<St
7070
Object value = values.get(key);
7171
return getDocument(key, value);
7272
};
73-
return values.keySet().stream().filter(isNotNull).map(documentMap).collect(Collectors.toList());
73+
return values.keySet().stream().filter(isNotNull).map(documentMap).toList();
7474
}
7575

7676
private static org.eclipse.jnosql.communication.document.Document getDocument(String key, Object value) {
@@ -80,7 +80,7 @@ private static org.eclipse.jnosql.communication.document.Document getDocument(St
8080
List<List<org.eclipse.jnosql.communication.document.Document>> documents = new ArrayList<>();
8181
for (Object object : Iterable.class.cast(value)) {
8282
Map<?, ?> map = Map.class.cast(object);
83-
documents.add(map.entrySet().stream().map(e -> getDocument(e.getKey().toString(), e.getValue())).collect(toList()));
83+
documents.add(map.entrySet().stream().map(e -> getDocument(e.getKey().toString(), e.getValue())).toList());
8484
}
8585
return org.eclipse.jnosql.communication.document.Document.of(key, documents);
8686
}

0 commit comments

Comments
 (0)