intOrNull

val JsonPrimitive.intOrNull: Int?

Returns content of the current element as int or null if current element is not a valid representation of number