Example usage for org.json.simple JSONArray toArray

List of usage examples for org.json.simple JSONArray toArray

Introduction

In this page you can find the example usage for org.json.simple JSONArray toArray.

Prototype

@SuppressWarnings("unchecked")
public <T> T[] toArray(T[] a) 

Source Link

Document

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.

Usage

From source file:semRewrite.InterpreterWSDBatchTest.java

@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> prepare() {
    return JsonReader.transform("resources/interpreter_wsd_batch.json", (JSONObject jo) -> {
        String input = (String) jo.get("input");
        JSONArray test = (JSONArray) jo.get("test");
        return new Object[] { input, test.toArray(new String[] {}) };
    });//from w w  w  .  j  a va2s .  c  o  m
}