com.unbxd.client.recommendations.response.RecommendationResponse Maven / Gradle / Ivy
package com.unbxd.client.recommendations.response;
import java.util.List;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
* User: sourabh
* Date: 08/07/14
* Time: 6:17 PM
*
* Corresponds to recommendations API response
*/
public class RecommendationResponse {
private int _statusCode;
private int _errorCode;
private String _message;
private int _queryTime;
private int _totalResultsCount;
private RecommendationResults _results;
public RecommendationResponse(Map params) {
if(params.get("error") != null){
Map error = (Map) params.get("error");
this._errorCode = (Integer) error.get("code");
this._message = (String) error.get("message");
}else{
this._message = "OK";
this._statusCode = (Integer) params.get("status");
this._queryTime = (Integer) params.get("queryTime");
this._totalResultsCount = (Integer) params.get("count");
if(params.containsKey("Recommendations")){
this._results = new RecommendationResults((List