More cleanup now that clean Dao classes are available from Dagger.

This commit is contained in:
Paul Hawke 2018-01-05 19:53:51 -06:00
parent 874627e3f5
commit 4bd72462e5
6 changed files with 48 additions and 41 deletions

View file

@ -24,20 +24,6 @@ public class ModifierSequenceDao {
this.clientProvider = clientProvider;
}
public ModifierSequence fromCursor(Cursor cursor) {
// Hardcoding column positions!
ModifierSequence ms = null;
try {
ms = new ModifierSequence(Uri.parse(cursor.getString(1)),
new JSONObject(cursor.getString(2)));
} catch (JSONException e) {
throw new RuntimeException(e);
}
ms.setContentUri( ModificationsContentProvider.uriForId(cursor.getInt(0)));
return ms;
}
public void save(ModifierSequence sequence) {
ContentProviderClient db = clientProvider.get();
try {
@ -64,6 +50,20 @@ public class ModifierSequenceDao {
}
}
ModifierSequence fromCursor(Cursor cursor) {
// Hardcoding column positions!
ModifierSequence ms = null;
try {
ms = new ModifierSequence(Uri.parse(cursor.getString(1)),
new JSONObject(cursor.getString(2)));
} catch (JSONException e) {
throw new RuntimeException(e);
}
ms.setContentUri( ModificationsContentProvider.uriForId(cursor.getInt(0)));
return ms;
}
private JSONObject toJSON(ModifierSequence sequence) {
JSONObject data = new JSONObject();
try {