public class List
extends java.lang.Object
You can add, remove and modify values associated with the indices.
To obtain an instance of a List use SyncClient.openList(com.twilio.sync.Options, com.twilio.sync.ListObserver, com.twilio.sync.SuccessListener<com.twilio.sync.List>).
| Modifier and Type | Class and Description |
|---|---|
static class |
List.Item
Single item in a List.
|
static class |
List.PageSort
Defines result ordering within a single paginator page.
|
static class |
List.QueryOptions
Defines query options for requesting items from a List.
|
static class |
List.QueryOrder
Defines collection query direction (forward or backwards item listing).
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(org.json.JSONObject itemData,
long flowId,
SuccessListener<java.lang.Long> listener)
Add Item to the List.
|
void |
dispose() |
void |
getItem(long itemIndex,
long flowId,
SuccessListener<List.Item> listener)
Retrieve contents of a given Item in the List.
|
void |
getItems(SuccessListener<ListIterator> listener)
Get iterator access to all items in the list.
|
java.lang.String |
getSid()
Retrieves a machine-generated unique identifier for this List.
|
java.lang.String |
getUniqueName()
Retrieves a user-set unique name for this List.
|
void |
mutateItem(long itemIndex,
Mutator mutator,
long flowId,
SuccessListener<List.Item> listener)
Mutate contents of a given Item in the List.
|
void |
queryItems(List.QueryOptions options,
SuccessListener<ListPaginator> listener)
Query paginated sequence of items from the list, based on query options.
|
List.QueryOptions |
queryOptions()
Provide options for querying items from the List.
|
void |
removeItem(long itemIndex,
long flowId,
SuccessListener<java.lang.Void> listener)
Remove Item from the List.
|
void |
removeList(long flowId,
SuccessListener<java.lang.Void> listener)
Remove entire List object.
|
void |
setItem(long itemIndex,
org.json.JSONObject itemData,
long flowId,
SuccessListener<java.lang.Void> listener)
Set contents of a given Item in the List.
|
public java.lang.String getSid()
public java.lang.String getUniqueName()
public void addItem(org.json.JSONObject itemData,
long flowId,
SuccessListener<java.lang.Long> listener)
itemData - Item data to add as a JSON object.flowId - Local flow identifier.listener - Async result listener. See SuccessListener.public void getItem(long itemIndex,
long flowId,
SuccessListener<List.Item> listener)
itemIndex - Index of the item to retrieve.flowId - Local flow identifier.listener - Async result listener. See SuccessListener.public void setItem(long itemIndex,
org.json.JSONObject itemData,
long flowId,
SuccessListener<java.lang.Void> listener)
itemIndex - Index of the item to set.itemData - Item data to set as a JSON object.flowId - Local flow identifier.listener - Async result listener. See SuccessListener.public void mutateItem(long itemIndex,
Mutator mutator,
long flowId,
SuccessListener<List.Item> listener)
itemIndex - Index of the item to mutate.mutator - Mutator function object.flowId - Local flow identifier.listener - Async result listener. See SuccessListener.Mutatorpublic void removeItem(long itemIndex,
long flowId,
SuccessListener<java.lang.Void> listener)
itemIndex - Index of the item to remove.flowId - Local flow identifier.listener - Async result listener. See SuccessListener.public void getItems(SuccessListener<ListIterator> listener)
listener - Async result listener. See SuccessListener.public List.QueryOptions queryOptions()
Optionspublic void queryItems(List.QueryOptions options, SuccessListener<ListPaginator> listener)
options - Specific query options.listener - Async result listener. See SuccessListener.public void removeList(long flowId,
SuccessListener<java.lang.Void> listener)
flowId - Local flow identifier.listener - Async result listener. See SuccessListener.public void dispose()