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

org.chobit.commons.json.LocalDateTimeSerializer Maven / Gradle / Ivy

The newest version!
package org.chobit.commons.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.chobit.commons.utils.LocalDateKit;

import java.io.IOException;
import java.time.LocalDateTime;

/**
 * @author robin
 */
public class LocalDateTimeSerializer extends JsonSerializer {


    @Override
    public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeString(LocalDateKit.formatTime(value));
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy