All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.ggdsl.ir.data.ColumnPointer.kt Maven / Gradle / Ivy

There is a newer version: 0.4.0-dev-15
Show newest version
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