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<com.contentstack.sdk.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.
|
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.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()
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 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.Date
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.
List<Asset> asset = group.getAssets("key");
Asset
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");
Group
public java.util.ArrayList<com.contentstack.sdk.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.