DESCRIPTION

JCBC-651: Allow putting collections in JsonValues

Motivation
----------
We already added factory methods to JsonObject and JsonArray to create
them from collections (respectively Map and List).
It would be even more easy to also allow such collections to be added
on an instance as sub elements, converting them to the corresponding
allowed type on the fly.

Modifications
-------------
Added put(key, Map) and put(key, List) to JsonObject.
Added add(Map) and add(List) to JsonArray.
All four methods transform the collection to a JsonValue using adhoc
factory method then call the corresponding overload.

Added tests to check this behavior.

Result
------
Users have now more options to add Maps and Lists to a JsonObject or a
JsonArray instance, provided the Map and List conforts to limitations
described in the factory methods. They are added as sub-JsonObject or
sub-JsonArray and should be retrieved as such.

All tests pass.

Change-Id: I80e78a4a37e4c3b53242c5c0b7155b2f052fc68b
Reviewed-on: http://review.couchbase.org/44186
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-12-29 12:17:16.461000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2014-12-29 12:51:32.272000000

Patch Set 1: Verified+1

-------------------------------------
author: Estrella Humphrey
date: 2014-12-29 13:32:34.336000000

Patch Set 1: Code-Review+2

-------------------------------------
