treatsAsBoolean

fun JsonElement?.treatsAsBoolean(defValue: Boolean = false): Boolean

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

Return

the JsonElement as null-safe Boolean

Parameters

defValue

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