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

net.nemerosa.ontrack.model.support.IDJsonDeserializer.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.JsonParser
import com.fasterxml.jackson.databind.DeserializationContext
import com.fasterxml.jackson.databind.JsonDeserializer
import net.nemerosa.ontrack.model.structure.ID

class IDJsonDeserializer : JsonDeserializer() {
    override fun deserialize(p: JsonParser, ctxt: DeserializationContext): ID {
        val value: Int? = p.readValueAs(Int::class.java)
        return if (value != null) ID.of(value) else ID.NONE
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy