-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
(note: part of JSTEP-3 work)
Currently use of Tree Model with Java 8 Streams is bit more complicated than necessary, since there are no java.util.stream.Stream
producing methods in JsonNode
. But it should be straight-forward at methods as follows:
Stream<JsonNode> JsonNode.valueStream()
: forArrayNode
returnStream
of all elementJsonNode
s; forObjectNode
returnStream
of all values of child entries; for other nodes emptyStream
Stream<Map.Entry> JsonNode.propertyStream()
: forObjectNode
returnStream
of all properties (name, value pairs); for other nodes emptyStream
void JsonNode.forEachEntry(BiConsumer<String, JsonNode>)
: forObjectNode
calls consumer with all entries; for other nodes does nothing.
In future we could also consider some of:
- "parallel" stream variants (for
valueStream()
,propertyStream()
) - "spliterator" for value/property streams
But let's start with the simplest cases first.
Metadata
Metadata
Assignees
Labels
2.19Issues planned at 2.19 or laterIssues planned at 2.19 or later