com.geotab.model.serialization.IdAsStringSerializer Maven / Gradle / Ivy
package com.geotab.model.serialization;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.geotab.model.Id;
import java.io.IOException;
public class IdAsStringSerializer extends JsonSerializer {
@Override
public void serialize(Id id, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
throws IOException {
jsonGenerator.writeString(id.getId());
}
}