|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.stackmob.sdk.model.StackMobModel
public abstract class StackMobModel
| Nested Class Summary | |
|---|---|
class |
StackMobModel.DateAsNumberTypeAdapter
|
| Constructor Summary | |
|---|---|
StackMobModel(java.lang.Class<? extends StackMobModel> actualClass)
|
|
StackMobModel(java.lang.String id,
java.lang.Class<? extends StackMobModel> actualClass)
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
destroy(StackMobCallback callback)
|
void |
fetch()
|
void |
fetch(StackMobCallback callback)
|
void |
fetchWithDepth(int depth,
StackMobCallback callback)
|
protected void |
fillFieldFromJson(java.lang.String jsonName,
com.google.gson.JsonElement json)
|
protected void |
fillFromJson(com.google.gson.JsonElement json)
|
protected void |
fillFromJson(com.google.gson.JsonElement json,
java.util.List<java.lang.String> selection)
|
void |
fillFromJson(java.lang.String jsonString)
|
protected static StackMobModel |
getExistingModel(java.util.Collection<? extends StackMobModel> oldList,
com.google.gson.JsonElement json)
Finds a model with the same id as the json |
protected java.util.Collection<StackMobModel> |
getFieldAsCollection(java.lang.reflect.Field field)
Turns a field which is either an Array or Collection of StackMobModels and turns in into a collection |
java.lang.String |
getID()
|
java.lang.String |
getIDFieldName()
|
protected java.lang.String |
getSchemaName()
Determines the schema connected to this class on the server. |
boolean |
hasData()
|
protected boolean |
hasSameID(com.google.gson.JsonElement json)
Checks if the current object has the same id as this json |
void |
load(int depth)
|
void |
save()
|
void |
save(StackMobCallback callback)
|
void |
saveWithDepth(int depth)
|
void |
saveWithDepth(int depth,
StackMobCallback callback)
|
protected void |
setFieldFromList(java.lang.reflect.Field field,
java.util.List<? extends StackMobModel> list,
java.lang.Class<? extends StackMobModel> modelClass)
Sets a field which is either an Array or Collection of StackMobModels using a list |
protected void |
setID(com.google.gson.JsonElement json)
|
void |
setID(java.lang.String id)
|
java.lang.String |
toJson()
|
java.lang.String |
toJsonWithDepth(int depth)
|
protected java.lang.String |
toJsonWithDepth(int depth,
RelationMapping mapping)
Converts the object to JSON turning all Models into their ids |
protected static java.util.List<StackMobModel> |
updateModelListFromJson(com.google.gson.JsonArray array,
java.util.Collection<? extends StackMobModel> existingModels,
java.lang.Class<? extends StackMobModel> modelClass)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StackMobModel(java.lang.String id,
java.lang.Class<? extends StackMobModel> actualClass)
public StackMobModel(java.lang.Class<? extends StackMobModel> actualClass)
| Method Detail |
|---|
public void setID(java.lang.String id)
public java.lang.String getID()
protected java.lang.String getSchemaName()
public java.lang.String getIDFieldName()
public boolean hasData()
protected void fillFieldFromJson(java.lang.String jsonName,
com.google.gson.JsonElement json)
throws StackMobException
StackMobException
protected java.util.Collection<StackMobModel> getFieldAsCollection(java.lang.reflect.Field field)
throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
protected void setFieldFromList(java.lang.reflect.Field field,
java.util.List<? extends StackMobModel> list,
java.lang.Class<? extends StackMobModel> modelClass)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.InstantiationException
protected static java.util.List<StackMobModel> updateModelListFromJson(com.google.gson.JsonArray array,
java.util.Collection<? extends StackMobModel> existingModels,
java.lang.Class<? extends StackMobModel> modelClass)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException,
StackMobException
java.lang.IllegalAccessException
java.lang.InstantiationException
StackMobException
protected static StackMobModel getExistingModel(java.util.Collection<? extends StackMobModel> oldList,
com.google.gson.JsonElement json)
oldList - The data in the object alreadyjson -
public void fillFromJson(java.lang.String jsonString)
throws StackMobException
StackMobException
protected void fillFromJson(com.google.gson.JsonElement json)
throws StackMobException
StackMobException
protected void fillFromJson(com.google.gson.JsonElement json,
java.util.List<java.lang.String> selection)
throws StackMobException
StackMobExceptionprotected boolean hasSameID(com.google.gson.JsonElement json)
json -
protected void setID(com.google.gson.JsonElement json)
public java.lang.String toJson()
public java.lang.String toJsonWithDepth(int depth)
protected java.lang.String toJsonWithDepth(int depth,
RelationMapping mapping)
public void fetch()
public void load(int depth)
public void fetch(StackMobCallback callback)
public void fetchWithDepth(int depth,
StackMobCallback callback)
public void save()
public void saveWithDepth(int depth)
public void save(StackMobCallback callback)
public void saveWithDepth(int depth,
StackMobCallback callback)
public void destroy()
public void destroy(StackMobCallback callback)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||