mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
JSONObject and JSONArray initialization:
JSONObject(Map<String, ?> map) allows to initialize the JSONObject with a Map<String, String> JSONArray(Collection<?> collection) allows to initialize a JSONArray with a Collection<JSONObject>
This commit is contained in:
parent
b0191a6acf
commit
0afd26623c
2 changed files with 7 additions and 5 deletions
|
@ -151,10 +151,10 @@ public class JSONArray implements Iterable<Object> {
|
|||
* @param collection
|
||||
* A Collection.
|
||||
*/
|
||||
public JSONArray(Collection<Object> collection) {
|
||||
public JSONArray(Collection<?> collection) {
|
||||
this.myArrayList = new ArrayList<Object>();
|
||||
if (collection != null) {
|
||||
Iterator<Object> iter = collection.iterator();
|
||||
Iterator<?> iter = collection.iterator();
|
||||
while (iter.hasNext()) {
|
||||
this.myArrayList.add(JSONObject.wrap(iter.next()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue