com.riversoft.weixin.common.util.BooleanDeserializer Maven / Gradle / Ivy
package com.riversoft.weixin.common.util;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
/**
* Created by exizhai on 9/26/2015.
*/
public class BooleanDeserializer extends JsonDeserializer {
@Override
public Boolean deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
return jsonParser.getIntValue() > 0;
}
}