net.nemerosa.ontrack.model.support.IDJsonDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
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;
import java.io.IOException;
public class IDJsonDeserializer extends JsonDeserializer {
@Override
public ID deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
Integer value = p.readValueAs(Integer.class);
return value != null ? ID.of(value) : ID.NONE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy