Issue Details (XML | Word | Printable)

Key: JSON_PROCESSING_SPEC-38
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: jitu
Reporter: jitu
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
json-processing-spec

Extend JsonArray with List<JsonValue> and JsonObject with Map<String, JsonValue>

Created: 09/Dec/12 05:05 AM   Updated: 11/Dec/12 12:13 AM   Resolved: 11/Dec/12 12:13 AM
Component/s: None
Affects Version/s: 1.0-pr
Fix Version/s: 1.0-pr

Time Tracking:
Not Specified

Tags:
Participants: jitu


 Description  « Hide

Mark Reinhold's feedback:
----------
Is there a reason that JsonObject
(current name) doesn't implement java.util.Map<String,JsonValue>
directly? It seems awkward to have to invoke a getValues() method
in order to get an actual Map.
------------
My hesistation is Map has mutable methods. He still considers there
is value by implementing these collections. He says:
------------
The mutating methods in the Map interface are all optional; you can just
have them throw UnsupportedOperationException.

Along similar lines, JsonList should implement java.util.List<JsonValue>.

These two changes will make it much easier to leverage the existing
collections framework as well as all the Lambda goodness coming in SE 8.
----------------