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

ph.com.nightowlstudios.entity.serializer.LocalDateSerializer Maven / Gradle / Ivy

There is a newer version: 6.21.1
Show newest version
package ph.com.nightowlstudios.entity.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

import java.io.IOException;
import java.time.LocalDate;

/**
 * @author Joseph Harvey Angeles - yev
 * @since 8/11/21
 **/
public class LocalDateSerializer extends StdSerializer {

    protected LocalDateSerializer() {
        this(LocalDate.class);
    }

    protected LocalDateSerializer(Class t) {
        super(t);
    }

    @Override
    public void serialize(LocalDate value, JsonGenerator gen, SerializerProvider provider) throws IOException {
        gen.writeString(value.toString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy