public class Group
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Group(Stack stack,
org.json.JSONObject jsonObject) |
Modifier and Type | Method and Description |
---|---|
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 group
|
java.util.List<Asset> |
getAssets(java.lang.String key)
Get an assets from the group.
|
java.lang.Boolean |
getBoolean(java.lang.String key)
Get boolean value for key.
|
java.util.Calendar |
getDate(java.lang.String key)
Get
Calendar value for key |
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 the group.
|
java.util.List<Group> |
getGroups(java.lang.String key)
Get a list of group from the group.
|
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 |
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 |
short |
getShort(java.lang.String key)
Get short value for key
|
java.lang.String |
getString(java.lang.String key)
Get string value for key.
|
org.json.JSONObject |
toJSON()
Get group representation in json
|
protected Group(Stack stack, org.json.JSONObject jsonObject)
public org.json.JSONObject toJSON()
Example :
JSONObject json = group.toJSON();
public java.lang.Object get(java.lang.String key)
key
- field_uid as key.
Object obj = group.get("key");
public java.lang.String getHtmlText(java.lang.String markdownKey)
markdownKey
- field_uid as key.String htmlText = group.getHtmlText("markdownKey");
public java.util.ArrayList<java.lang.String> getMultipleHtmlText(java.lang.String markdownKey)
markdownKey
- field_uid as key.ArrayList<String> htmlTexts = group.getMultipleHtmlText("markdownKey");
public java.lang.String getString(java.lang.String key)
key
- field_uid as key.
String value = group.getString("key");
public java.lang.Boolean getBoolean(java.lang.String key)
key
- field_uid as key.
Boolean value = group.getBoolean("key");
public org.json.JSONArray getJSONArray(java.lang.String key)
JSONArray
value for keykey
- field_uid as key.
JSONArray value = group.getJSONArray("key");
public org.json.JSONObject getJSONObject(java.lang.String key)
JSONObject
value for keykey
- field_uid as key.
JSONObject value = group.getJSONObject("key");
public java.lang.Number getNumber(java.lang.String key)
JSONObject
value for keykey
- field_uid as key.
JSONObject value = group.getJSONObject("key");
public int getInt(java.lang.String key)
key
- field_uid as key.
int value = group.getInt("key");
public float getFloat(java.lang.String key)
key
- field_uid as key.
float value = group.getFloat("key");
public double getDouble(java.lang.String key)
key
- field_uid as key.
double value = group.getDouble("key");
public long getLong(java.lang.String key)
key
- field_uid as key.
long value = group.getLong("key");
public short getShort(java.lang.String key)
key
- field_uid as key.
short value = group.getShort("key");
public java.util.Calendar getDate(java.lang.String key)
Calendar
value for keykey
- field_uid as key.
Calendar value = group.getDate("key");
public Asset getAsset(java.lang.String key)
key
- field_uid as key.
Asset asset = group.getAsset("key");
public java.util.List<Asset> getAssets(java.lang.String key)
key
- field_uid as key.
Listasset = group.getAssets("key");
public Group getGroup(java.lang.String key)
key
- field_uid as key.
Group innerGroup = group.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 = group.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); Group group = entry.getGroup("fieldUid"); Entry taskEntry = entry.getAllEntries("for_task", "task"); } } } });