getFloat

open fun getFloat(key: String): Float

Method to get from JSONObject a float value

Return

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

Parameters

key

: key of float 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 getFloat(key: String, defValue: Float): Float

Method to get from JSONObject a float value

Return

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

Parameters

key

: key of float 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 getFloat(jsonDetails: JSONObject, key: String): Float

Method to get from JSONObject a float value

Return

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

Parameters

jsonDetails

: "JSON" from fetch data

key

: key of float 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 getFloat(jsonDetails: JSONObject, key: String, defValue: Float): Float

Method to get from JSONObject a float value

Return

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

Parameters

jsonDetails

: "JSON" from fetch data

key

: key of float 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 getFloat(index: Int): Float

Method to get from JSONArray a float value

Return

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

Parameters

index

: index of float value to get from json


open fun getFloat(index: Int, defValue: Float): Float

Method to get from JSONArray a float value

Return

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

Parameters

index

: index of float value to get from json

defValue

: default value to return if primary value not exists


open fun getFloat(jsonDetails: JSONArray, index: Int): Float

Method to get from JSONArray a float value

Return

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

Parameters

jsonDetails

: "JSON" from fetch data

index

: index of float value to get from json


open fun getFloat(jsonDetails: JSONArray, index: Int, defValue: Float): Float

Method to get from JSONArray a float value

Return

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

Parameters

jsonDetails

: "JSON" from fetch data

index

: index of float value to get from json

defValue

: default value to return if primary value not exists