Package com.contentstack.sdk
Class QueryResult
- java.lang.Object
-
- com.contentstack.sdk.QueryResult
-
public class QueryResult extends Object
MIT License Copyright (c) 2012 - 2019 Contentstack Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.json.JSONObject
contentObject
protected int
count
protected org.json.JSONObject
receiveJson
protected List<Entry>
resultObjects
protected org.json.JSONArray
schemaArray
-
Constructor Summary
Constructors Constructor Description QueryResult()
-
Method Summary
Modifier and Type Method Description org.json.JSONObject
getContentType()
Returns class's content type if call to fetch contentType executed successfully.int
getCount()
Returns count of objects available.
Note : To retrieve this data,Query.includeCount()
orQuery.count()
should be added inQuery
while querying.List<Entry>
getResultObjects()
org.json.JSONArray
getSchema()
Returns class's schema if call to fetch schema executed successfully.protected void
setJSON(org.json.JSONObject jsonobject, List<Entry> objectList)
-
-
-
Method Detail
-
getResultObjects
public List<Entry> getResultObjects()
- Returns:
- List of
Entry
objects 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 inQuery
while 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();
-
-