Sync Android SDK  0.8.6
com.twilio.sync.Options Class Reference

Options are used to pass variable information to Document, Map, List and Stream opening functions. More...

Public Member Functions

native Options createWithUniqueName (String uniqueName)
 Creates a new object with specified unique name, fails if the given name is already in use. More...
 
native Options withUniqueName (String uniqueName)
 Creates a new object or opens an existing one with provided unique name. More...
 
native Options withUniqueName (String uniqueName, OpenMode mode)
 Creates a new object or opens an existing one with provided unique name, also given a specific opening mode. More...
 
native Options openWithSidOrUniqueName (String sidOrUniqueName)
 Opens an existing object with specified SID or unique name. More...
 
native Options withTtl (int ttl)
 Specifies the Time-to-Live of the Sync object in seconds. More...
 

Detailed Description

Options are used to pass variable information to Document, Map, List and Stream opening functions.

Typical usage pattern:

new Options().withUniqueName("myName")

Member Function Documentation

native Options com.twilio.sync.Options.createWithUniqueName ( String  uniqueName)

Creates a new object with specified unique name, fails if the given name is already in use.

Parameters
uniqueNameUnique name to assign to entity upon creation.
Returns
Self for chaining.
native Options com.twilio.sync.Options.openWithSidOrUniqueName ( String  sidOrUniqueName)

Opens an existing object with specified SID or unique name.

Implementation will automatically detect whether a SID or a unique name has been provided, and behave accordingly.

Parameters
sidOrUniqueNameSID or unique name to find existing entity or to assign to new entity upon creation.
Returns
Self for chaining.
native Options com.twilio.sync.Options.withTtl ( int  ttl)

Specifies the Time-to-Live of the Sync object in seconds.

This setting works with all object types, however note that it is applicable only when creating an object. When (re)opening an existing object, new TTL is not applied, and instead an old setting is retained, in order to avoid unexpected read-only object change.

native Options com.twilio.sync.Options.withUniqueName ( String  uniqueName)

Creates a new object or opens an existing one with provided unique name.

Parameters
uniqueNameUnique name to find existing entity or to assign to new entity upon creation.
Returns
Self for chaining.
native Options com.twilio.sync.Options.withUniqueName ( String  uniqueName,
OpenMode  mode 
)

Creates a new object or opens an existing one with provided unique name, also given a specific opening mode.

Parameters
uniqueNameUnique name to find existing entity or to assign to new entity upon creation.
modeOpen mode, one of the constants
Returns
Self for chaining.