org.jetbrains.kotlinx.ggdsl.ir.data.ColumnPointer.kt Maven / Gradle / Ivy
package org.jetbrains.kotlinx.ggdsl.ir.data
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.buildClassSerialDescriptor
import kotlinx.serialization.descriptors.element
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
// todo nullable? ktype
/**
* Pointer to the data source - a column in the table with the corresponding name.
*
* @param T a type of column
* @property name the name of column in the table
*/
@Serializable(with=CPSerializer::class)
public data class ColumnPointer(val name: String)
public object CPSerializer: KSerializer> {
override val descriptor: SerialDescriptor = buildClassSerialDescriptor("ColumnPointer") {
element("name")
}
override fun deserialize(decoder: Decoder): ColumnPointer<*> {
return ColumnPointer(decoder.decodeString())
}
override fun serialize(encoder: Encoder, value: ColumnPointer<*>) {
encoder.encodeString(value.name)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy