com.factual.driver
Class ReadResponse
java.lang.Object
com.factual.driver.Response
com.factual.driver.ReadResponse
- All Implemented Interfaces:
- Tabular
public class ReadResponse
- extends Response
- implements Tabular
Represents the response from running a fetch request against Factual, such as
a geolocation based query for specific places entities.
- Author:
- aaron
|
Constructor Summary |
ReadResponse(String json)
Constructor, parses from a JSON response String. |
ReadResponse
public ReadResponse(String json)
- Constructor, parses from a JSON response String.
- Parameters:
json - the JSON response String returned by Factual.
getJson
public String getJson()
- Description copied from class:
Response
- Subclasses of Response must provide access to the original JSON
representation of Factual's response.
- Specified by:
getJson in class Response
- Returns:
- The full JSON response from Factual
first
public Map<String,Object> first()
- Returns:
- the first data record or null if no data was returned.
getData
public List<Map<String,Object>> getData()
- An ordered collection of the main data returned by Factual. Represented as
Maps, where each Map is a record in the results.
- Specified by:
getData in interface Tabular
- Returns:
- the main data returned by Factual.
size
public int size()
- Returns:
- the size of the result set
mapStrings
public Collection<String> mapStrings(String field)
- Returns:
- a Collection of all String values found in this Response's data
rows as the field attribute.
Copyright © 2012. All Rights Reserved.