Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spliterator support in JsonNode #4865

Merged
merged 11 commits into from
Dec 31, 2024

Conversation

pjfanning
Copy link
Member

relates to FasterXML/jackson-core#1369

  • Probably needs the jackson-core PR merged first.
  • I can add test coverage in a follow up PR or add it here if preferred.
  • the initial state of the PR is for discussion about the source changes

*
* @since 3.0
*/
public Spliterator<JsonNode> elementsSpliterator() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on valueStream() method, should probably be value(s?)Spliterator()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on valueSpliterator.

* for object nodes; empty spliterator (no contents) for other types
* @since 3.0
*/
public Spliterator<Map.Entry<String, JsonNode>> fieldsSpliterator() {
Copy link
Member

@cowtowncoder cowtowncoder Dec 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.0 uses term "property" everywhere, all references to "field" are changed elsewhere, although looks like JsonNode missed one such change.
I will need to remove method fields()

For the combination of property name and value, "entry" is used in JsonNode, see entryStream().

So should be entrySpliterator()?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let me think about this one: I may have chosen wrong term: instead "entry" should really use "property"/"properties, as per:

https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-6

will change entryStream to propertyStream(); and then we should have propertySpliterator.
Or, if we are decide to go with plurals, propertiesSpliterator().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singular it is: will change to propertySpliterator(). Similar for value case.

@cowtowncoder cowtowncoder merged commit 084df3d into FasterXML:master Dec 31, 2024
6 checks passed
@cowtowncoder cowtowncoder changed the title add spliterator support to TreeNode implementations Add spliterator support to TreeNode implementations Dec 31, 2024
@cowtowncoder cowtowncoder added this to the 3.0.0 milestone Dec 31, 2024
@cowtowncoder cowtowncoder changed the title Add spliterator support to TreeNode implementations Add spliterator support in JsonNode Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants