json-processing-spec
  1. json-processing-spec
  2. JSON_PROCESSING_SPEC-38

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-pr
    • Fix Version/s: 1.0-pr
    • Labels:
      None

      Description

      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.
      ----------------

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            jitu
            Reporter:
            jitu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: