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

com.applitools.utils.Iso8610CalendarSerializer Maven / Gradle / Ivy

There is a newer version: 2.57
Show newest version
package com.applitools.utils;

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

import java.io.IOException;
import java.util.Calendar;

/**
 * Serializes {@link Calendar} instances as an ISO8610 formatted string.
 */
public class Iso8610CalendarSerializer extends JsonSerializer {

    @Override
    public void serialize(Calendar value,
              @SuppressWarnings("SpellCheckingInspection") JsonGenerator jgen,
              SerializerProvider provider) throws IOException {
        jgen.writeString(GeneralUtils.toISO8601DateTime(value));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy