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

com.gccloud.starter.common.json.ExtendObjSerializer Maven / Gradle / Ivy

package com.gccloud.starter.common.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.gccloud.starter.common.entity.ExtendObj;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * 序列化
 */
@Slf4j
public class ExtendObjSerializer extends JsonSerializer {

    public static final ExtendObjSerializer INSTANCE = new ExtendObjSerializer();

    @Override
    public void serialize(ExtendObj value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeObject(value.toMap());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy