diff --git a/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java b/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java deleted file mode 100644 index 3219dd569..000000000 --- a/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.sync; - -import com.todoroo.astrid.data.Metadata; -import com.todoroo.astrid.data.Task; - -import java.util.ArrayList; - -/** - * Container class for transmitting tasks and including local and remote - * metadata. Synchronization Providers can subclass this class if desired. - * - * @author Tim Su - * - */ -public class SyncContainer { - public Task task; - public ArrayList metadata; - - /** - * Method called when sync container is about to be saved into the database. - */ - public void prepareForSaving() { - // override me necessary - } -} diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java index b7b3519cd..da3aa4346 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java @@ -38,7 +38,7 @@ import javax.inject.Singleton; * */ @Singleton -public final class GtasksMetadataService extends SyncMetadataService { +public final class GtasksMetadataService extends SyncMetadataService { @Inject public GtasksMetadataService(TaskDao taskDao, MetadataDao metadataDao) { diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksTaskContainer.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksTaskContainer.java index 5eda083e3..e7fb78762 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksTaskContainer.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksTaskContainer.java @@ -11,11 +11,13 @@ import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.gtasks.GtasksMetadata; import com.todoroo.astrid.gtasks.api.GtasksApiUtilities; -import com.todoroo.astrid.sync.SyncContainer; import java.util.ArrayList; -public class GtasksTaskContainer extends SyncContainer { +public class GtasksTaskContainer { + + public Task task; + public ArrayList metadata; public Metadata gtaskMetadata; private final long updateTime; @@ -53,9 +55,7 @@ public class GtasksTaskContainer extends SyncContainer { return updateTime; } - @Override public void prepareForSaving() { - super.prepareForSaving(); metadata.add(gtaskMetadata); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java b/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java index cac25e6c9..0a9bb2d7a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java @@ -13,13 +13,13 @@ import com.todoroo.astrid.dao.MetadataDao; import com.todoroo.astrid.dao.MetadataDao.MetadataCriteria; import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.data.Metadata; -import com.todoroo.astrid.sync.SyncContainer; +import com.todoroo.astrid.gtasks.sync.GtasksTaskContainer; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; -abstract public class SyncMetadataService { +abstract public class SyncMetadataService { protected final TaskDao taskDao; protected final MetadataDao metadataDao; @@ -46,7 +46,7 @@ abstract public class SyncMetadataService { /** * Saves a task and its metadata */ - public void saveTaskAndMetadata(TYPE task) { + public void saveTaskAndMetadata(GtasksTaskContainer task) { task.prepareForSaving(); taskDao.save(task.task); synchronizeMetadata(task.task.getId(), task.metadata, getMetadataKey());