toLiteral

fun Any?.toLiteral(enumEntryName: (Enum<*>) -> String = { it.name }): Literal?(source)

Converts this Kotlin value to a Literal, or returns null if it has no JSON representation (e.g. a non-finite decimal).

Enums are converted by enumEntryName; elements and entries that can't be converted are dropped from collections.