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

com.mizhousoft.weixin.mp.domain.serializer.NumericBooleanSerializer Maven / Gradle / Ivy

The newest version!
package com.mizhousoft.weixin.mp.domain.serializer;

import java.io.IOException;

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

/**
 * 序列化
 *
 */
public class NumericBooleanSerializer extends JsonSerializer
{
	@Override
	public void serialize(Boolean bool, JsonGenerator generator, SerializerProvider provider) throws IOException, JsonProcessingException
	{
		generator.writeString(bool ? "1" : "0");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy