-
-
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(): forArrayNodereturnStreamof all elementJsonNodes; forObjectNodereturnStreamof all values of child entries; for other nodes emptyStreamStream<Map.Entry> JsonNode.propertyStream(): forObjectNodereturnStreamof all properties (name, value pairs); for other nodes emptyStreamvoid JsonNode.forEachEntry(BiConsumer<String, JsonNode>): forObjectNodecalls 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