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

net.optionfactory.spring.time.jackson.adapters.OffsetDateTimeAsIsoString Maven / Gradle / Ivy

There is a newer version: 13.0
Show newest version
package net.optionfactory.spring.time.jackson.adapters;

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.OffsetDateTime;
import java.time.format.DateTimeFormatter;

public class OffsetDateTimeAsIsoString extends JsonSerializer {

    @Override
    public void serialize(OffsetDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeString(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy