getInt

open fun getInt(key: String): Int

Method to get from JSONObject an int value

Return

value as int, if it is not exist will return NUMERIC_DEF_VALUE_IF_MISSED

Parameters

key

: key of int value to get from json

Throws

: when this exception has been thrown will be returned NUMERIC_CLASS_CAST_ERROR_VALUE as default value


open fun getInt(key: String, defValue: Int): Int

Method to get from JSONObject an int value

Return

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

Parameters

key

: key of int value to get from json

defValue

: default value to return if primary value not exists

Throws

: when this exception has been thrown will be returned NUMERIC_CLASS_CAST_ERROR_VALUE as default value


open fun getInt(jsonDetails: JSONObject, key: String): Int

Method to get from JSONObject an int value

Return

value as int, if it is not exist will return NUMERIC_DEF_VALUE_IF_MISSED

Parameters

jsonDetails

: "JSON" from fetch data

key

: key of int value to get from json

Throws

: when this exception has been thrown will be returned NUMERIC_CLASS_CAST_ERROR_VALUE as default value


open fun getInt(jsonDetails: JSONObject, key: String, defValue: Int): Int

Method to get from JSONObject an int value

Return

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

Parameters

jsonDetails

: "JSON" from fetch data

key

: key of int value to get from json

defValue

: default value to return if primary value not exists

Throws

: when this exception has been thrown will be returned NUMERIC_CLASS_CAST_ERROR_VALUE as default value


open fun getInt(index: Int): Int

Method to get from JSONArray an int value

Return

value as int, if it is not exist will return NUMERIC_DEF_VALUE_IF_MISSED

Parameters

index

: index of int value to get from json


open fun getInt(index: Int, defValue: Int): Int

Method to get from JSONArray an int value

Return

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

Parameters

index

: index of int value to get from json

defValue

: default value to return if primary value not exists


open fun getInt(jsonDetails: JSONArray, index: Int): Int

Method to get from JSONArray an int value

Return

value as int, if it is not exist will return NUMERIC_DEF_VALUE_IF_MISSED

Parameters

jsonDetails

: "JSON" from fetch data

index

: index of int value to get from json


open fun getInt(jsonDetails: JSONArray, index: Int, defValue: Int): Int

Method to get from JSONArray an int value

Return

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

Parameters

jsonDetails

: "JSON" from fetch data

index

: index of int value to get from json

defValue

: default value to return if primary value not exists