optionalInt

fun JsonObject.optionalInt(key: String): Int?

Returns the Int value for the given key, or null when the key is absent, the value is JsonNull, or not a primitive.