kotlinx-serialization / kotlinx.serialization.json / JsonPrimitive

JsonPrimitive

(common, js, jvm, native) fun JsonPrimitive(value: Boolean?): JsonPrimitive

Convenience method to create JsonPrimitive from given boolean. Returns JsonNull if value is null or JsonPrimitive otherwise

(common, js, jvm, native) fun JsonPrimitive(value: Number?): JsonPrimitive

Convenience method to create JsonPrimitive from given number. Returns JsonNull if value is null or JsonPrimitive otherwise

(common, js, jvm, native) fun JsonPrimitive(value: String?): JsonPrimitive

Convenience method to create JsonPrimitive from given string literal. Returns JsonNull if value is null or JsonPrimitive otherwise