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

com.riversoft.weixin.common.util.BooleanSerializer Maven / Gradle / Ivy

There is a newer version: 0.9.8
Show newest version
package com.riversoft.weixin.common.util;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * Created by exizhai on 9/26/2015.
 */
public class BooleanSerializer extends JsonSerializer {

    @Override
    public void serialize(Boolean aBoolean, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeNumber(aBoolean ? 1 : 0);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy