public class Model extends VirtualObject
| Modifier and Type | Class and Description |
|---|---|
static interface |
Model.Callback |
| Constructor and Description |
|---|
Model() |
Model(Repository repository,
java.util.Map<java.lang.String,? extends java.lang.Object> creationParameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy(Model.Callback callback)
Destroys the Model from the server.
|
java.lang.Object |
get(java.lang.String key)
Gets the value associated with a given key.
|
java.lang.Object |
getId()
Gets the model's id field.
|
void |
put(java.lang.String key,
java.lang.Object value)
Adds a given key-value pair to the dictionary.
|
void |
putAll(java.util.Map<java.lang.String,? extends java.lang.Object> params)
Adds all the specified params to the dictionary.
|
void |
save(Model.Callback callback)
Saves the Model to the server.
|
java.util.Map<java.lang.String,? extends java.lang.Object> |
toMap()
Converts the Model (and all of its Java Bean properties) into a
Map. |
getCreationParameters, getRepository, invokeMethod, setCreationParameters, setRepositorypublic Model(Repository repository, java.util.Map<java.lang.String,? extends java.lang.Object> creationParameters)
public Model()
public java.lang.Object getId()
public java.lang.Object get(java.lang.String key)
key - The key for which to return the corresponding value.null if no
value is associated with the key.public void put(java.lang.String key,
java.lang.Object value)
key - The key for value. If the key already exists
in the dictionary, the specified value takes its place.value - The value for the key. The value may be null.public void putAll(java.util.Map<java.lang.String,? extends java.lang.Object> params)
params - The params to add.public java.util.Map<java.lang.String,? extends java.lang.Object> toMap()
Map.public void save(Model.Callback callback)
This method calls toMap() to determine which fields should be
saved.
callback - The callback to be executed when finished.public void destroy(Model.Callback callback)
callback - The callback to be executed when finished.