Package com.contentstack.sdk
Class QueryResult
java.lang.Object
com.contentstack.sdk.QueryResult
public class QueryResult extends Object
It results the query response
-
Field Summary
Fields Modifier and Type Field Description protected org.json.JSONObjectcontentObjectprotected intcountprotected org.json.JSONObjectreceiveJsonprotected List<Entry>resultObjectsprotected org.json.JSONArrayschemaArray -
Constructor Summary
Constructors Constructor Description QueryResult() -
Method Summary
Modifier and Type Method Description org.json.JSONObjectgetContentType()Returns class's content type if call to fetch contentType executed successfully.intgetCount()Returns count of objects available.
Note : To retrieve this data,Query.includeCount()orQuery.count()should be added inQuerywhile querying.List<Entry>getResultObjects()org.json.JSONArraygetSchema()Returns class's schema if call to fetch schema executed successfully.protected voidsetJSON(org.json.JSONObject jsonobject, List<Entry> objectList)
-
Field Details
-
receiveJson
protected org.json.JSONObject receiveJson -
schemaArray
protected org.json.JSONArray schemaArray -
contentObject
protected org.json.JSONObject contentObject -
count
protected int count -
resultObjects
-
-
Constructor Details
-
QueryResult
public QueryResult()
-
-
Method Details
-
getResultObjects
- Returns:
- List of
Entryobjects list.
Example :
List<Entry> list = queryResultObject.getResultObjects();
-
getCount
public int getCount()Returns count of objects available.
Note : To retrieve this data,Query.includeCount()orQuery.count()should be added inQuerywhile querying.- Returns:
- int count
Example :
int count = queryResultObject.getCount();
-
getSchema
public org.json.JSONArray getSchema()Returns class's schema if call to fetch schema executed successfully.- Returns:
- JSONArray schema Array
Example :
JSONArray schemaArray = queryResultObject.getSchema();
-
getContentType
public org.json.JSONObject getContentType()Returns class's content type if call to fetch contentType executed successfully.- Returns:
- JSONObject contentObject
Example :
JSONObject contentObject = queryResultObject.getContentType();
-
setJSON
-