public final class MesosferStoryline
extends java.lang.Object
MesosferStoryline
is a custom local representation of storyline data that can be saved and retrieved from the Mesosfer cloud.
The basic workflow for creating new data is to construct a new MesosferStoryline
by accessing
createStoryline()
, use setter method to fill it with storyline data, and then use
saveAsync(SaveCallback)
to persist to the cloud.
The basic workflow for accessing existing data is to use a MesosferQuery
to specify which
existing data to retrieve.Modifier and Type | Class and Description |
---|---|
static class |
MesosferStoryline.Campaign
The enum Campaign.
|
static class |
MesosferStoryline.ShowDay
The enum Show day.
|
Constructor and Description |
---|
MesosferStoryline() |
Modifier and Type | Method and Description |
---|---|
static MesosferStoryline |
createStoryline()
Constructs a new
MesosferStoryline with no data in it. |
static MesosferStoryline |
createWithObjectId(java.lang.String objectId)
Creates a reference to an existing
MesosferStoryline . |
void |
deleteAsync(DeleteCallback callback)
Deletes this object on the server in a background thread.
|
void |
fetchAsync(GetCallback<MesosferStoryline> callback)
Fetches this object with the data from the server in a background thread.
|
java.util.Date |
getCreatedAt()
This reports time as the server sees it, so that if you create a
MesosferStoryline ,
then wait a while, and then call saveAsync(SaveCallback) , the creation time will be
the time of the first saveAsync(SaveCallback) call rather than the time the object
was created locally. |
java.lang.String |
getObjectId()
Accessor to the object id.
|
static MesosferQuery<MesosferStoryline> |
getQuery()
Constructs a query for
MesosferStoryline . |
java.lang.String |
getTitle()
Gets storyline title.
|
java.util.Date |
getUpdatedAt()
This reports time as the server sees it, so that if you make changes to a
MesosferStoryline ,
then wait a while, and then call saveAsync(SaveCallback) , the updated time will be
the time of the saveAsync(SaveCallback) call rather than the time the object
was changed locally. |
boolean |
isDataAvailable()
Gets whether the
MesosferStoryline has been fetched. |
boolean |
isEnabled()
Flag that indicate if storyline is enabled or disabled.
|
MesosferStoryline |
isEnabled(boolean enabled)
Sets to enable or disable storyline.
|
void |
saveAsync(SaveCallback callback)
Saves this object with the data from the server in a background thread.
|
MesosferStoryline |
setTitle(java.lang.String title)
Sets storyline title.
|
org.json.JSONObject |
toJSON()
To put all keys and values of this
MesosferData into a JSONObject . |
java.lang.String |
toString() |
public static MesosferStoryline createWithObjectId(java.lang.String objectId)
MesosferStoryline
. Calling isDataAvailable()
on this object will return false
until fetchAsync(GetCallback)
has been called.objectId
- The object id for the referenced storyline object.MesosferStoryline
without data.public static MesosferStoryline createStoryline()
MesosferStoryline
with no data in it. A MesosferStoryline
constructed in this way will not have an objectId and will not persist to the database until
saveAsync(SaveCallback)
is called.MesosferStoryline
public java.lang.String getTitle()
public boolean isEnabled()
public boolean isDataAvailable()
MesosferStoryline
has been fetched.true
if the MesosferStoryline
is new or has been fetched.
false
otherwise.public java.lang.String getObjectId()
public java.util.Date getCreatedAt()
MesosferStoryline
,
then wait a while, and then call saveAsync(SaveCallback)
, the creation time will be
the time of the first saveAsync(SaveCallback)
call rather than the time the object
was created locally.public java.util.Date getUpdatedAt()
MesosferStoryline
,
then wait a while, and then call saveAsync(SaveCallback)
, the updated time will be
the time of the saveAsync(SaveCallback)
call rather than the time the object
was changed locally.public org.json.JSONObject toJSON()
MesosferData
into a JSONObject
.JSONObject
of all keys and valuespublic java.lang.String toString()
toString
in class java.lang.Object
public static MesosferQuery<MesosferStoryline> getQuery()
MesosferStoryline
.public MesosferStoryline setTitle(java.lang.String title)
title
- the storyline titlepublic MesosferStoryline isEnabled(boolean enabled)
enabled
- public void deleteAsync(DeleteCallback callback)
callback
- callback.done(e)
is called when the save completes.public void saveAsync(SaveCallback callback)
callback
- callback.done(e)
is called when the save completes.public void fetchAsync(GetCallback<MesosferStoryline> callback)
callback
- callback.done(object, e)
is called when the fetch completes.