getString

open fun getString(key: String): String

Method to get from JSONObject a string value

Return

value as String, if it is not exist will return null value

Parameters

key

: key of string value to get from json

Throws

: when this exception has been trowed will be returned null as default value


open fun getString(key: String, defValue: String): String

Method to get from JSONObject a string value

Return

value as String, if it is not exist will return defValue

Parameters

key

: key of string value to get from json

defValue

: default value to return if primary value not exists

Throws

: when this exception has been trowed will be returned null as default value


open fun getString(jsonDetails: JSONObject, key: String): String

Method to get from JSONObject a string value

Return

value as String, if it is not exist will return null value

Parameters

jsonDetails

: "JSON" from fetch data

key

: key of string value to get from json

Throws

: when this exception has been trowed will be returned null as default value


open fun getString(jsonDetails: JSONObject, key: String, defValue: String): String

Method to get from JSONObject a string value

Return

value as String, if it is not exist will return defValue

Parameters

jsonDetails

: "JSON" from fetch data

key

: key of string value to get from json

defValue

: default value to return if primary value not exists

Throws

: when this exception has been trowed will be returned null as default value


open fun getString(index: Int): String

Method to get from JSONArray a string value

Return

value as String, if it is not exist will return null value

Parameters

index

: index of string value to get from json


open fun getString(index: Int, defValue: String): String

Method to get from JSONArray a string value

Return

value as String, if it is not exist will return defValue

Parameters

index

: index of string value to get from json

defValue

: default value to return if primary value not exists


open fun getString(jsonDetails: JSONArray, index: Int): String

Method to get from JSONArray a string value

Return

value as String, if it is not exist will return null value

Parameters

jsonDetails

: "JSON" from fetch data

index

: index of string value to get from json


open fun getString(jsonDetails: JSONArray, index: Int, defValue: String): String

Method to get from JSONObject a string value

Return

value as String, if it is not exist will return defValue

Parameters

jsonDetails

: "JSON" from fetch data

index

: key of string value to get from json

defValue

: default value to return if primary value not exists