Skip to content

Commit c98e5ea

Browse files
committed
feat: update collector working with null
Signed-off-by: Otavio Santana <[email protected]>
1 parent 7a57d72 commit c98e5ea

File tree

1 file changed

+7
-7
lines changed
  • jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication

1 file changed

+7
-7
lines changed

jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBUtil.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ public final class ArangoDBUtil {
4848
public static final String KEY = "_key";
4949
public static final String ID = "_id";
5050
public static final String REV = "_rev";
51-
52-
private static final Function<Object, String> KEY_DOCUMENT = d -> cast(d).name();
53-
private static final Function<Object, Object> VALUE_DOCUMENT = d -> ValueUtil.convert(cast(d).value());
54-
55-
5651
private static final Logger LOGGER = Logger.getLogger(ArangoDBUtil.class.getName());
5752

5853
private static final Function<Map.Entry<?, ?>, Document> ENTRY_DOCUMENT = entry ->
@@ -150,8 +145,13 @@ private static Object convert(Value value) {
150145
}
151146

152147
private static Object getMap(Object val) {
153-
return StreamSupport.stream(Iterable.class.cast(val).spliterator(), false)
154-
.collect(toMap(KEY_DOCUMENT, VALUE_DOCUMENT));
148+
Iterable<?> iterable = Iterable.class.cast(val);
149+
Map<Object, Object> map = new HashMap<>();
150+
for (Object item : iterable) {
151+
var document = cast(item);
152+
map.put(document.name(), document.value());
153+
}
154+
return map;
155155
}
156156

157157
private static boolean isSudDocumentList(Object value) {

0 commit comments

Comments
 (0)