public BingResponse getResults(String json) {
if(logger.isDebugEnabled()) {
logger.debug("Response json: "+json);
}
BingResponse bingResponse = new BingResponse();
ValueMap response = (ValueMap) Parser.parse(json);
ValueMap map = (ValueMap) response.get("SearchResponse");
ValueMap images = (ValueMap) map.get("Image");
if(images != null) {
Image imageItem = new Image();
parseValueMap(bingResponse, images, imageItem);
}
ValueMap news = (ValueMap) map.get("News");
if(news != null) {
News newsItem = new News();
parseValueMap(bingResponse, news, newsItem);
}
ValueMap video = (ValueMap) map.get("Video");
if(video != null) {
Video videoItem = new Video();
parseValueMap(bingResponse, video, videoItem);
}
ValueMap web = (ValueMap) map.get("Web");
if(web != null) {
Web webItem = new Web();
parseValueMap(bingResponse, web, webItem);
}