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

apoc.export.util.DurationValueSerializer 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 org.neo4j.values.storable.DurationValue;

import java.io.IOException;

public class DurationValueSerializer extends JsonSerializer {

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy