public class Query
extends java.lang.Object
implements com.contentstack.sdk.INotifyClass
Entry
instance.Modifier and Type | Field and Description |
---|---|
protected ContentType |
contentTypeInstance |
protected android.util.ArrayMap<java.lang.String,java.lang.Object> |
formHeader |
Modifier | Constructor and Description |
---|---|
protected |
Query(java.lang.String formName) |
Modifier and Type | Method and Description |
---|---|
Query |
addParam(java.lang.String key,
java.lang.String value)
This method adds key and value to an Entry.
|
Query |
addQuery(java.lang.String key,
java.lang.String value)
Add a custom query against specified key.
|
Query |
and(java.util.ArrayList<Query> queryObjects)
Combines all the queries together using AND operator
|
Query |
ascending(java.lang.String key)
Sort the results in ascending order with the given key.
|
void |
cancelRequest()
To cancel all
Query network requests. |
Query |
containedIn(java.lang.String key,
java.lang.Object[] values)
Add a constraint to the query that requires a particular key's entry to be contained in the provided array.
|
Query |
count()
Retrieve only count of entries in result.
|
Query |
descending(java.lang.String key)
Sort the results in descending order with the given key.
|
Query |
except(java.util.ArrayList<java.lang.String> fieldUid)
Specifies list of field uids that would be 'excluded' from the response.
|
Query |
except(java.lang.String[] fieldUids)
Specifies list of field uids that would be 'excluded' from the response.
|
Query |
exceptWithReferenceUid(java.util.ArrayList<java.lang.String> fieldUid,
java.lang.String referenceFieldUid)
Specifies an array of 'except' keys that would be 'excluded' in the response.
|
protected void |
execQuery(com.contentstack.sdk.SingleQueryResultCallback callBack,
com.contentstack.sdk.QueryResultsCallBack callback,
boolean isFromLocal) |
Query |
exists(java.lang.String key)
Add a constraint that requires, a specified key exists in response.
|
Query |
find(com.contentstack.sdk.QueryResultsCallBack callback)
Execute a Query and Caches its result (Optional)
|
Query |
findOne(com.contentstack.sdk.SingleQueryResultCallback callBack)
Execute a Query and Caches its result (Optional)
|
java.lang.String |
getContentType() |
void |
getResult(java.lang.Object object,
java.lang.String controller) |
void |
getResultObject(java.util.List<java.lang.Object> objects,
org.json.JSONObject jsonObject,
boolean isSingleEntry) |
Query |
greaterThan(java.lang.String key,
java.lang.Object value)
Add a constraint to the query that requires a particular key entry to be greater than the provided value.
|
Query |
greaterThanOrEqualTo(java.lang.String key,
java.lang.Object value)
Add a constraint to the query that requires a particular key entry to be greater than or equal to the provided value.
|
Query |
includeContentType()
Include Content Type of all returned objects along with objects themselves.
|
Query |
includeCount()
Retrieve count and data of objects in result.
|
Query |
includeFallback()
Retrieve the published content of the fallback locale if an entry is not localized in specified locale.
|
Query |
includeOwner()
Include object owner's profile in the objects data.
|
Query |
includeReference(java.lang.String key)
Add a constraint that requires a particular reference key details.
|
Query |
includeReference(java.lang.String[] keys)
Add a constraint that requires a particular reference key details.
|
Query |
includeReferenceContentTypUid()
This method also includes the content type UIDs of the referenced entries returned in the response
|
Query |
language(com.contentstack.sdk.Language language)
Deprecated.
|
Query |
lessThan(java.lang.String key,
java.lang.Object value)
Add a constraint to the query that requires a particular key entry to be less than the provided value.
|
Query |
lessThanOrEqualTo(java.lang.String key,
java.lang.Object value)
Add a constraint to the query that requires a particular key entry to be less than or equal to the provided value.
|
Query |
limit(int number)
A limit on the number of objects to return.
|
Query |
locale(java.lang.String locale) |
Query |
notContainedIn(java.lang.String key,
java.lang.Object[] values)
Add a constraint to the query that requires a particular key entry's value not be contained in the provided array.
|
Query |
notEqualTo(java.lang.String key,
java.lang.Object value)
Add a constraint to the query that requires a particular key's entry to be not equal to the provided value.
|
Query |
notExists(java.lang.String key)
Add a constraint that requires, a specified key does not exists in response.
|
Query |
only(java.lang.String[] fieldUid)
Specifies an array of 'only' keys in BASE object that would be 'included' in the response.
|
Query |
onlyWithReferenceUid(java.util.ArrayList<java.lang.String> fieldUid,
java.lang.String referenceFieldUid)
Specifies an array of 'only' keys that would be 'included' in the response.
|
Query |
or(java.util.ArrayList<Query> queryObjects)
Add a constraint to fetch all entries which satisfy any queries.
|
Query |
regex(java.lang.String key,
java.lang.String regex)
Add a regular expression constraint for finding string values that match the provided regular expression.
|
Query |
regex(java.lang.String key,
java.lang.String regex,
java.lang.String modifiers)
Add a regular expression constraint for finding string values that match the provided regular expression.
|
void |
removeHeader(java.lang.String key)
Remove header key.
|
Query |
removeQuery(java.lang.String key)
Remove provided query key from custom query if exist.
|
Query |
search(java.lang.String value)
This method provides only the entries matching the specified value.
|
Query |
setCachePolicy(com.contentstack.sdk.CachePolicy cachePolicy)
To set cache policy using
Query instance. |
protected void |
setContentTypeInstance(ContentType contentTypeInstance) |
void |
setHeader(java.lang.String key,
java.lang.String value)
To set headers for Built.io Contentstack rest calls.
|
protected void |
setQueryJson(com.contentstack.sdk.QueryResultsCallBack callback) |
Query |
skip(int number)
The number of objects to skip before returning any.
|
Query |
tags(java.lang.String[] tags)
Include tags with which to search entries.
|
Query |
where(java.lang.String key,
java.lang.Object value)
Add a constraint to fetch all entries that contains given value against specified key.
|
Query |
whereIn(java.lang.String key,
Query queryObject)
Get entries having values based on referenced fields.
|
Query |
whereNotIn(java.lang.String key,
Query queryObject)
Get entries having values based on referenced fields.
|
protected ContentType contentTypeInstance
protected android.util.ArrayMap<java.lang.String,java.lang.Object> formHeader
protected void setContentTypeInstance(ContentType contentTypeInstance)
public void setHeader(java.lang.String key, java.lang.String value)
key
- header name.value
- header value against given header name.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.setHeader("custom_key", "custom_value");
public void removeHeader(java.lang.String key)
key
- custom_header_key
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.removeHeader("custom_key");
public java.lang.String getContentType()
public Query where(java.lang.String key, java.lang.Object value)
key
- field uid.value
- field value which get 'included' from the response.Query
object, so you can chain this call.
Note : for group field provide key in a "key.groupFieldUid" format.
Example :
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.where("uid", "bltf4fbsample851db");
public Query addQuery(java.lang.String key, java.lang.String value)
key
- key.value
- value.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.addQuery("query_param_key", "query_param_value");
public Query removeQuery(java.lang.String key)
key
- Query name to remove.projectQuery.removeQuery("Query_Key");
public Query and(java.util.ArrayList<Query> queryObjects)
queryObjects
- list of Query
instances on which AND query executes.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); Query query = projectClass.query(); query.where('username','something'); Query subQuery = projectClass.query(); subQuery.where('email_address','something@email.com'); ArrayList<Query> array = new ArrayList<Query>();
array.add(query); array.add(subQuery);
projectQuery.and(array);
public Query or(java.util.ArrayList<Query> queryObjects)
queryObjects
- list of Query
instances on which OR query executes.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); Query query = projectClass.query(); query.where('username','something'); Query subQuery = projectClass.query(); subQuery.where('email_address','something@email.com'); ArrayList<Query> array = new ArrayList<Query>(); array.add(query); array.add(subQuery);
csQuery.or(array);
public Query lessThan(java.lang.String key, java.lang.Object value)
key
- the key to be constrained.value
- the value that provides an upper bound.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.lessThan("due_date", "2013-06-25T00:00:00+05:30");
public Query lessThanOrEqualTo(java.lang.String key, java.lang.Object value)
key
- The key to be constrainedvalue
- The value that must be equalled.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.lessThanOrEqualTo("due_date", "2013-06-25T00:00:00+05:30");
public Query greaterThan(java.lang.String key, java.lang.Object value)
key
- The key to be constrained.value
- The value that provides an lower bound.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.greaterThan("due_date", "2013-06-25T00:00:00+05:30");
public Query greaterThanOrEqualTo(java.lang.String key, java.lang.Object value)
key
- The key to be constrained.value
- The value that provides an lower bound.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.greaterThanOrEqualTo("due_date", "2013-06-25T00:00:00+05:30");
public Query notEqualTo(java.lang.String key, java.lang.Object value)
key
- The key to be constrained.value
- The object that must not be equaled.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.notEqualTo("due_date", "2013-06-25T00:00:00+05:30");
public Query containedIn(java.lang.String key, java.lang.Object[] values)
key
- The key to be constrained.values
- The possible values for the key's object.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.containedIn("severity", new Object[]{"Show Stopper", "Critical"});
public Query notContainedIn(java.lang.String key, java.lang.Object[] values)
key
- The key to be constrained.values
- The list of values the key object should not be.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.notContainedIn("severity", new Object[]{"Show Stopper", "Critical"});
public Query exists(java.lang.String key)
key
- The key to be constrained.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.exists("status");
public Query notExists(java.lang.String key)
key
- The key to be constrained.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.notExists("status");
public Query includeReference(java.lang.String key)
key
- key that to be constrained.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.includeReference("for_bug");
public Query includeReference(java.lang.String[] keys)
keys
- array keys that to be constrained.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.includeReference(new String[]{"for_bug"});
public Query tags(java.lang.String[] tags)
tags
- Comma separated array of tags with which to search entries.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.tags(new String[]{"tag1","tag2"});
public Query ascending(java.lang.String key)
key
- The key to order by.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.ascending("name");
public Query descending(java.lang.String key)
key
- The key to order by.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.descending("name");
public Query except(java.util.ArrayList<java.lang.String> fieldUid)
fieldUid
- field uid which get 'excluded' from the response.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
ArrayList<String> array = new ArrayList<String>(); array.add("name"); array.add("description");
csQuery.except(array);
public Query except(java.lang.String[] fieldUids)
fieldUids
- field uid which get 'excluded' from the response.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.except(new String[]{"name", "description"});
public Query only(java.lang.String[] fieldUid)
fieldUid
- Array of the 'only' reference keys to be included in response.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.only(new String[]{"name"});
public Query onlyWithReferenceUid(java.util.ArrayList<java.lang.String> fieldUid, java.lang.String referenceFieldUid)
fieldUid
- Array of the 'only' reference keys to be included in response.referenceFieldUid
- Key who has reference to some other class object.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
ArrayList<String> array = new ArrayList<String>(); array.add("description"); array.add("name");
csQuery.onlyWithReferenceUid(array, "for_bug");
public Query exceptWithReferenceUid(java.util.ArrayList<java.lang.String> fieldUid, java.lang.String referenceFieldUid)
fieldUid
- Array of the 'except' reference keys to be excluded in response.referenceFieldUid
- Key who has reference to some other class object.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
ArrayList<String> array = new ArrayList<String>(); array.add("description"); array.add("name");
csQuery.exceptWithReferenceUid(array, "for_bug");
public Query count()
Query
object, so you can chain this call.
Note :-
QueryResult.getCount()
method in the success to get count of objects.//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.count();
public Query includeCount()
Query
object, so you can chain this call.
Note :-
QueryResult.getCount()
method in the success to get count of objects.//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.includeCount();
public Query includeContentType()
Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.includeContentType();
public Query includeOwner()
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.includeOwner();
public Query skip(int number)
number
- No of objects to skip from returned objects.Query
object, so you can chain this call.
Note: The skip parameter can be used for pagination, "skip" specifies the number of objects to skip in the response.
Example :
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.skip(2);
public Query limit(int number)
number
- No of objects to limit.Query
object, so you can chain this call.
Note: The limit parameter can be used for pagination, "limit" specifies the number of objects to limit to in the response.
Example :
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.limit(2);
public Query regex(java.lang.String key, java.lang.String regex)
key
- The key to be constrained.regex
- The regular expression pattern to match.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.regex("name", "^browser");
public Query regex(java.lang.String key, java.lang.String regex, java.lang.String modifiers)
key
- The key to be constrained.regex
- The regular expression pattern to match.modifiers
- Any of the following supported Regular expression modifiers.
Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.regex("name", "^browser", "i");
@Deprecated public Query language(com.contentstack.sdk.Language language)
Language
instance.language
- Language
valueQuery
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.language(Language.ENGLISH_UNITED_STATES);
public Query locale(java.lang.String locale)
locale
- String valueQuery
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.locale("en-hi");
public Query search(java.lang.String value)
value
- value used to match or compareQuery
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.search("header");
public Query setCachePolicy(com.contentstack.sdk.CachePolicy cachePolicy)
Query
instance.cachePolicy
- CachePolicy
instance.Query
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.setCachePolicy(NETWORK_ELSE_CACHE);
public Query find(com.contentstack.sdk.QueryResultsCallBack callback)
callback
- QueryResultsCallBack
object to notify the application when the request has completed.//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.find(new QueryResultsCallBack() {
@Override public void onCompletion(ResponseType responseType, QueryResult queryResult, Error error) {
} });
public Query findOne(com.contentstack.sdk.SingleQueryResultCallback callBack)
callBack
- QueryResultsCallBack
object to notify the application when the request has completed.//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.findOne(new QueryResultsCallBack() {
@Override public void onCompletion(ResponseType responseType, ENTRY entry, Error error) {
} });
public void cancelRequest()
protected void setQueryJson(com.contentstack.sdk.QueryResultsCallBack callback)
protected void execQuery(com.contentstack.sdk.SingleQueryResultCallback callBack, com.contentstack.sdk.QueryResultsCallBack callback, boolean isFromLocal)
public void getResult(java.lang.Object object, java.lang.String controller)
getResult
in interface com.contentstack.sdk.INotifyClass
public void getResultObject(java.util.List<java.lang.Object> objects, org.json.JSONObject jsonObject, boolean isSingleEntry)
getResultObject
in interface com.contentstack.sdk.INotifyClass
public Query addParam(java.lang.String key, java.lang.String value)
key
- The key as string which needs to be added to the Queryvalue
- The value as string which needs to be added to the QueryQuery
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.addParam("key", "some_value"); csQuery.findOne(new QueryResultsCallBack() {
@Override public void onCompletion(ResponseType responseType, ENTRY entry, Error error) {
} });
public Query includeReferenceContentTypUid()
Query
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query();
csQuery.addParam("key", "some_value"); csQuery.findOne(new QueryResultsCallBack() {
@Override public void onCompletion(ResponseType responseType, ENTRY entry, Error error) {
} });
public Query whereIn(java.lang.String key, Query queryObject)
key
- The key to be constrainedQuery
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.whereIn("due_date");
public Query whereNotIn(java.lang.String key, Query queryObject)
key
- The key to be constrainedQuery
object, so you can chain this call.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Query csQuery = stack.contentType("contentType_name").query(); csQuery.whereNotIn("due_date");
public Query includeFallback()
Query
object, so you can chain this call.
Stack stack = Contentstack.stack(context, "ApiKey", "deliveryToken", environment_name); Query csQuery = stack.contentType("contentType_name").query(); csQuery.includeFallback();