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: Estrella Humphrey
date: 2014-12-11 15:04:25.280000000

Change has been successfully cherry-picked as 8b29f69c8e7a8e968ffc2fa566d257e3f253d510

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