public interface AppDatabase
TaskResult
and StepResult
. It also provides a method for setting the encryption
key of the database, for encrypted databases (do nothing if your database is not encrypted).Modifier and Type | Method and Description |
---|---|
TaskResult |
loadLatestTaskResult(java.lang.String taskIdentifier)
Loads the latest task result for the given task identifier.
|
java.util.List<StepResult> |
loadStepResults(java.lang.String stepIdentifier)
Returns a list of all StepResults for the given step identifier.
|
java.util.List<TaskResult> |
loadTaskResults(java.lang.String taskIdentifier)
Returns a list of all TaskResults for the given task identifier.
|
void |
saveTaskResult(TaskResult result)
Saves the TaskResult to the database, along with its child StepResults
|
void |
setEncryptionKey(java.lang.String key)
Sets the encryption key on the database.
|
void saveTaskResult(TaskResult result)
result
- the task result to saveTaskResult loadLatestTaskResult(java.lang.String taskIdentifier)
This can be used to see when the user last answered the survey, or to get their most recent answer to a survey question.
taskIdentifier
- the task identifierjava.util.List<TaskResult> loadTaskResults(java.lang.String taskIdentifier)
taskIdentifier
- the task identifierjava.util.List<StepResult> loadStepResults(java.lang.String stepIdentifier)
stepIdentifier
- the step identifiervoid setEncryptionKey(java.lang.String key)
key
- a string key to be used to encrypt the database