treatsAsInt

fun JsonElement?.treatsAsInt(defValue: Int = 0): Int

Method used to treats a JsonElement value as null-safe Int

Return

the JsonElement as null-safe Int

Parameters

defValue

The default value to return if the JsonElement is null or is not a Int value