com.geotab.model.serialization.LocalDateTimeSerializer Maven / Gradle / Ivy
/*
*
* 2020 Copyright (C) Geotab Inc. All rights reserved.
*/
package com.geotab.model.serialization;
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.LocalDateTime;
public class LocalDateTimeSerializer extends JsonSerializer {
@Override
public void serialize(LocalDateTime value, JsonGenerator jsonGenerator,
SerializerProvider serializers)
throws IOException {
jsonGenerator.writeString(DateTimeSerializationUtil.localDateTimeToString(value));
}
}