public class TelepatSnappyDb extends java.lang.Object implements TelepatInternalDB
| Constructor and Description |
|---|
TelepatSnappyDb(android.content.Context mContext) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
channelKeys(java.lang.String channelIdentifier)
Get all the keys stored for a specific channel
|
void |
close()
Close the connection with the internal DB
|
void |
deleteChannelObjects(java.lang.String channelIdentifier)
Delete all objects stored in a specific channel
|
void |
deleteObject(java.lang.String channelIdentifier,
TelepatBaseModel object)
Delete an object from the internal DB
|
void |
empty()
Empty the internal DB
|
java.util.List<TelepatBaseModel> |
getChannelObjects(java.lang.String channelIdentifier,
java.lang.Class type)
Retrieve a list of all stored objects for a channel
|
TelepatBaseModel |
getObject(java.lang.String channelIdentifier,
int id,
java.lang.Class type)
Retrieve a stored object
|
java.lang.Object |
getOperationsData(java.lang.String key,
java.lang.Object defaultValue,
java.lang.Class type)
Telepat internal metadata - get a stored value
|
boolean |
objectExists(java.lang.String channelIdentifier,
int id)
Checks if an object exists in the internal DB
|
void |
persistObject(java.lang.String channelIdentifier,
TelepatBaseModel object)
Save an objects to the internal DB
|
void |
persistObjects(java.lang.String channelIdentifier,
TelepatBaseModel[] objects)
Save an array of objects to the internal DB
|
void |
setOperationsData(java.lang.String key,
java.lang.Object value)
Telepat internal metadata - sets a value on a specific key
|
public void setOperationsData(java.lang.String key,
java.lang.Object value)
setOperationsData in interface TelepatInternalDBkey - - the metadata keyvalue - - the metadata valuepublic java.lang.Object getOperationsData(java.lang.String key,
java.lang.Object defaultValue,
java.lang.Class type)
getOperationsData in interface TelepatInternalDBkey - the key the value is stored ondefaultValue - the default value to return if the key does not existtype - the type the return value should be casted topublic boolean objectExists(java.lang.String channelIdentifier,
int id)
objectExists in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored inid - the Telepat object IDpublic TelepatBaseModel getObject(java.lang.String channelIdentifier, int id, java.lang.Class type)
getObject in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored inid - the Telepat object IDtype - the class the object should be casted topublic void persistObject(java.lang.String channelIdentifier,
TelepatBaseModel object)
persistObject in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored inobject - the object to storepublic void persistObjects(java.lang.String channelIdentifier,
TelepatBaseModel[] objects)
persistObjects in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored inobjects - an array of objects to storepublic java.util.List<TelepatBaseModel> getChannelObjects(java.lang.String channelIdentifier, java.lang.Class type)
getChannelObjects in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored intype - the class the objects should be casted topublic java.lang.String[] channelKeys(java.lang.String channelIdentifier)
channelIdentifier - the identifier of the channel the object is stored inpublic void deleteChannelObjects(java.lang.String channelIdentifier)
deleteChannelObjects in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored inpublic void deleteObject(java.lang.String channelIdentifier,
TelepatBaseModel object)
deleteObject in interface TelepatInternalDBchannelIdentifier - the identifier of the channel the object is stored inobject - the object to deletepublic void empty()
empty in interface TelepatInternalDBpublic void close()
close in interface TelepatInternalDB