toJsonPrimitive

fun Any?.toJsonPrimitive(): JsonPrimitive?

Convert a generic value to a JsonPrimitive with a String, Number or Boolean. If you try to convert a value with another type, a NotImplementedError exception will be thrown.

Return

JsonPrimitive value