kotlin-client.jvm-common.infrastructure.AtomicLongAdapter.kt.mustache Maven / Gradle / Ivy
The newest version!
package {{packageName}}.infrastructure
import kotlinx.serialization.KSerializer
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.SerialDescriptor
import java.util.concurrent.atomic.AtomicLong
{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object AtomicLongAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: AtomicLong) {
encoder.encodeLong(value.get())
}
override fun deserialize(decoder: Decoder): AtomicLong = AtomicLong(decoder.decodeLong())
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("AtomicLong", PrimitiveKind.LONG)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy