TokenizingSerializer

object TokenizingSerializer : KSerializer<Any?>

KotlinX serializer that automatically converts non-primitive values to string tokens on serialization, and automatically replaces string tokens with the real Kotlin/JVM objects they represent on detokenization.

I tested the serialization function, but I'm not sure it's actually used anywhere since I think PathElements (which use it for params) are only ever received and not sent.

Adapted from https://stackoverflow.com/a/66158603/12260302

Functions

deserialize
Link copied to clipboard
open override fun deserialize(decoder: Decoder): Any?
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
serialize
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: Any?)
toString
Link copied to clipboard
open fun toString(): String

Properties

dataTypeSerializers
Link copied to clipboard
private val dataTypeSerializers: Map<String, KSerializer<Any?>>

Only these types will be serialized. Everything else will be replaced with a string key from InstanceTokenizer.

descriptor
Link copied to clipboard
open override val descriptor: SerialDescriptor

Sources

jvm source
Link copied to clipboard