|
||||||||||
| 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 | |
|---|---|
static class |
StackMobModel.DateAsNumberTypeAdapter
|
| Constructor Summary | |
|---|---|
StackMobModel(Class<? extends StackMobModel> actualClass)
|
|
StackMobModel(String id,
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(String jsonName,
com.google.gson.JsonElement json)
|
|
protected void |
fillFromJson(com.google.gson.JsonElement json)
|
|
protected void |
fillFromJson(com.google.gson.JsonElement json,
List<String> selection)
|
|
void |
fillFromJson(String jsonString)
|
|
protected static StackMobModel |
getExistingModel(Collection<? extends StackMobModel> oldList,
com.google.gson.JsonElement json)
Finds a model with the same id as the json |
|
protected Collection<StackMobModel> |
getFieldAsCollection(Field field)
Turns a field which is either an Array or Collection of StackMobModels and turns in into a collection |
|
String |
getID()
|
|
String |
getIDFieldName()
|
|
protected 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)
|
|
static
|
query(Class<T> theClass,
StackMobQuery q,
StackMobQueryCallback<T> callback)
|
|
void |
save()
|
|
void |
save(StackMobCallback callback)
|
|
void |
saveWithDepth(int depth)
|
|
void |
saveWithDepth(int depth,
StackMobCallback callback)
|
|
protected void |
setActualClass(Class<? extends StackMobModel> actualClass)
|
|
protected void |
setFieldFromList(Field field,
List<? extends StackMobModel> list,
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(String id)
|
|
String |
toJson()
|
|
String |
toJsonWithDepth(int depth)
|
|
protected String |
toJsonWithDepth(int depth,
RelationMapping mapping)
Converts the object to JSON turning all Models into their ids |
|
protected static List<StackMobModel> |
updateModelListFromJson(com.google.gson.JsonArray array,
Collection<? extends StackMobModel> existingModels,
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(String id,
Class<? extends StackMobModel> actualClass)
public StackMobModel(Class<? extends StackMobModel> actualClass)
| Method Detail |
|---|
public static <T extends StackMobModel> void query(Class<T> theClass,
StackMobQuery q,
StackMobQueryCallback<T> callback)
public void setID(String id)
public String getID()
protected void setActualClass(Class<? extends StackMobModel> actualClass)
protected String getSchemaName()
public String getIDFieldName()
public boolean hasData()
protected void fillFieldFromJson(String jsonName,
com.google.gson.JsonElement json)
throws StackMobException
StackMobException
protected Collection<StackMobModel> getFieldAsCollection(Field field)
throws IllegalAccessException
IllegalAccessException
protected void setFieldFromList(Field field,
List<? extends StackMobModel> list,
Class<? extends StackMobModel> modelClass)
throws IllegalAccessException,
InstantiationException
IllegalAccessException
InstantiationException
protected static List<StackMobModel> updateModelListFromJson(com.google.gson.JsonArray array,
Collection<? extends StackMobModel> existingModels,
Class<? extends StackMobModel> modelClass)
throws IllegalAccessException,
InstantiationException,
StackMobException
IllegalAccessException
InstantiationException
StackMobException
protected static StackMobModel getExistingModel(Collection<? extends StackMobModel> oldList,
com.google.gson.JsonElement json)
oldList - The data in the object alreadyjson -
public void fillFromJson(String jsonString)
throws StackMobException
StackMobException
protected void fillFromJson(com.google.gson.JsonElement json)
throws StackMobException
StackMobException
protected void fillFromJson(com.google.gson.JsonElement json,
List<String> selection)
throws StackMobException
StackMobExceptionprotected boolean hasSameID(com.google.gson.JsonElement json)
json -
protected void setID(com.google.gson.JsonElement json)
public String toJson()
public String toJsonWithDepth(int depth)
protected 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 | |||||||||