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

io.github.eduardromanyuk.turbosms.json.LocalDateTimeSerializer Maven / Gradle / Ivy

Go to download

This starter provides infrastructure for using TurboSMS sms/viber provider. HTTP API was used for communication.

The newest version!
package io.github.eduardromanyuk.turbosms.json;

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

public class LocalDateTimeSerializer extends StdSerializer {
    protected LocalDateTimeSerializer() {
        super(LocalDateTime.class);
    }

    @Override
    public void serialize(LocalDateTime value, JsonGenerator json, SerializerProvider provider) throws IOException {
        json.writeString(value.format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm")));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy