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

com.codingapi.springboot.framework.serializable.EnumSerializer Maven / Gradle / Ivy

There is a newer version: 3.3.12
Show newest version
package com.codingapi.springboot.framework.serializable;

import com.codingapi.springboot.framework.em.IEnum;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

public class EnumSerializer extends JsonSerializer {

    @Override
    public void serialize(IEnum iEnum, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeNumber(iEnum.getCode());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy