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
Reviewed-on: http://review.couchbase.org/44699
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-12-29 13:39:25.874000000

Change has been successfully cherry-picked as 5d424b2116faa139d4ce30e8093d0d56851103e2

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