JsonValueEncoder

typealias JsonValueEncoder = (value: Any) -> JsonElement?

Implementation may be

if (it is DrivingPrivilege) jsonSerializer.encodeToJsonElement(it) else null