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

com.factual.driver.FlagResponse Maven / Gradle / Ivy

The newest version!
package com.factual.driver;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Represents the response from running a Flag request against Factual.
 * 
 * @author brandon
 */
public class FlagResponse extends Response {

  /**
   * Constructor, parses from a JSON response String.
   */
  public FlagResponse(InternalResponse resp) {
    super(resp);
    try {
      JSONObject rootJsonObj = new JSONObject(resp.getContent());
      Response.withMeta(this, rootJsonObj);
    } catch (JSONException e) {
      throw new RuntimeException(e);
    }
  }

  @Override
  public String getJson() {
    return resp.getContent();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy