org.cloudfoundry.multiapps.controller.api.model.ZonedDateTimeSerializer Maven / Gradle / Ivy
package org.cloudfoundry.multiapps.controller.api.model;
import java.io.IOException;
import java.time.ZonedDateTime;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
public class ZonedDateTimeSerializer extends StdSerializer {
private static final long serialVersionUID = 1L;
public ZonedDateTimeSerializer() {
super(ZonedDateTime.class);
}
@Override
public void serialize(ZonedDateTime value, JsonGenerator generator, SerializerProvider provider) throws IOException {
if (value != null) {
generator.writeString(Operation.DATE_TIME_FORMATTER.format(value));
} else {
generator.writeNull();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy