Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.factual.driver;
 
 import  org.json.JSONException;
 import  org.json.JSONObject;

Represents the response from running a Submit request against Factual.

Author(s):
brandon
public class SubmitResponse extends Response {
	private String json = null;
	private String factualId;
	private boolean newEntity;

Constructor, parses from a JSON response String.

Parameters:
json the JSON response String returned by Factual.
	public SubmitResponse(String json) {
		this. = json;
		try {
			JSONObject rootJsonObj = new JSONObject(json);
			Response.withMeta(thisrootJsonObj);
			parseResponse(rootJsonObj.getJSONObject(.));
catch (JSONException e) {
			throw new RuntimeException(e);
		}
	}
	private void parseResponse(JSONObject jothrows JSONException {
	     = jo.getString(.);
	     = jo.getBoolean(.);
	}

Returns:
the factual id that submit was performed on
	public String getFactualId() {
		return ;
	}

Returns:
whether or not this was a submission to add a new row or update an existing row
	public boolean isNewEntity() {
		return ;
	}
	public String getJson() {
		return ;
	}
New to GrepCode? Check out our FAQ X