[JSON_PROCESSING_SPEC-38] Extend JsonArray with List<JsonValue> and JsonObject with Map<String, JsonValue> Created: 09/Dec/12  Updated: 11/Dec/12  Resolved: 11/Dec/12

Status: Closed
Project: json-processing-spec
Component/s: None
Affects Version/s: 1.0-pr
Fix Version/s: 1.0-pr

Type: Improvement Priority: Major
Reporter: jitu Assignee: jitu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


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.

Comment by jitu [ 11/Dec/12 ]

Fixing it as specified in the issue: JsonArray extends List<JsonValue> and JsonObject extends Map<String, JsonValue>

Generated at Tue Jan 17 03:21:42 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.