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

net.nemerosa.ontrack.model.support.IDJsonSerializer.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.support

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.SerializerProvider
import net.nemerosa.ontrack.model.structure.ID

class IDJsonSerializer : JsonSerializer() {

    override fun serialize(value: ID?, jgen: JsonGenerator, provider: SerializerProvider) {
        if (value != null) {
            jgen.writeNumber(value.value)
        } else {
            jgen.writeNull()
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy