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

apoc.export.util.TemporalSerializer Maven / Gradle / Ivy

There is a newer version: 5.25.1
Show newest version
package apoc.export.util;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.time.temporal.TemporalAccessor;

public class TemporalSerializer extends JsonSerializer {

    @Override
    public void serialize(TemporalAccessor value, JsonGenerator jsonGenerator, SerializerProvider serializers) throws IOException {
        if (value == null) {
            jsonGenerator.writeNull();
        }
        jsonGenerator.writeString(value.toString());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy