Package com.contentstack.sdk
Class Group
java.lang.Object
com.contentstack.sdk.Group
public class Group extends Object
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Object
get(String key)
Get object value for key.ArrayList<Entry>
getAllEntries(String refKey, String refContentType)
Get value for the given reference key.Asset
getAsset(String key)
Get an asset from the groupList<Asset>
getAssets(String key)
Get an assets from the group.Boolean
getBoolean(String key)
Get boolean value for key.Calendar
getDate(String key)
GetCalendar
value for keydouble
getDouble(String key)
Get double value for keyfloat
getFloat(String key)
Get integer value for keyGroup
getGroup(String key)
Get a group from the group.List<Group>
getGroups(String key)
Get a list of group from the group.int
getInt(String key)
Get integer value for keyorg.json.JSONArray
getJSONArray(String key)
GetJSONArray
value for keyorg.json.JSONObject
getJSONObject(String key)
GetJSONObject
value for keylong
getLong(String key)
Get long value for keyNumber
getNumber(String key)
GetJSONObject
value for keyshort
getShort(String key)
Get short value for keyString
getString(String key)
Get string value for key.org.json.JSONObject
toJSON()
Get group representation in json
-
Constructor Details
-
Method Details
-
toJSON
public org.json.JSONObject toJSON()Get group representation in json- Returns:
- JSONObject
Example :
JSONObject json = group.toJSON();
-
get
Get object value for key.- Parameters:
key
- field_uid as key.- Returns:
- JSONObject
Example :
Object obj = group.get("key");
-
getString
Get string value for key.- Parameters:
key
- field_uid as key.- Returns:
- String
Example :
String value = group.getString("key");
-
getBoolean
Get boolean value for key.- Parameters:
key
- field_uid as key.- Returns:
- boolean true or false
Example :
Boolean value = group.getBoolean("key");
-
getJSONArray
GetJSONArray
value for key- Parameters:
key
- field_uid as key.- Returns:
- JSONArray
Example :
JSONArray value = group.getJSONArray("key");
-
getJSONObject
GetJSONObject
value for key- Parameters:
key
- field_uid as key.- Returns:
- JSONObject
Example :
JSONObject value = group.getJSONObject("key");
-
getNumber
GetJSONObject
value for key- Parameters:
key
- field_uid as key.- Returns:
- Number
Example :
JSONObject value = group.getJSONObject("key");
-
getInt
Get integer value for key- Parameters:
key
- field_uid as key.- Returns:
- int
Example :
int value = group.getInt("key");
-
getFloat
Get integer value for key- Parameters:
key
- field_uid as key.- Returns:
- float
Example :
float value = group.getFloat("key");
-
getDouble
Get double value for key- Parameters:
key
- field_uid as key.- Returns:
- double
Example :
double value = group.getDouble("key");
-
getLong
Get long value for key- Parameters:
key
- field_uid as key.- Returns:
- long
Example :
long value = group.getLong("key");
-
getShort
Get short value for key- Parameters:
key
- field_uid as key.- Returns:
- short
Example :
short value = group.getShort("key");
-
getDate
GetCalendar
value for key- Parameters:
key
- field_uid as key.- Returns:
Date
Example :
Calendar value = group.getDate("key");
-
getAsset
Get an asset from the group- Parameters:
key
- field_uid as key.- Returns:
- Asset object
Example :
Asset asset = group.getAsset("key");
-
getAssets
Get an assets from the group. This works with multiple true fields- Parameters:
key
- field_uid as key.
Example :
List<Asset> asset = group.getAssets("key");
- Returns:
- ArrayList of
Asset
-
getGroup
Get a group from the group.- Parameters:
key
- field_uid as key.
Example :
Group innerGroup = group.getGroup("key");
- Returns:
- Group object
-
getGroups
Get a list of group from the group.Note :- This will work when group is multiple true.
- Parameters:
key
- field_uid as key.
Example :
Group innerGroup = group.getGroups("key");
- Returns:
- List of
Group
-
getAllEntries
Get value for the given reference key.
-