|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AppData
Provides application data operations.
| Method Summary | ||
|---|---|---|
boolean |
contains(String identifier)
Returns true if an entry exists for the specified identifier in the database. |
|
boolean |
delete(String identifier)
Deletes the application data with the given identifier. |
|
Collection<AppDataInfo> |
getAllMetaData()
List of meta datas of the stored entries. |
|
AppDataInfo |
getMetaData(String identifier)
Getter for meta-info of an application data. |
|
|
load(String identifier,
Class<T> type)
Loads a copy of the stored object from the application data storage. |
|
|
save(String identifier,
T object)
Stores the application data persistently. |
|
| Method Detail |
|---|
<T> void save(String identifier,
T object)
throws AppDataException
Type definitions of class members must refer to the actual implementation class - interfaces, abstract classes or
super classes must be avoided.
Avoid: AbstractClass object = new ConcreteImpl();
Correct: ConcreteImpl object = new ConcreteImpl();
Collections must be defined as a collection of a concrete type implementation, Interfaces, abstract classes or
super classes cannot be restored.
Avoid: Collection<Object> objects = new LinkedList<ConcreteImpl>();
Correct: LinkedList<ConcreteImpl> objects = new LinkedList<ConcreteImpl>();
T - the type of the dataidentifier - the identifier which will provide access to the application data.object - the object to be stored.
AppDataException - if the saving was unsuccessful.boolean delete(String identifier)
identifier - the identifier of the application data
<T> T load(String identifier,
Class<T> type)
throws AppDataException
save(String, Object) for
limitations on saveable objects.
T - the type of the application dataidentifier - the identifier of the application datatype - the class representation of the application data e.g. MyData.class
AppDataException - If there was an error during restoring the object or no application data exists
with the given identifier.
AppDataInfo getMetaData(String identifier)
throws AppDataEntryNotFoundException
identifier - the identifier of the application data
AppDataEntryNotFoundException - if an error happened during getting the meta-info of the application data or there is no
application data with the given identifier.Collection<AppDataInfo> getAllMetaData()
boolean contains(String identifier)
identifier - unique identifier for the entry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||