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

com.sailthru.client.handler.response.JsonResponse Maven / Gradle / Ivy

There is a newer version: 2.4.1
Show newest version
package com.sailthru.client.handler.response;

import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 *
 * @author Prajwal Tuladhar 
 */
public class JsonResponse implements Response {
    
    protected Map response = null;
    
    private static final Logger logger = LoggerFactory.getLogger(JsonResponse.class);
    
    public JsonResponse(Object response) {
        try {
            this.response = (Map) response;
        } catch (ClassCastException e) {
            logger.error(e.getMessage());
        }
    }

    public boolean isOK() {
        return (this.response != null) && !this.response.containsKey("error");
    }

    public Map getResponse() {
        return this.response;
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy