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

com.riversoft.weixin.qy.util.ReportLocationDeserializer Maven / Gradle / Ivy

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

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.riversoft.weixin.qy.agent.bean.WritableAgent;

import java.io.IOException;

/**
 * Created by exizhai on 10/6/2015.
 */
public class ReportLocationDeserializer extends JsonDeserializer {

    @Override
    public WritableAgent.ReportLocation deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
        int report = jsonParser.getIntValue();
        if (1 == report)
            return WritableAgent.ReportLocation.ONLY_IN_SESSION;
        else if (2 == report)
            return WritableAgent.ReportLocation.ALWAYS;
        else
            return WritableAgent.ReportLocation.NO;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy