net.nemerosa.ontrack.model.support.IDJsonSerializer 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.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import net.nemerosa.ontrack.model.structure.ID;
import java.io.IOException;
public class IDJsonSerializer extends JsonSerializer {
@Override
public void serialize(ID value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
if (value != null) {
jgen.writeNumber(value.getValue());
} else {
jgen.writeNull();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy