Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.factual.driver;
 
 import java.util.List;
 import java.util.Map;
 
 import  org.json.JSONException;
 import  org.json.JSONObject;
Represents a Factual Diffs response

Author(s):
brandon
public class DiffsResponse extends Response implements DiffsCallback {
  private String json = "";
  private final List<Map<StringObject>> data = new ArrayList<Map<StringObject>>();
  public DiffsResponse() {
  }
  protected static Map<StringObjectparseItem(String jsonObjthrows JSONException {
    JSONObject jsonItem = new JSONObject(jsonObj);
    Iterator<?> iter = jsonItem.keys();
    Map<StringObjectitemMap = Maps.newHashMap();
    while (iter.hasNext()) {
      String key = iter.next().toString();
      itemMap.put(keyjsonItem.getString(key));
    }
    return itemMap;
  }

  
Get diffs response as a list of diffs, where each diff is represented as a map

Returns:
list of diffs returned from this query.
  public List<Map<StringObject>> getData() {
    return ;
  }
  public String getJson() {
    return ;
  }
  public void onDiff(String line) {
     += line;
     += System.getProperty("line.separator");
    try {
      .add(parseItem(line));
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }
New to GrepCode? Check out our FAQ X