RichUtils / pyxis.uzuki.live.richutilskt.utils / org.json.JSONArray

Extensions for org.json.JSONArray

forEach

fun JSONArray.forEach(action: (JSONObject) -> Unit): Unit
fun JSONArray.forEach(action: F1<JSONObject>): Unit

invoke action every JSONObject

getJSONBoolean

fun JSONArray.getJSONBoolean(index: Int, def: Boolean = false): Boolean

get Boolean from JSONArray

getJSONDouble

fun JSONArray.getJSONDouble(index: Int, def: Double = 0.toDouble()): Double

get Double from JSONArray

getJSONInt

fun JSONArray.getJSONInt(index: Int, def: Int = 0): Int

get Int from JSONArray

getJSONLong

fun JSONArray.getJSONLong(index: Int, def: Long = 0.toLong()): Long

get Long from JSONArray

getJSONString

fun JSONArray.getJSONString(index: Int, def: String = ""): String

get String from JSONArray

toList

fun JSONArray.toList(): List<JSONObject>

convert JSONArray to List