I am using Json-Simple in Kotlin.
In what situations could this cast:
val jsonObjectIterable = jsonArray as Iterable<JSONObject>
Become dangerous? jsonArray is a JSONArray object.
I am using Json-Simple in Kotlin.
In what situations could this cast:
val jsonObjectIterable = jsonArray as Iterable<JSONObject>
Become dangerous? jsonArray is a JSONArray object.
Following is rather a simple implementation.
Suppose Your Object is Person
data class Person( val ID: Int, val name: String): Serializable
val gson = Gson()
val persons: Array<Person> = gson.fromJson(responseSTRING, Array<Person>::class.java)
Now persons is an Array of Person