SyncDocument

interface SyncDocument

SyncDocument is an arbitrary JSON value.

You can set, get and modify this value.

To obtain an instance of a SyncDocument use openDocument.

Types

Link copied to clipboard
interface Metadata

Functions

Link copied to clipboard
abstract fun getData(): JSONObject
Get value of the document as a JSON object.
Link copied to clipboard
abstract fun getDateUpdated(): Date
Retrieves a Date when the Document was last updated.
Link copied to clipboard
abstract fun getSid(): String
Retrieves a machine-generated unique identifier for this SyncDocument.
Link copied to clipboard
abstract fun getUniqueName(): String
Retrieves a user-set unique name for this SyncDocument.
Link copied to clipboard
abstract fun mutateData(mutator: SyncMutator, listener: SuccessListener<JSONObject>)
abstract fun mutateData(mutator: SyncMutator, metadata: SyncDocument.Metadata, listener: SuccessListener<JSONObject>)
Mutate value of the document using provided Mutator function.
Link copied to clipboard
abstract fun removeDocument(listener: SuccessListener<Void>)
Remove document.
Link copied to clipboard
abstract fun setData(data: JSONObject, listener: SuccessListener<JSONObject>)
abstract fun setData(data: JSONObject, metadata: SyncDocument.Metadata, listener: SuccessListener<JSONObject>)
Set value of the document as a JSON object.
Link copied to clipboard
abstract fun setTtl(ttl: Int, listener: SuccessListener<Void>)
Set time to live for document object in seconds.

Properties

Link copied to clipboard
Time to live for a document, specifying no expiry.