public class Entry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
_metadata |
protected android.util.ArrayMap<java.lang.String,java.lang.Object> |
formHeader |
protected boolean |
isDelete |
protected java.lang.String |
language |
protected java.util.HashMap<java.lang.String,java.lang.Object> |
owner |
protected java.lang.String |
ownerEmailId |
protected java.lang.String |
ownerUid |
protected org.json.JSONObject |
resultJson |
protected java.lang.String |
title |
protected java.lang.String |
uid |
protected java.lang.String |
url |
Modifier | Constructor and Description |
---|---|
protected |
Entry(java.lang.String contentTypeName) |
Modifier and Type | Method and Description |
---|---|
Entry |
addParam(java.lang.String key,
java.lang.String value)
This method adds key and value to an Entry.
|
void |
cancelRequest()
To cancel all
Entry network requests. |
Entry |
configure(org.json.JSONObject jsonObject) |
Entry |
except(java.lang.String[] fieldUid)
Specifies list of field uids that would be 'excluded' from the response.
|
Entry |
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.
|
void |
fetch(com.contentstack.sdk.EntryResultCallBack callBack)
Fetches the latest version of the entries from Built.io content stack
|
java.lang.Object |
get(java.lang.String key)
Get object value for key.
|
java.util.ArrayList<Entry> |
getAllEntries(java.lang.String refKey,
java.lang.String refContentType)
Get value for the given reference key.
|
Asset |
getAsset(java.lang.String key)
Get an asset from the entry
|
java.util.List<Asset> |
getAssets(java.lang.String key)
Get an assets from the entry.
|
java.lang.Boolean |
getBoolean(java.lang.String key)
Get boolean value for key.
|
java.lang.String |
getContentType()
Get contentType name.
|
java.util.Calendar |
getCreateAt()
Get
Calendar value of creation time of entry. |
java.lang.String |
getCreatedBy()
Get uid who created this entry.
|
java.util.Calendar |
getDate(java.lang.String key)
Get
Calendar value for key |
java.util.Calendar |
getDeleteAt()
Get
Calendar value of deletion time of entry. |
java.lang.String |
getDeletedBy()
Get uid who deleted this entry.
|
double |
getDouble(java.lang.String key)
Get double value for key
|
float |
getFloat(java.lang.String key)
Get integer value for key
|
Group |
getGroup(java.lang.String key)
Get a group from entry.
|
java.util.List<Group> |
getGroups(java.lang.String key)
Get a list of group from entry.
|
java.lang.String |
getHtmlText(java.lang.String markdownKey)
Get html text for markdown data type
|
int |
getInt(java.lang.String key)
Get integer value for key
|
org.json.JSONArray |
getJSONArray(java.lang.String key)
Get
JSONArray value for key |
org.json.JSONObject |
getJSONObject(java.lang.String key)
Get
JSONObject value for key |
com.contentstack.sdk.Language |
getLanguage()
Deprecated.
|
java.lang.String |
getLocale()
Example : String local = entry.getLocale(); |
long |
getLong(java.lang.String key)
Get long value for key
|
java.util.ArrayList<java.lang.String> |
getMultipleHtmlText(java.lang.String markdownKey)
Get html text for markdown data type which is multiple true
|
java.lang.Number |
getNumber(java.lang.String key)
Get
JSONObject value for key |
java.util.HashMap<java.lang.String,java.lang.Object> |
getOwner() |
short |
getShort(java.lang.String key)
Get short value for key
|
java.lang.String |
getString(java.lang.String key)
Get string value for key.
|
java.lang.String[] |
getTags()
Get tags.
|
java.lang.String |
getTitle()
Get title string
|
java.lang.String |
getUid()
Get uid.
|
java.util.Calendar |
getUpdateAt()
Get
Calendar value of updating time of entry. |
java.lang.String |
getUpdatedBy()
Get uid who updated this entry.
|
java.lang.String |
getURL()
Get url string
|
Entry |
includeContentType()
Include Content Type of all returned objects along with objects themselves.
|
Entry |
includeFallback()
Retrieve the published content of the fallback locale if an entry is not localized in specified locale.
|
Entry |
includeReference(java.lang.String referenceField)
Add a constraint that requires a particular reference key details.
|
Entry |
includeReference(java.lang.String[] referenceFields)
Add a constraint that requires a particular reference key details.
|
Entry |
includeReferenceContentTypeUID()
This method also includes the content type UIDs of the referenced entries returned in the response
|
Entry |
only(java.lang.String[] fieldUid)
Specifies an array of 'only' keys in BASE object that would be 'included' in the response.
|
Entry |
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.
|
void |
removeHeader(java.lang.String key)
Remove header key.
|
void |
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)
Set headers.
|
Entry |
setLocale(java.lang.String locale)
Example : Entry entry = entry.setLocale("en-hi"); |
protected void |
setTags(java.lang.String[] tags) |
protected void |
setUid(java.lang.String uid) |
org.json.JSONObject |
toJSON()
Get entry representation in json
|
protected android.util.ArrayMap<java.lang.String,java.lang.Object> formHeader
protected java.lang.String uid
protected org.json.JSONObject resultJson
protected java.lang.String ownerEmailId
protected java.lang.String ownerUid
protected java.util.HashMap<java.lang.String,java.lang.Object> owner
protected java.util.HashMap<java.lang.String,java.lang.Object> _metadata
protected java.lang.String title
protected java.lang.String url
protected java.lang.String language
protected boolean isDelete
protected void setContentTypeInstance(ContentType contentTypeInstance)
public Entry configure(org.json.JSONObject jsonObject)
public void setHeader(java.lang.String key, java.lang.String value)
key
- custom_header_keyvalue
- custom_header_value
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false); Entry entry = stack.contentType("form_name").entry("entry_uid"); entry.setHeader("custom_header_key", "custom_header_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); Entry entry = stack.contentType("form_name").entry("entry_uid"); entry.removeHeader("custom_header_key");
public java.lang.String getTitle()
Example :
String title = entry.getTitle();
public java.lang.String getURL()
Example :
String url = entry.getURL();
public java.lang.String[] getTags()
String[] tags = entry.getURL();
public java.lang.String getContentType()
String contentType = entry.getFileType();
public java.lang.String getUid()
String uid = entry.getUid();
@Deprecated public com.contentstack.sdk.Language getLanguage()
Language
instance
Example :
Language local = entry.getLanguage();
public java.lang.String getLocale()
Example :
String local = entry.getLocale();
public Entry setLocale(java.lang.String locale)
Example :
Entry entry = entry.setLocale("en-hi");
public java.util.HashMap<java.lang.String,java.lang.Object> getOwner()
public org.json.JSONObject toJSON()
Example :
JSONObject json = entry.toJSON();
public java.lang.Object get(java.lang.String key)
key
- field_uid as key.
Object obj = entry.get("key");
public java.lang.String getHtmlText(java.lang.String markdownKey)
markdownKey
- field_uid as key.String htmlText = entry.getHtmlText("markdownKey");
public java.util.ArrayList<java.lang.String> getMultipleHtmlText(java.lang.String markdownKey)
markdownKey
- field_uid as key.ArrayList<String> htmlTexts = entry.getMultipleHtmlText("markdownKey");
public java.lang.String getString(java.lang.String key)
key
- field_uid as key.
String value = entry.getString("key");
public java.lang.Boolean getBoolean(java.lang.String key)
key
- field_uid as key.
Boolean value = entry.getBoolean("key");
public org.json.JSONArray getJSONArray(java.lang.String key)
JSONArray
value for keykey
- field_uid as key.
JSONArray value = entry.getJSONArray("key");
public org.json.JSONObject getJSONObject(java.lang.String key)
JSONObject
value for keykey
- field_uid as key.
JSONObject value = entry.getJSONObject("key");
public java.lang.Number getNumber(java.lang.String key)
JSONObject
value for keykey
- field_uid as key.
JSONObject value = entry.getJSONObject("key");
public int getInt(java.lang.String key)
key
- field_uid as key.
int value = entry.getInt("key");
public float getFloat(java.lang.String key)
key
- field_uid as key.
float value = entry.getFloat("key");
public double getDouble(java.lang.String key)
key
- field_uid as key.
double value = entry.getDouble("key");
public long getLong(java.lang.String key)
key
- field_uid as key.
long value = entry.getLong("key");
public short getShort(java.lang.String key)
key
- field_uid as key.
short value = entry.getShort("key");
public java.util.Calendar getDate(java.lang.String key)
Calendar
value for keykey
- field_uid as key.
Calendar value = entry.getDate("key");
public java.util.Calendar getCreateAt()
Calendar
value of creation time of entry.
Calendar createdAt = entry.getCreateAt("key");
public java.lang.String getCreatedBy()
String createdBy_uid = entry.getCreatedBy();
public java.util.Calendar getUpdateAt()
Calendar
value of updating time of entry.
Calendar updatedAt = entry.getUpdateAt("key");
public java.lang.String getUpdatedBy()
String updatedBy_uid = entry.getUpdatedBy();
public java.util.Calendar getDeleteAt()
Calendar
value of deletion time of entry.
Calendar updatedAt = entry.getUpdateAt("key");
public java.lang.String getDeletedBy()
String deletedBy_uid = entry.getDeletedBy();
public Asset getAsset(java.lang.String key)
key
- field_uid as key.
Asset asset = entry.getAsset("key");
public java.util.List<Asset> getAssets(java.lang.String key)
key
- field_uid as key.
Listasset = entry.getAssets("key");
public Group getGroup(java.lang.String key)
key
- field_uid as key.
Group innerGroup = entry.getGroup("key");
public java.util.List<Group> getGroups(java.lang.String key)
Note :- This will work when group is multiple true.
key
- field_uid as key.
Group innerGroup = entry.getGroups("key");
public java.util.ArrayList<Entry> getAllEntries(java.lang.String refKey, java.lang.String refContentType)
refKey
- key of a reference field.refContentType
- class uid.ArrayList
of Entry
instances.
Also specified contentType value will be set as class uid for all Entry
instance.
//'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"); csQuery.find(new QueryResultsCallBack() {
@Override public void onCompletion(ResponseType responseType, QueryResult queryResult, Error error) {
if(error == null){ List<Entry> list = builtqueryresult.getResultObjects(); for (int i = 0; i < list.queueSize(); i++) { Entry entry = list.get(i); Entry taskEntry = entry.getAllEntries("for_task", "task"); } } } });
public Entry except(java.lang.String[] fieldUid)
fieldUid
- field uid which get 'excluded' from the response.Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
entry.except(new String[]{"name", "description"});
public Entry includeReference(java.lang.String referenceField)
referenceField
- key that to be constrained.Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
entry.includeReference("referenceUid");
public Entry includeReference(java.lang.String[] referenceFields)
referenceFields
- array key that to be constrained.Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
entry.includeReference(new String[]{"referenceUid_A", "referenceUid_B"});
public Entry only(java.lang.String[] fieldUid)
fieldUid
- Array of the 'only' reference keys to be included in response.Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
entry.only(new String[]{"name", "description"});
public Entry 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..Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
ArrayList<String> array = new ArrayList<String>(); array.add("description"); array.add("name");
entry.onlyWithReferenceUid(array, "referenceUid");
public Entry 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.Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
ArrayList<String> array = new ArrayList<String>(); array.add("description"); array.add("name");
entry.onlyWithReferenceUid(array, "referenceUid");
protected void setTags(java.lang.String[] tags)
protected void setUid(java.lang.String uid)
public void fetch(com.contentstack.sdk.EntryResultCallBack callBack)
callBack
- EntryResultCallBack
object to notify the application when the request has completed.
Entry
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); Entry entry = stack.contentType("form_name").entry("entry_uid");
entry.fetch(new BuiltResultCallBack() {
@Override public void onCompletion(ResponseType responseType, BuiltError builtError) { }
});
public void cancelRequest()
public void setCachePolicy(com.contentstack.sdk.CachePolicy cachePolicy)
Query
instance.cachePolicy
- CachePolicy
instance.public Entry addParam(java.lang.String key, java.lang.String value)
key
- The key as string which needs to be added to an Entryvalue
- The value as string which needs to be added to an EntryEntry
//'blt5d4sample2633b' is a dummy Stack API key
//'blt6d0240b5sample254090d' is dummy access token.
Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false);
final Entry entry = stack.contentType("user").entry("blt3b0aaebf6f1c3762"); <br>
entry.addParam("include_dimensions", "true"); <br>
entry.fetch(new BuiltResultCallBack() {<br>
@Override
public void onCompletion(ResponseType responseType, BuiltError builtError) {
}<br>
});<br>
public Entry includeReferenceContentTypeUID()
Entry
//'blt5d4sample2633b' is a dummy Stack API key
//'blt6d0240b5sample254090d' is dummy access token.
Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag", false);
final Entry entry = stack.contentType("user").entry("blt3b0aaebf6f1c3762"); <br>
entry.includeReferenceContentTypeUID; <br>
entry.fetch(new BuiltResultCallBack() {
<br>@
Override
public void onCompletion(ResponseType responseType, BuiltError builtError) {
}<br>
});<br>
public Entry includeContentType()
Entry
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); final Entry entry = stack.contentType("user").entry("blt3b0aaebf6f1c3762"); entry.includeContentType();
public Entry includeFallback()
Entry
object, so you can chain this call.
Stack stack = Contentstack.stack(context, "ApiKey", "deliveryToken", "environment"); final Entry entry = stack.contentType("user").entry("entryUid"); entry.includeFallback();