dhis2 / json-tree

A lazily parsed JSON object tree library
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

feat: better map key/value access #39

Closed jbee closed 9 months ago

jbee commented 9 months ago

Adds Node#keys to only iterate the keys (names) of an object's properties. Based on this the JsonMap implements improved keys(), values() and forEach.

JsonMap#keys no longer returns a Set but a Stream. This is more in line with the virtual tree API as methods based on keys() will also no longer throw a JsonPathException in case the node does not exist. If the not does not exist or is defined null the keys() Stream is empty.