Document is an arbitrary JSON value.
More...
|
|
final int | InfiniteDuration = 0 |
| | Time to live for a document, specifying no expiry.
|
| |
Document is an arbitrary JSON value.
You can set, get and modify this value.
To obtain an instance of a Document use SyncClient#openDocument.
| native JSONObject com.twilio.sync.Document.getData |
( |
| ) |
|
Get value of the document as a JSON object.
- Returns
- Document value.
| native String com.twilio.sync.Document.getSid |
( |
| ) |
|
Retrieves a machine-generated unique identifier for this Document.
- Returns
- Document SID.
| native String com.twilio.sync.Document.getUniqueName |
( |
| ) |
|
Retrieves a user-set unique name for this Document.
- Returns
- Document Unique Name.
Mutate value of the document using provided Mutator function.
Uses default metadata.
- Parameters
-
| void com.twilio.sync.Document.mutateData |
( |
Mutator |
mutator, |
|
|
Metadata |
metadata, |
|
|
SuccessListener< JSONObject > |
listener |
|
) |
| |
Mutate value of the document using provided Mutator function.
- Parameters
-
| mutator | Mutator which will be applied to document data. |
| metadata | Optional metadata for the updated document, currently only ttl. |
| listener | Async result listener. See SuccessListener. |
| void com.twilio.sync.Document.removeDocument |
( |
SuccessListener< Void > |
listener | ) |
|
Remove document.
- Parameters
-
| void com.twilio.sync.Document.setData |
( |
JSONObject |
data, |
|
|
SuccessListener< JSONObject > |
listener |
|
) |
| |
Set value of the document as a JSON object.
Uses default metadata.
- Parameters
-
| void com.twilio.sync.Document.setData |
( |
JSONObject |
data, |
|
|
Metadata |
metadata, |
|
|
SuccessListener< JSONObject > |
listener |
|
) |
| |
Set value of the document as a JSON object.
- Parameters
-
| data | New document data. |
| metadata | Optional metadata for the updated document, currently only ttl. |
| listener | Async result listener. See SuccessListener. |
| void com.twilio.sync.Document.setTtl |
( |
int |
ttl, |
|
|
SuccessListener< Void > |
listener |
|
) |
| |
Update the document’s time to live.
- Parameters
-