From 5591eca34cfacf07f9de444bfe448891e575b6cf Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Sun, 26 Jan 2014 20:46:39 -0600 Subject: [PATCH] Add setters to replace setValues * Task * UserActivity * RemoteModel * TagData * Metadata * TaskListMetadata * TaskAttachment --- .../com/todoroo/astrid/data/Metadata.java | 16 ++++ .../com/todoroo/astrid/data/RemoteModel.java | 12 ++- .../java/com/todoroo/astrid/data/TagData.java | 32 +++++++ .../java/com/todoroo/astrid/data/Task.java | 96 +++++++++++++++++++ .../todoroo/astrid/data/TaskAttachment.java | 42 ++++++-- .../todoroo/astrid/data/TaskListMetadata.java | 12 +++ .../com/todoroo/astrid/data/UserActivity.java | 32 +++++++ .../astrid/backup/BackupServiceTests.java | 2 +- .../todoroo/astrid/dao/MetadataDaoTests.java | 34 +++---- .../com/todoroo/astrid/dao/TaskDaoTests.java | 32 +++---- .../astrid/gtasks/GtasksIndentActionTest.java | 2 +- .../gtasks/GtasksMetadataServiceTest.java | 6 +- .../gtasks/GtasksTaskListUpdaterTest.java | 2 +- .../astrid/gtasks/GtasksTaskMovingTest.java | 2 +- .../astrid/reminders/NotificationTests.java | 16 ++-- .../astrid/repeats/NewRepeatTests.java | 12 +-- .../astrid/service/QuickAddMarkupTest.java | 2 +- .../astrid/service/TitleParserTest.java | 74 +++++++------- .../astrid/subtasks/SubtasksHelperTest.java | 6 +- .../astrid/subtasks/SubtasksMovingTest.java | 4 +- .../todoroo/astrid/sync/NewSyncTestCase.java | 6 +- .../astrid/actfm/CommentsFragment.java | 2 +- .../astrid/actfm/TagCommentsFragment.java | 12 +-- .../astrid/actfm/TagSettingsActivity.java | 12 +-- .../todoroo/astrid/actfm/TagViewFragment.java | 8 +- .../astrid/activity/ShareLinkActivity.java | 2 +- .../astrid/activity/TaskEditFragment.java | 4 +- .../astrid/activity/TaskListFragment.java | 10 +- .../todoroo/astrid/adapter/TaskAdapter.java | 10 +- .../todoroo/astrid/adapter/UpdateAdapter.java | 16 ++-- .../astrid/alarms/AlarmControlSet.java | 2 +- .../todoroo/astrid/alarms/AlarmService.java | 2 +- .../astrid/backup/TasksXmlImporter.java | 42 ++++---- .../astrid/calls/MissedCallActivity.java | 4 +- .../astrid/core/OldTaskPreferences.java | 6 +- .../com/todoroo/astrid/dao/MetadataDao.java | 4 +- .../todoroo/astrid/dao/RemoteModelDao.java | 2 +- .../todoroo/astrid/dao/TagMetadataDao.java | 2 +- .../java/com/todoroo/astrid/dao/TaskDao.java | 20 ++-- .../todoroo/astrid/dao/UserActivityDao.java | 2 +- .../todoroo/astrid/files/FilesControlSet.java | 6 +- .../astrid/gcal/CalendarAlarmListCreator.java | 2 +- .../todoroo/astrid/gcal/GCalControlSet.java | 2 +- .../com/todoroo/astrid/gcal/GCalHelper.java | 8 +- .../astrid/gtasks/GtasksListFragment.java | 2 +- .../todoroo/astrid/gtasks/GtasksMetadata.java | 4 +- .../astrid/gtasks/sync/GtasksSyncService.java | 2 +- .../gtasks/sync/GtasksSyncV2Provider.java | 20 ++-- .../astrid/notes/EditNoteActivity.java | 14 +-- .../astrid/provider/Astrid2TaskProvider.java | 10 +- .../astrid/reminders/Notifications.java | 4 +- .../astrid/reminders/ReminderDialog.java | 2 +- .../astrid/repeats/RepeatControlSet.java | 4 +- .../repeats/RepeatTaskCompleteListener.java | 6 +- .../astrid/service/MetadataService.java | 4 +- .../todoroo/astrid/service/TaskService.java | 24 ++--- .../AstridOrderedListFragmentHelper.java | 4 +- .../OrderedMetadataListFragmentHelper.java | 4 +- .../subtasks/SubtasksFilterUpdater.java | 2 +- .../com/todoroo/astrid/tags/TagService.java | 14 +-- .../todoroo/astrid/tags/TagsControlSet.java | 2 +- .../astrid/tags/TaskToTagMetadata.java | 6 +- .../todoroo/astrid/timers/TimerPlugin.java | 6 +- .../todoroo/astrid/ui/DateChangedAlerts.java | 8 +- .../todoroo/astrid/ui/DeadlineControlSet.java | 4 +- .../astrid/ui/EditNotesControlSet.java | 2 +- .../astrid/ui/EditTitleControlSet.java | 2 +- .../astrid/ui/HideUntilControlSet.java | 2 +- .../astrid/ui/ImportanceControlSet.java | 2 +- .../com/todoroo/astrid/ui/QuickAddBar.java | 4 +- .../astrid/ui/RandomReminderControlSet.java | 4 +- .../todoroo/astrid/ui/ReminderControlSet.java | 2 +- .../todoroo/astrid/utility/TitleParser.java | 16 ++-- .../reminders/NotifyAtDeadlineTest.java | 22 ++--- .../astrid/reminders/ReminderServiceTest.java | 50 +++++----- .../astrid/repeats/AdvancedRepeatTest.java | 8 +- .../RepeatTaskCompleteListenerTest.java | 4 +- .../astrid/gtasks/GtasksNewSyncTest.java | 20 ++-- .../astrid/gtasks/GtasksSyncOnSaveTest.java | 12 +-- .../sync/repeats/AbstractSyncRepeatTests.java | 12 +-- 80 files changed, 574 insertions(+), 356 deletions(-) diff --git a/api/src/main/java/com/todoroo/astrid/data/Metadata.java b/api/src/main/java/com/todoroo/astrid/data/Metadata.java index 34b30447b..edd07d5c4 100644 --- a/api/src/main/java/com/todoroo/astrid/data/Metadata.java +++ b/api/src/main/java/com/todoroo/astrid/data/Metadata.java @@ -127,15 +127,31 @@ public class Metadata extends AbstractModel { return getValue(DELETION_DATE); } + public void setDeletionDate(Long deletionDate) { + setValue(DELETION_DATE, deletionDate); + } + public Long getTask() { return getValue(TASK); } + public void setTask(Long task) { + setValue(TASK, task); + } + public Long getCreationDate() { return getValue(CREATION_DATE); } + public void setCreationDate(Long creationDate) { + setValue(CREATION_DATE, creationDate); + } + public String getKey() { return getValue(KEY); } + + public void setKey(String key) { + setValue(KEY, key); + } } diff --git a/api/src/main/java/com/todoroo/astrid/data/RemoteModel.java b/api/src/main/java/com/todoroo/astrid/data/RemoteModel.java index fd717e10e..4b16383ac 100644 --- a/api/src/main/java/com/todoroo/astrid/data/RemoteModel.java +++ b/api/src/main/java/com/todoroo/astrid/data/RemoteModel.java @@ -61,10 +61,6 @@ abstract public class RemoteModel extends AbstractModel { } } - public String getUuidProperty() { - return getValue(UUID_PROPERTY); - } - protected String getUuidHelper(StringProperty uuid) { if(setValues != null && setValues.containsKey(uuid.name)) { return setValues.getAsString(uuid.name); @@ -188,4 +184,12 @@ abstract public class RemoteModel extends AbstractModel { } } + + public String getUuidProperty() { + return getValue(UUID_PROPERTY); + } + + public void setUuidProperty(String uuidProperty) { + setValue(UUID_PROPERTY, uuidProperty); + } } diff --git a/api/src/main/java/com/todoroo/astrid/data/TagData.java b/api/src/main/java/com/todoroo/astrid/data/TagData.java index 3ce83ad0d..ba54cc784 100644 --- a/api/src/main/java/com/todoroo/astrid/data/TagData.java +++ b/api/src/main/java/com/todoroo/astrid/data/TagData.java @@ -219,6 +219,10 @@ public final class TagData extends RemoteModel { return getValue(NAME); } + public void setName(String name) { + setValue(NAME, name); + } + public String getTagOrdering() { return getValue(TAG_ORDERING); } @@ -227,15 +231,43 @@ public final class TagData extends RemoteModel { return getValue(LAST_AUTOSYNC); } + public void setLastAutosync(Long lastAutosync) { + setValue(LAST_AUTOSYNC, lastAutosync); + } + public String getUUID() { return getValue(UUID); } + public void setUUID(String uuid) { + setValue(UUID, uuid); + } + public Integer getTaskCount() { return getValue(TASK_COUNT); } + public void setTaskCount(Integer taskCount) { + setValue(TASK_COUNT, taskCount); + } + public String getMembers() { return getValue(MEMBERS); } + + public void setMembers(String members) { + setValue(MEMBERS, members); + } + + public void setDeletionDate(Long deletionDate) { + setValue(DELETION_DATE, deletionDate); + } + + public void setMemberCount(Integer memberCount) { + setValue(MEMBER_COUNT, memberCount); + } + + public void setPicture(String picture) { + setValue(PICTURE, picture); + } } diff --git a/api/src/main/java/com/todoroo/astrid/data/Task.java b/api/src/main/java/com/todoroo/astrid/data/Task.java index 3505545e8..133c161e2 100644 --- a/api/src/main/java/com/todoroo/astrid/data/Task.java +++ b/api/src/main/java/com/todoroo/astrid/data/Task.java @@ -490,14 +490,26 @@ public class Task extends RemoteModel { return getValue(DUE_DATE); } + public void setDueDate(Long dueDate) { + setValue(DUE_DATE, dueDate); + } + public String getRecurrence() { return getValue(RECURRENCE); } + public void setRecurrence(String recurrence) { + setValue(RECURRENCE, recurrence); + } + public Long getCreationDate() { return getValue(CREATION_DATE); } + public void setCreationDate(Long creationDate) { + setValue(CREATION_DATE, creationDate); + } + public String getUUID() { return getValue(UUID); } @@ -506,26 +518,50 @@ public class Task extends RemoteModel { return getValue(TITLE); } + public void setTitle(String title) { + setValue(TITLE, title); + } + public String getDetails() { return getValue(DETAILS); } + public void setDetails(String details) { + setValue(DETAILS, details); + } + public Long getDeletionDate() { return getValue(DELETION_DATE); } + public void setDeletionDate(Long deletionDate) { + setValue(DELETION_DATE, deletionDate); + } + public Long getHideUntil() { return getValue(HIDE_UNTIL); } + public void setHideUntil(Long hideUntil) { + setValue(HIDE_UNTIL, hideUntil); + } + public Long getReminderLast() { return getValue(REMINDER_LAST); } + public void setReminderLast(Long reminderLast) { + setValue(REMINDER_LAST, reminderLast); + } + public Long getReminderSnooze() { return getValue(REMINDER_SNOOZE); } + public void setReminderSnooze(Long reminderSnooze) { + setValue(REMINDER_SNOOZE, reminderSnooze); + } + public Integer getElapsedSeconds() { return getValue(ELAPSED_SECONDS); } @@ -534,10 +570,18 @@ public class Task extends RemoteModel { return getValue(TIMER_START); } + public void setTimerStart(Long timerStart) { + setValue(TIMER_START, timerStart); + } + public Long getRepeatUntil() { return getValue(REPEAT_UNTIL); } + public void setRepeatUntil(Long repeatUntil) { + setValue(REPEAT_UNTIL, repeatUntil); + } + public String getCalendarURI() { return getValue(CALENDAR_URI); } @@ -550,31 +594,83 @@ public class Task extends RemoteModel { return getValue(IMPORTANCE); } + public void setImportance(Integer importance) { + setValue(IMPORTANCE, importance); + } + public Long getCompletionDate() { return getValue(COMPLETION_DATE); } + public void setCompletionDate(Long completionDate) { + setValue(COMPLETION_DATE, completionDate); + } + public Long getDetailsDate() { return getValue(DETAILS_DATE); } + public void setDetailsDate(Long detailsDate) { + setValue(DETAILS_DATE, detailsDate); + } + public String getNotes() { return getValue(NOTES); } + public void setNotes(String notes) { + setValue(NOTES, notes); + } + public Long getModificationDate() { return getValue(MODIFICATION_DATE); } + public void setModificationDate(Long modificationDate) { + setValue(MODIFICATION_DATE, modificationDate); + } + public Integer getReminderFlags() { return getValue(REMINDER_FLAGS); } + public void setReminderFlags(Integer reminderFlags) { + setValue(REMINDER_FLAGS, reminderFlags); + } + public Long getReminderPeriod() { return getValue(REMINDER_PERIOD); } + public void setReminderPeriod(Long reminderPeriod) { + setValue(REMINDER_PERIOD, reminderPeriod); + } + public Integer getEstimatedSeconds() { return getValue(ESTIMATED_SECONDS); } + + public void setEstimatedSeconds(Integer estimatedSeconds) { + setValue(ESTIMATED_SECONDS, estimatedSeconds); + } + + public void setSocialReminder(String socialReminder) { + setValue(SOCIAL_REMINDER, socialReminder); + } + + public void setPostponeCount(Integer postponeCount) { + setValue(POSTPONE_COUNT, postponeCount); + } + + public void setELAPSED_SECONDS(Integer elapsedSeconds) { + setValue(ELAPSED_SECONDS, elapsedSeconds); + } + + public void setCalendarUri(String calendarUri) { + setValue(CALENDAR_URI, calendarUri); + } + + public void setID(Long id) { + setValue(ID, id); + } } diff --git a/api/src/main/java/com/todoroo/astrid/data/TaskAttachment.java b/api/src/main/java/com/todoroo/astrid/data/TaskAttachment.java index 59e941fa8..9a5307b11 100644 --- a/api/src/main/java/com/todoroo/astrid/data/TaskAttachment.java +++ b/api/src/main/java/com/todoroo/astrid/data/TaskAttachment.java @@ -135,13 +135,13 @@ public final class TaskAttachment extends RemoteModel { public static TaskAttachment createNewAttachment(String taskUuid, String filePath, String fileName, String fileType) { TaskAttachment attachment = new TaskAttachment(); - attachment.setValue(TaskAttachment.TASK_UUID, taskUuid); - attachment.setValue(NAME, fileName); - attachment.setValue(USER_UUID, Task.USER_ID_SELF); - attachment.setValue(FILE_PATH, filePath); - attachment.setValue(CONTENT_TYPE, fileType); - attachment.setValue(CREATED_AT, DateUtilities.now()); - attachment.setValue(DELETED_AT, 0L); + attachment.setTaskUUID(taskUuid); + attachment.setName(fileName); + attachment.setUserUUID(Task.USER_ID_SELF); + attachment.setFilePath(filePath); + attachment.setContentType(fileType); + attachment.setCreatedAt(DateUtilities.now()); + attachment.setDeletedAt(0L); return attachment; } @@ -169,14 +169,38 @@ public final class TaskAttachment extends RemoteModel { public static final Creator CREATOR = new ModelCreator<>(TaskAttachment.class); + public void setDeletedAt(Long deletedAt) { + setValue(DELETED_AT, deletedAt); + } + + public void setCreatedAt(Long createdAt) { + setValue(CREATED_AT, createdAt); + } + + public void setUserUUID(String userUuid) { + setValue(USER_UUID, userUuid); + } + + public void setTaskUUID(String taskUuid) { + setValue(TASK_UUID, taskUuid); + } + public String getName() { return getValue(NAME); } + public void setName(String name) { + setValue(NAME, name); + } + public String getContentType() { return getValue(CONTENT_TYPE); } + public void setContentType(String contentType) { + setValue(CONTENT_TYPE, contentType); + } + public String getUUID() { return getValue(UUID); } @@ -184,4 +208,8 @@ public final class TaskAttachment extends RemoteModel { public String getFilePath() { return getValue(FILE_PATH); } + + public void setFilePath(String filePath) { + setValue(FILE_PATH, filePath); + } } diff --git a/api/src/main/java/com/todoroo/astrid/data/TaskListMetadata.java b/api/src/main/java/com/todoroo/astrid/data/TaskListMetadata.java index b94b2c22a..bbd0d4f9e 100644 --- a/api/src/main/java/com/todoroo/astrid/data/TaskListMetadata.java +++ b/api/src/main/java/com/todoroo/astrid/data/TaskListMetadata.java @@ -123,4 +123,16 @@ public final class TaskListMetadata extends RemoteModel { public String getTaskIDs() { return getValue(TASK_IDS); } + + public void setTaskIDs(String taskIds) { + setValue(TASK_IDS, taskIds); + } + + public void setTagUUID(String tagUuid) { + setValue(TAG_UUID, tagUuid); + } + + public void setFilter(String filter) { + setValue(FILTER, filter); + } } diff --git a/api/src/main/java/com/todoroo/astrid/data/UserActivity.java b/api/src/main/java/com/todoroo/astrid/data/UserActivity.java index 66579fbe2..1d9b8583c 100644 --- a/api/src/main/java/com/todoroo/astrid/data/UserActivity.java +++ b/api/src/main/java/com/todoroo/astrid/data/UserActivity.java @@ -112,7 +112,39 @@ public class UserActivity extends RemoteModel { return getValue(CREATED_AT); } + public void setCreatedAt(Long createdAt) { + setValue(CREATED_AT, createdAt); + } + public String getMessage() { return getValue(MESSAGE); } + + public void setMessage(String message) { + setValue(MESSAGE, message); + } + + public void setUserUUID(String userUuid) { + setValue(USER_UUID, userUuid); + } + + public void setTargetName(String targetName) { + setValue(TARGET_NAME, targetName); + } + + public void setTargetId(String targetId) { + setValue(TARGET_ID, targetId); + } + + public void setAction(String action) { + setValue(ACTION, action); + } + + public void setUUID(String uuid) { + setValue(UUID, uuid); + } + + public void setPicture(String picture) { + setValue(PICTURE, picture); + } } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/backup/BackupServiceTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/backup/BackupServiceTests.java index 04a45dfd0..db3577fa7 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/backup/BackupServiceTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/backup/BackupServiceTests.java @@ -50,7 +50,7 @@ public class BackupServiceTests extends DatabaseTestCase { // make a temporary task Task task = new Task(); - task.setValue(Task.TITLE, "helicopter"); + task.setTitle("helicopter"); taskDao.createNew(task); } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/MetadataDaoTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/MetadataDaoTests.java index 49c80e72e..41fde5493 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/MetadataDaoTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/MetadataDaoTests.java @@ -36,7 +36,7 @@ public class MetadataDaoTests extends DatabaseTestCase { // create "happy" Metadata metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "happy"); + metadata.setKey("happy"); assertTrue(metadataDao.persist(metadata)); cursor = metadataDao.query( Query.select(Metadata.ID)); @@ -49,7 +49,7 @@ public class MetadataDaoTests extends DatabaseTestCase { // create "sad" metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "sad"); + metadata.setKey("sad"); assertTrue(metadataDao.persist(metadata)); cursor = metadataDao.query(Query.select(Metadata.ID)); assertEquals(2, cursor.getCount()); @@ -58,7 +58,7 @@ public class MetadataDaoTests extends DatabaseTestCase { // rename sad to melancholy long sadId = metadata.getId(); assertNotSame(Metadata.NO_ID, sadId); - metadata.setValue(Metadata.KEY, "melancholy"); + metadata.setKey("melancholy"); assertTrue(metadataDao.persist(metadata)); cursor = metadataDao.query( Query.select(Metadata.ID)); @@ -88,18 +88,18 @@ public class MetadataDaoTests extends DatabaseTestCase { public void testMetadataConditions() throws Exception { // create "happy" Metadata metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with1"); - metadata.setValue(Metadata.TASK, 1L); + metadata.setKey("with1"); + metadata.setTask(1L); assertTrue(metadataDao.persist(metadata)); metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with2"); - metadata.setValue(Metadata.TASK, 2L); + metadata.setKey("with2"); + metadata.setTask(2L); assertTrue(metadataDao.persist(metadata)); metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with1"); - metadata.setValue(Metadata.TASK, 1L); + metadata.setKey("with1"); + metadata.setTask(1L); assertTrue(metadataDao.persist(metadata)); @@ -149,18 +149,18 @@ public class MetadataDaoTests extends DatabaseTestCase { cursor.close(); Metadata metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with1"); - metadata.setValue(Metadata.TASK, task1.getId()); + metadata.setKey("with1"); + metadata.setTask(task1.getId()); assertTrue(metadataDao.persist(metadata)); metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with2"); - metadata.setValue(Metadata.TASK, task2.getId()); + metadata.setKey("with2"); + metadata.setTask(task2.getId()); assertTrue(metadataDao.persist(metadata)); metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with3"); - metadata.setValue(Metadata.TASK, task3.getId()); + metadata.setKey("with3"); + metadata.setTask(task3.getId()); assertTrue(metadataDao.persist(metadata)); // fetch with tasks and corresponding metadata @@ -178,8 +178,8 @@ public class MetadataDaoTests extends DatabaseTestCase { cursor.close(); metadata = new Metadata(); - metadata.setValue(Metadata.KEY, "with2"); - metadata.setValue(Metadata.TASK, task2Id); + metadata.setKey("with2"); + metadata.setTask(task2Id); assertTrue(metadataDao.persist(metadata)); // but if we simulate something bad happening by creating diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/TaskDaoTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/TaskDaoTests.java index 824867ef4..6f92522e8 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/TaskDaoTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/dao/TaskDaoTests.java @@ -36,7 +36,7 @@ public class TaskDaoTests extends DatabaseTestCase { // create task "happy" Task task = new Task(); - task.setValue(Task.TITLE, "happy"); + task.setTitle("happy"); assertTrue(taskDao.save(task)); cursor = taskDao.query( Query.select(IDS)); @@ -49,7 +49,7 @@ public class TaskDaoTests extends DatabaseTestCase { // create task "sad" task = new Task(); - task.setValue(Task.TITLE, "sad"); + task.setTitle("sad"); assertTrue(taskDao.save(task)); cursor = taskDao.query( Query.select(IDS)); @@ -59,7 +59,7 @@ public class TaskDaoTests extends DatabaseTestCase { // rename sad to melancholy long sadId = task.getId(); assertNotSame(Task.NO_ID, sadId); - task.setValue(Task.TITLE, "melancholy"); + task.setTitle("melancholy"); assertTrue(taskDao.save(task)); cursor = taskDao.query( Query.select(IDS)); @@ -79,35 +79,35 @@ public class TaskDaoTests extends DatabaseTestCase { public void testTaskConditions() throws Exception { // create normal task Task task = new Task(); - task.setValue(Task.TITLE, "normal"); + task.setTitle("normal"); assertTrue(taskDao.save(task)); // create blank task task = new Task(); - task.setValue(Task.TITLE, ""); + task.setTitle(""); assertTrue(taskDao.save(task)); // create hidden task task = new Task(); - task.setValue(Task.TITLE, "hidden"); - task.setValue(Task.HIDE_UNTIL, DateUtilities.now() + 10000); + task.setTitle("hidden"); + task.setHideUntil(DateUtilities.now() + 10000); assertTrue(taskDao.save(task)); // create task with deadlines task = new Task(); - task.setValue(Task.TITLE, "deadlineInFuture"); - task.setValue(Task.DUE_DATE, DateUtilities.now() + 10000); + task.setTitle("deadlineInFuture"); + task.setDueDate(DateUtilities.now() + 10000); assertTrue(taskDao.save(task)); task = new Task(); - task.setValue(Task.TITLE, "deadlineInPast"); - task.setValue(Task.DUE_DATE, DateUtilities.now() - 10000); + task.setTitle("deadlineInPast"); + task.setDueDate(DateUtilities.now() - 10000); assertTrue(taskDao.save(task)); // create completed task task = new Task(); - task.setValue(Task.TITLE, "completed"); - task.setValue(Task.COMPLETION_DATE, DateUtilities.now() - 10000); + task.setTitle("completed"); + task.setCompletionDate(DateUtilities.now() - 10000); assertTrue(taskDao.save(task)); // check has no name @@ -169,7 +169,7 @@ public class TaskDaoTests extends DatabaseTestCase { // create task "happy" Task task = new Task(); - task.setValue(Task.TITLE, "happy"); + task.setTitle("happy"); assertTrue(taskDao.save(task)); cursor = taskDao.query( Query.select(IDS)); @@ -193,8 +193,8 @@ public class TaskDaoTests extends DatabaseTestCase { // try to save task "happy" Task task = new Task(); - task.setValue(Task.TITLE, "happy"); - task.setValue(Task.ID, 1L); + task.setTitle("happy"); + task.setID(1L); assertFalse(taskDao.save(task)); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksIndentActionTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksIndentActionTest.java index 706d0248a..b104be653 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksIndentActionTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksIndentActionTest.java @@ -155,7 +155,7 @@ public class GtasksIndentActionTest extends DatabaseTestCase { metadata.setValue(GtasksMetadata.INDENT, indentation); metadata.setValue(GtasksMetadata.ORDER, order); metadata.setValue(GtasksMetadata.LIST_ID, "list"); - metadata.setValue(Metadata.TASK, newTask.getId()); + metadata.setTask(newTask.getId()); PluginServices.getMetadataService().save(metadata); return newTask; } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksMetadataServiceTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksMetadataServiceTest.java index 9a12d1c40..424796f58 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksMetadataServiceTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksMetadataServiceTest.java @@ -132,12 +132,12 @@ public class GtasksMetadataServiceTest extends DatabaseTestCase { private Task taskWithMetadata(String id) { Task task = new Task(); - task.setValue(Task.TITLE, "cats"); + task.setTitle("cats"); PluginServices.getTaskService().save(task); Metadata metadata = GtasksMetadata.createEmptyMetadata(task.getId()); if(id != null) metadata.setValue(GtasksMetadata.ID, id); - metadata.setValue(Metadata.TASK, task.getId()); + metadata.setTask(task.getId()); PluginServices.getMetadataService().save(metadata); return task; } @@ -148,7 +148,7 @@ public class GtasksMetadataServiceTest extends DatabaseTestCase { private Task taskWithoutMetadata() { Task task = new Task(); - task.setValue(Task.TITLE, "dogs"); + task.setTitle("dogs"); PluginServices.getTaskService().save(task); return task; } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskListUpdaterTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskListUpdaterTest.java index a5d0f2bc8..c07c67e2b 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskListUpdaterTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskListUpdaterTest.java @@ -163,7 +163,7 @@ public class GtasksTaskListUpdaterTest extends DatabaseTestCase { private Task createTask(String title, long order, int indent) { Task task = new Task(); - task.setValue(Task.TITLE, title); + task.setTitle(title); PluginServices.getTaskService().save(task); Metadata metadata = GtasksMetadata.createEmptyMetadata(task.getId()); metadata.setValue(GtasksMetadata.LIST_ID, "1"); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskMovingTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskMovingTest.java index c0ffa72cb..5c90d6646 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskMovingTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/gtasks/GtasksTaskMovingTest.java @@ -272,7 +272,7 @@ public class GtasksTaskMovingTest extends DatabaseTestCase { private Task createTask(String title, long order, int indent) { Task task = new Task(); - task.setValue(Task.TITLE, title); + task.setTitle(title); PluginServices.getTaskService().save(task); Metadata metadata = GtasksMetadata.createEmptyMetadata(task.getId()); metadata.setValue(GtasksMetadata.LIST_ID, "1"); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/reminders/NotificationTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/reminders/NotificationTests.java index a1f75df39..69fd29711 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/reminders/NotificationTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/reminders/NotificationTests.java @@ -43,8 +43,8 @@ public class NotificationTests extends DatabaseTestCase { /** test that a normal task gets a notification */ public void testAlarmToNotification() { final Task task = new Task(); - task.setValue(Task.TITLE, "rubberduck"); - task.setValue(Task.DUE_DATE, DateUtilities.now() - DateUtilities.ONE_DAY); + task.setTitle("rubberduck"); + task.setDueDate(DateUtilities.now() - DateUtilities.ONE_DAY); taskDao.persist(task); final MutableBoolean triggered = new MutableBoolean(); @@ -67,8 +67,8 @@ public class NotificationTests extends DatabaseTestCase { /** test that a deleted task doesn't get a notification */ public void testDeletedTask() { final Task task = new Task(); - task.setValue(Task.TITLE, "gooeyduck"); - task.setValue(Task.DELETION_DATE, DateUtilities.now()); + task.setTitle("gooeyduck"); + task.setDeletionDate(DateUtilities.now()); taskDao.persist(task); Notifications.setNotificationManager(new NotificationManager() { @@ -92,8 +92,8 @@ public class NotificationTests extends DatabaseTestCase { /** test that a completed task doesn't get a notification */ public void testCompletedTask() { final Task task = new Task(); - task.setValue(Task.TITLE, "rubberduck"); - task.setValue(Task.COMPLETION_DATE, DateUtilities.now()); + task.setTitle("rubberduck"); + task.setCompletionDate(DateUtilities.now()); taskDao.persist(task); Notifications.setNotificationManager(new NotificationManager() { @@ -117,7 +117,7 @@ public class NotificationTests extends DatabaseTestCase { /** test of quiet hours */ public void testQuietHours() { final Task task = new Task(); - task.setValue(Task.TITLE, "rubberduck"); + task.setTitle("rubberduck"); taskDao.persist(task); Intent intent = new Intent(); intent.putExtra(Notifications.ID_KEY, task.getId()); @@ -166,7 +166,7 @@ public class NotificationTests extends DatabaseTestCase { new Notifications().onReceive(getContext(), intent); // nonstop notification still sounds - task.setValue(Task.REMINDER_FLAGS, Task.NOTIFY_MODE_NONSTOP); + task.setReminderFlags(Task.NOTIFY_MODE_NONSTOP); taskDao.persist(task); Notifications.setNotificationManager(new TestNotificationManager() { public void notify(int id, Notification notification) { diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java index 1f3f9e89d..51f250558 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java @@ -67,7 +67,7 @@ public class NewRepeatTests extends DatabaseTestCase { completionDate = dueDate - DateUtilities.ONE_DAY; else completionDate = dueDate + DateUtilities.ONE_DAY; - t.setValue(Task.COMPLETION_DATE, completionDate); + t.setCompletionDate(completionDate); saveAndTriggerRepeatListener(t); return completionDate; } @@ -88,10 +88,10 @@ public class NewRepeatTests extends DatabaseTestCase { public void testNoRepeat() { Task t = new Task(); - t.setValue(Task.TITLE, "no repeat"); + t.setTitle("no repeat"); taskDao.save(t); - t.setValue(Task.COMPLETION_DATE, DateUtilities.now()); + t.setCompletionDate(DateUtilities.now()); saveAndTriggerRepeatListener(t); TodorooCursor cursor = taskDao.query(Query.select(Task.ID)); @@ -105,14 +105,14 @@ public class NewRepeatTests extends DatabaseTestCase { protected void testRepeating(boolean completeBefore, boolean fromCompletion, RRule rrule, Frequency frequency, String title) { Task t = new Task(); - t.setValue(Task.TITLE, title); + t.setTitle(title); long dueDate = DateUtilities.now() + DateUtilities.ONE_DAY * 3; Date adjustDate = newDate(dueDate); adjustDate.setSeconds(1); dueDate = adjustDate.getTime(); dueDate = (dueDate / 1000L) * 1000L; // Strip milliseconds - t.setValue(Task.DUE_DATE, dueDate); + t.setDueDate(dueDate); if (rrule == null) { rrule = new RRule(); @@ -124,7 +124,7 @@ public class NewRepeatTests extends DatabaseTestCase { String result = rrule.toIcal(); if (fromCompletion) result = result + ";FROM=COMPLETION"; - t.setValue(Task.RECURRENCE, result); + t.setRecurrence(result); taskDao.save(t); waitAndSync(); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/service/QuickAddMarkupTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/service/QuickAddMarkupTest.java index d8b1905c2..3b4e9593d 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/service/QuickAddMarkupTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/service/QuickAddMarkupTest.java @@ -83,7 +83,7 @@ public class QuickAddMarkupTest extends DatabaseTestCase { private void whenTitleIs(String title) { task = new Task(); - task.setValue(Task.TITLE, title); + task.setTitle(title); tags.clear(); TaskService.parseQuickAddMarkup(task, tags); } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/service/TitleParserTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/service/TitleParserTest.java index 96660e4bd..fde26830a 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/service/TitleParserTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/service/TitleParserTest.java @@ -36,7 +36,7 @@ public class TitleParserTest extends DatabaseTestCase { TaskService taskService = new TaskService(); Task task = new Task(); Task nothing = new Task(); - task.setValue(Task.TITLE, "Jog"); + task.setTitle("Jog"); taskService.save(task); assertFalse(task.hasDueTime()); assertFalse(task.hasDueDate()); @@ -159,7 +159,7 @@ public class TitleParserTest extends DatabaseTestCase { private void insertTitleAddTask(String title, Task task) { task.clear(); - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); } @@ -171,7 +171,7 @@ public class TitleParserTest extends DatabaseTestCase { Task task = new Task(); String title = "Jog today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); Date date = newDate(task.getDueDate()); assertEquals(date.getDay()+1, today.get(Calendar.DAY_OF_WEEK)); @@ -179,7 +179,7 @@ public class TitleParserTest extends DatabaseTestCase { task = new Task(); title = "Jog tomorrow"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); date = newDate(task.getDueDate()); assertEquals((date.getDay()+1) % 7, (today.get(Calendar.DAY_OF_WEEK)+1) % 7); @@ -206,14 +206,14 @@ public class TitleParserTest extends DatabaseTestCase { for (int i = 1; i <= 6; i++){ task = new Task(); title = "Jog "+ days[i]; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); date = newDate(task.getDueDate()); assertEquals(date.getDay(), i); task = new Task(); title = "Jog "+ abrevDays[i]; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); date = newDate(task.getDueDate()); assertEquals(date.getDay(), i); @@ -237,14 +237,14 @@ public class TitleParserTest extends DatabaseTestCase { for (String acceptedString:acceptedStrings){ task = new Task(); String title = "Jog " + acceptedString; - task.setValue(Task.TITLE, title); //test at end of task. should set importance. + task.setTitle(title); //test at end of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_LEAST); } for (String acceptedString:acceptedStrings){ task = new Task(); String title = acceptedString + " jog"; - task.setValue(Task.TITLE, title); //test at beginning of task. should not set importance. + task.setTitle(title); //test at beginning of task. should not set importance. TaskService.createWithValues(task, null, title); assertNotSame(task.getImportance(),Task.IMPORTANCE_LEAST); } @@ -265,23 +265,23 @@ public class TitleParserTest extends DatabaseTestCase { Task task; for (String acceptedStringAtEnd:acceptedStringsAtEnd){ task = new Task(); - task.setValue(Task.TITLE, "Jog " + acceptedStringAtEnd); //test at end of task. should set importance. + task.setTitle("Jog " + acceptedStringAtEnd); //test at end of task. should set importance. taskService.save(task); assertEquals((int)task.getImportance(), Task.IMPORTANCE_SHOULD_DO); } for (String acceptedStringAtEnd:acceptedStringsAtEnd){ task = new Task(); - task.setValue(Task.TITLE, acceptedStringAtEnd + " jog"); //test at beginning of task. should not set importance. + task.setTitle(acceptedStringAtEnd + " jog"); //test at beginning of task. should not set importance. taskService.save(task); assertEquals((int)task.getImportance(), Task.IMPORTANCE_SHOULD_DO); } for (String acceptedStringAnywhere:acceptedStringsAnywhere){ task = new Task(); - task.setValue(Task.TITLE, "Jog " + acceptedStringAnywhere); //test at end of task. should set importance. + task.setTitle("Jog " + acceptedStringAnywhere); //test at end of task. should set importance. taskService.save(task); assertEquals((int)task.getImportance(), Task.IMPORTANCE_SHOULD_DO); - task.setValue(Task.TITLE, acceptedStringAnywhere + " jog"); //test at beginning of task. should set importance. + task.setTitle(acceptedStringAnywhere + " jog"); //test at beginning of task. should set importance. taskService.save(task); assertEquals((int)task.getImportance(), Task.IMPORTANCE_SHOULD_DO); } @@ -303,25 +303,25 @@ public class TitleParserTest extends DatabaseTestCase { for (String acceptedStringAtEnd:acceptedStringsAtEnd){ task = new Task(); String title = "Jog " + acceptedStringAtEnd; - task.setValue(Task.TITLE, title); //test at end of task. should set importance. + task.setTitle(title); //test at end of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_MUST_DO); task = new Task(); title = acceptedStringAtEnd + " jog"; - task.setValue(Task.TITLE, title); //test at beginning of task. should not set importance. + task.setTitle(title); //test at beginning of task. should not set importance. TaskService.createWithValues(task, null, title); assertNotSame(task.getImportance(), Task.IMPORTANCE_MUST_DO); } for (String acceptedStringAnywhere:acceptedStringsAnywhere){ task = new Task(); String title = "Jog " + acceptedStringAnywhere; - task.setValue(Task.TITLE, title); //test at end of task. should set importance. + task.setTitle(title); //test at end of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_MUST_DO); title = acceptedStringAnywhere + " jog"; - task.setValue(Task.TITLE, title); //test at beginning of task. should set importance. + task.setTitle(title); //test at beginning of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_MUST_DO); } @@ -346,25 +346,25 @@ public class TitleParserTest extends DatabaseTestCase { for (String acceptedStringAtEnd:acceptedStringsAtEnd){ task = new Task(); String title = "Jog " + acceptedStringAtEnd; - task.setValue(Task.TITLE, title); //test at end of task. should set importance. + task.setTitle(title); //test at end of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_DO_OR_DIE); task = new Task(); title = acceptedStringAtEnd + " jog"; - task.setValue(Task.TITLE, title); //test at beginning of task. should not set importance. + task.setTitle(title); //test at beginning of task. should not set importance. TaskService.createWithValues(task, null, title); assertNotSame(task.getImportance(), Task.IMPORTANCE_DO_OR_DIE); } for (String acceptedStringAnywhere:acceptedStringsAnywhere){ task = new Task(); String title = "Jog " + acceptedStringAnywhere; - task.setValue(Task.TITLE, title); //test at end of task. should set importance. + task.setTitle(title); //test at end of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_DO_OR_DIE); title = acceptedStringAnywhere + " jog"; - task.setValue(Task.TITLE, title); //test at beginning of task. should set importance. + task.setTitle(title); //test at beginning of task. should set importance. TaskService.createWithValues(task, null, title); assertEquals((int)task.getImportance(), Task.IMPORTANCE_DO_OR_DIE); } @@ -380,7 +380,7 @@ public class TitleParserTest extends DatabaseTestCase { public void testDailyWithNoDueDate() throws Exception { Task task = new Task(); String title = "Jog daily"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); RRule rrule = new RRule(); rrule.setFreq(Frequency.DAILY); @@ -390,7 +390,7 @@ public class TitleParserTest extends DatabaseTestCase { assertFalse(task.hasDueDate()); title = "Jog every day"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); assertFalse(task.hasDueTime()); @@ -398,7 +398,7 @@ public class TitleParserTest extends DatabaseTestCase { for (int i = 1; i <= 12; i++){ title = "Jog every " + i + " days."; - task.setValue(Task.TITLE, title); + task.setTitle(title); rrule.setInterval(i); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); @@ -414,7 +414,7 @@ public class TitleParserTest extends DatabaseTestCase { new TaskService(); Task task = new Task(); String title = "Jog weekly"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); RRule rrule = new RRule(); rrule.setFreq(Frequency.WEEKLY); @@ -424,7 +424,7 @@ public class TitleParserTest extends DatabaseTestCase { assertFalse(task.hasDueDate()); title = "Jog every week"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); assertFalse(task.hasDueTime()); @@ -432,7 +432,7 @@ public class TitleParserTest extends DatabaseTestCase { for (int i = 1; i <= 12; i++){ title = "Jog every " + i + " weeks"; - task.setValue(Task.TITLE, title); + task.setTitle(title); rrule.setInterval(i); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); @@ -446,7 +446,7 @@ public class TitleParserTest extends DatabaseTestCase { public void testMonthlyFromNoDueDate() throws Exception { Task task = new Task(); String title = "Jog monthly"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); RRule rrule = new RRule(); rrule.setFreq(Frequency.MONTHLY); @@ -456,7 +456,7 @@ public class TitleParserTest extends DatabaseTestCase { assertFalse(task.hasDueDate()); title = "Jog every month"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); assertFalse(task.hasDueTime()); @@ -464,7 +464,7 @@ public class TitleParserTest extends DatabaseTestCase { for (int i = 1; i <= 12; i++){ title = "Jog every " + i + " months"; - task.setValue(Task.TITLE, title); + task.setTitle(title); rrule.setInterval(i); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); @@ -477,7 +477,7 @@ public class TitleParserTest extends DatabaseTestCase { public void testDailyFromDueDate() throws Exception { Task task = new Task(); String title = "Jog daily starting from today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); RRule rrule = new RRule(); rrule.setFreq(Frequency.DAILY); @@ -488,14 +488,14 @@ public class TitleParserTest extends DatabaseTestCase { task.clearValue(Task.ID); task.clearValue(Task.UUID); title = "Jog every day starting from today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); assertTrue(task.hasDueDate()); for (int i = 1; i <= 12; i++){ title = "Jog every " + i + " days starting from today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); rrule.setInterval(i); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); @@ -507,7 +507,7 @@ public class TitleParserTest extends DatabaseTestCase { public void testWeeklyFromDueDate() throws Exception { Task task = new Task(); String title = "Jog weekly starting from today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); RRule rrule = new RRule(); rrule.setFreq(Frequency.WEEKLY); @@ -518,14 +518,14 @@ public class TitleParserTest extends DatabaseTestCase { task.clearValue(Task.ID); task.clearValue(Task.UUID); title = "Jog every week starting from today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); assertTrue(task.hasDueDate()); for (int i = 1; i <= 12; i++){ title = "Jog every " + i + " weeks starting from today"; - task.setValue(Task.TITLE, title); + task.setTitle(title); rrule.setInterval(i); TaskService.createWithValues(task, null, title); assertEquals(task.getRecurrence(), rrule.toIcal()); @@ -549,7 +549,7 @@ public class TitleParserTest extends DatabaseTestCase { Task task; for (String acceptedString : acceptedStrings) { task = new Task(); - task.setValue(Task.TITLE, "Jog " + acceptedString); //test at end of task. should set importance. + task.setTitle("Jog " + acceptedString); //test at end of task. should set importance. ArrayList tags = new ArrayList<>(); TitleParser.listHelper(task, tags); String tag = TitleParser.trimParenthesis(acceptedString); @@ -568,7 +568,7 @@ public class TitleParserTest extends DatabaseTestCase { Task task; for (String acceptedString : acceptedStrings) { task = new Task(); - task.setValue(Task.TITLE, "Jog " + acceptedString); //test at end of task. should set importance. + task.setTitle("Jog " + acceptedString); //test at end of task. should set importance. ArrayList tags = new ArrayList<>(); TitleParser.listHelper(task, tags); String tag = TitleParser.trimParenthesis(acceptedString); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksHelperTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksHelperTest.java index 27452ecd8..d2ee2ccfd 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksHelperTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksHelperTest.java @@ -11,14 +11,14 @@ public class SubtasksHelperTest extends SubtasksTestCase { super.setUp(); createTasks(); TaskListMetadata m = new TaskListMetadata(); - m.setValue(TaskListMetadata.FILTER, TaskListMetadata.FILTER_ID_ALL); + m.setFilter(TaskListMetadata.FILTER_ID_ALL); updater.initializeFromSerializedTree(m, filter, SubtasksHelper.convertTreeToRemoteIds(DEFAULT_SERIALIZED_TREE)); } private void createTask(String title, String uuid) { Task t = new Task(); - t.setValue(Task.TITLE, title); - t.setValue(Task.UUID, uuid); + t.setTitle(title); + t.setUUID(uuid); PluginServices.getTaskService().save(t); } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksMovingTest.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksMovingTest.java index 1703fade4..c637e2fdd 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksMovingTest.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/subtasks/SubtasksMovingTest.java @@ -13,7 +13,7 @@ public class SubtasksMovingTest extends SubtasksTestCase { super.setUp(); createTasks(); TaskListMetadata m = new TaskListMetadata(); - m.setValue(TaskListMetadata.FILTER, TaskListMetadata.FILTER_ID_ALL); + m.setFilter(TaskListMetadata.FILTER_ID_ALL); updater.initializeFromSerializedTree(m, filter, SubtasksHelper.convertTreeToRemoteIds(DEFAULT_SERIALIZED_TREE)); // Assert initial state is correct @@ -36,7 +36,7 @@ public class SubtasksMovingTest extends SubtasksTestCase { private Task createTask(String title) { Task task = new Task(); - task.setValue(Task.TITLE, title); + task.setTitle(title); PluginServices.getTaskService().save(task); return task; } diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/sync/NewSyncTestCase.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/sync/NewSyncTestCase.java index b14101902..059daa9a6 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/sync/NewSyncTestCase.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/sync/NewSyncTestCase.java @@ -20,8 +20,8 @@ public class NewSyncTestCase extends DatabaseTestCase { protected Task createTask(String title) { Task task = new Task(); - task.setValue(Task.TITLE, title); - task.setValue(Task.IMPORTANCE, SYNC_TASK_IMPORTANCE); + task.setTitle(title); + task.setImportance(SYNC_TASK_IMPORTANCE); taskDao.createNew(task); return task; @@ -36,7 +36,7 @@ public class NewSyncTestCase extends DatabaseTestCase { protected TagData createTagData(String name) { TagData tag = new TagData(); - tag.setValue(TagData.NAME, name); + tag.setName(name); tagDataDao.createNew(tag); return tag; diff --git a/astrid/src/main/java/com/todoroo/astrid/actfm/CommentsFragment.java b/astrid/src/main/java/com/todoroo/astrid/actfm/CommentsFragment.java index 715725e5c..5da97e650 100644 --- a/astrid/src/main/java/com/todoroo/astrid/actfm/CommentsFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/actfm/CommentsFragment.java @@ -252,7 +252,7 @@ public abstract class CommentsFragment extends ListFragment { if (picture != null) { JSONObject pictureJson = RemoteModel.PictureHelper.savePictureJson(getActivity(), picture); if (pictureJson != null) { - update.setValue(UserActivity.PICTURE, pictureJson.toString()); + update.setPicture(pictureJson.toString()); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/actfm/TagCommentsFragment.java b/astrid/src/main/java/com/todoroo/astrid/actfm/TagCommentsFragment.java index 353f2d7cf..09fb6cee6 100644 --- a/astrid/src/main/java/com/todoroo/astrid/actfm/TagCommentsFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/actfm/TagCommentsFragment.java @@ -72,12 +72,12 @@ public class TagCommentsFragment extends CommentsFragment { @Override protected UserActivity createUpdate() { UserActivity userActivity = new UserActivity(); - userActivity.setValue(UserActivity.MESSAGE, addCommentField.getText().toString()); - userActivity.setValue(UserActivity.ACTION, UserActivity.ACTION_TAG_COMMENT); - userActivity.setValue(UserActivity.USER_UUID, Task.USER_ID_SELF); - userActivity.setValue(UserActivity.TARGET_ID, tagData.getUuid()); - userActivity.setValue(UserActivity.TARGET_NAME, tagData.getName()); - userActivity.setValue(UserActivity.CREATED_AT, DateUtilities.now()); + userActivity.setMessage(addCommentField.getText().toString()); + userActivity.setAction(UserActivity.ACTION_TAG_COMMENT); + userActivity.setUserUUID(Task.USER_ID_SELF); + userActivity.setTargetId(tagData.getUuid()); + userActivity.setTargetName(tagData.getName()); + userActivity.setCreatedAt(DateUtilities.now()); return userActivity; } } diff --git a/astrid/src/main/java/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/src/main/java/com/todoroo/astrid/actfm/TagSettingsActivity.java index 61c4c9e23..6b2c7e1a7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/actfm/TagSettingsActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/actfm/TagSettingsActivity.java @@ -99,7 +99,7 @@ public class TagSettingsActivity extends ActionBarActivity { if (tagData == null) { isNewTag = true; tagData = new TagData(); - tagData.setValue(TagData.UUID, UUIDHelper.newUUID()); + tagData.setUUID(UUIDHelper.newUUID()); } ActionBar actionBar = getSupportActionBar(); @@ -167,13 +167,13 @@ public class TagSettingsActivity extends ActionBarActivity { TagService service = TagService.getInstance(); if (nameChanged) { if (oldName.equalsIgnoreCase(newName)) { // Change the capitalization of a list manually - tagData.setValue(TagData.NAME, newName); + tagData.setName(newName); service.rename(tagData.getUuid(), newName); } else { // Rename list--check for existing name newName = service.getTagWithCase(newName); tagName.setText(newName); if (!newName.equals(oldName)) { - tagData.setValue(TagData.NAME, newName); + tagData.setName(newName); service.rename(tagData.getUuid(), newName); } } @@ -182,13 +182,13 @@ public class TagSettingsActivity extends ActionBarActivity { if (setBitmap != null) { JSONObject pictureJson = RemoteModel.PictureHelper.savePictureJson(this, setBitmap); if (pictureJson != null) { - tagData.setValue(TagData.PICTURE, pictureJson.toString()); + tagData.setPicture(pictureJson.toString()); } } JSONArray members = new JSONArray(); - tagData.setValue(TagData.MEMBER_COUNT, members.length()); + tagData.setMemberCount(members.length()); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(tagName.getWindowToken(), 0); @@ -213,7 +213,7 @@ public class TagSettingsActivity extends ActionBarActivity { } try { String tagPicture = RemoteModel.PictureHelper.getPictureHash(tagData); - tagData.setValue(TagData.PICTURE, tagPicture); + tagData.setPicture(tagPicture); } catch (Exception e) { e.printStackTrace(); diff --git a/astrid/src/main/java/com/todoroo/astrid/actfm/TagViewFragment.java b/astrid/src/main/java/com/todoroo/astrid/actfm/TagViewFragment.java index c07490e6a..26b02bf30 100644 --- a/astrid/src/main/java/com/todoroo/astrid/actfm/TagViewFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/actfm/TagViewFragment.java @@ -148,8 +148,8 @@ public class TagViewFragment extends TaskListFragment { try { tagData = new TagData(); if(cursor.getCount() == 0) { - tagData.setValue(TagData.NAME, tag); - tagData.setValue(TagData.UUID, uuid); + tagData.setName(tag); + tagData.setUUID(uuid); tagDataService.save(tagData); } else { cursor.moveToFirst(); @@ -182,7 +182,7 @@ public class TagViewFragment extends TaskListFragment { if(tagData != null && sortFlags <= SortHelper.FLAG_REVERSE_SORT && count != tagData.getTaskCount()) { - tagData.setValue(TagData.TASK_COUNT, count); + tagData.setTaskCount(count); tagDataService.save(tagData); } } @@ -198,7 +198,7 @@ public class TagViewFragment extends TaskListFragment { if (tagData != null) { long lastAutosync = tagData.getLastAutosync(); if(DateUtilities.now() - lastAutosync > AUTOSYNC_INTERVAL) { - tagData.setValue(TagData.LAST_AUTOSYNC, DateUtilities.now()); + tagData.setLastAutosync(DateUtilities.now()); tagDataDao.saveExisting(tagData); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/ShareLinkActivity.java b/astrid/src/main/java/com/todoroo/astrid/activity/ShareLinkActivity.java index ef527f143..f213a8bee 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/ShareLinkActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/ShareLinkActivity.java @@ -51,7 +51,7 @@ public final class ShareLinkActivity extends TaskListActivity { Task task = QuickAddBar.basicQuickAddTask(subject); if (task != null) { - task.setValue(Task.NOTES, callerIntent.getStringExtra(Intent.EXTRA_TEXT)); + task.setNotes(callerIntent.getStringExtra(Intent.EXTRA_TEXT)); taskService.save(task); handled = true; onTaskListItemClicked(task.getId()); diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java index 96ad0f3d6..19dafdf40 100755 --- a/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java @@ -605,7 +605,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { if (model.getTitle().length() == 0) { // set deletion date until task gets a title - model.setValue(Task.DELETION_DATE, DateUtilities.now()); + model.setDeletionDate(DateUtilities.now()); } setIsNewTask(model.getTitle().length() == 0); @@ -665,7 +665,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { } if (title.getText().length() > 0) { - model.setValue(Task.DELETION_DATE, 0L); + model.setDeletionDate(0L); } if (title.getText().length() == 0) { diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java b/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java index f07010058..24716352f 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java @@ -381,8 +381,8 @@ public class TaskListFragment extends ListFragment implements OnSortSelectedList } defaultOrder = SubtasksHelper.convertTreeToRemoteIds(defaultOrder); taskListMetadata = new TaskListMetadata(); - taskListMetadata.setValue(TaskListMetadata.FILTER, filterId); - taskListMetadata.setValue(TaskListMetadata.TASK_IDS, defaultOrder); + taskListMetadata.setFilter(filterId); + taskListMetadata.setTaskIDs(defaultOrder); taskListMetadataDao.createNew(taskListMetadata); } } @@ -391,7 +391,7 @@ public class TaskListFragment extends ListFragment implements OnSortSelectedList taskListMetadata = taskListMetadataDao.fetchByTagId(td.getUuid(), TaskListMetadata.PROPERTIES); if (taskListMetadata == null && !RemoteModel.isUuidEmpty(tdId)) { taskListMetadata = new TaskListMetadata(); - taskListMetadata.setValue(TaskListMetadata.TAG_UUID, tdId); + taskListMetadata.setTagUUID(tdId); taskListMetadataDao.createNew(taskListMetadata); } } @@ -460,7 +460,7 @@ public class TaskListFragment extends ListFragment implements OnSortSelectedList && event.getUnicodeChar() <= '4' && selected != null) { int importance = event.getNumber() - '1'; Task task = ((ViewHolder) selected.getTag()).task; - task.setValue(Task.IMPORTANCE, importance); + task.setImportance(importance); taskService.save(task); taskAdapter.setFieldContentsAndVisibility(selected); } @@ -1063,7 +1063,7 @@ public class TaskListFragment extends ListFragment implements OnSortSelectedList itemId = item.getGroupId(); Task task = new Task(); task.setId(itemId); - task.setValue(Task.DELETION_DATE, 0L); + task.setDeletionDate(0L); taskService.save(task); loadTaskListContent(true); return true; diff --git a/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java index a5b9902c8..f44a5a00a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java @@ -718,8 +718,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable { } addTaskToLoadingArray(task); - task.setValue(Task.DETAILS, DETAIL_SEPARATOR); - task.setValue(Task.DETAILS_DATE, DateUtilities.now()); + task.setDetails(DETAIL_SEPARATOR); + task.setDetailsDate(DateUtilities.now()); taskService.save(task); requestNewDetails(task); @@ -780,8 +780,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable { details.append(detail); Task task = new Task(); task.setId(id); - task.setValue(Task.DETAILS, details.toString()); - task.setValue(Task.DETAILS_DATE, DateUtilities.now()); + task.setDetails(details.toString()); + task.setDetailsDate(DateUtilities.now()); taskService.save(task); } @@ -990,7 +990,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable { value = completedItems.get(task.getId()); } if(value != null) { - task.setValue(Task.COMPLETION_DATE, + task.setCompletionDate( value ? DateUtilities.now() : 0); } boolean state = task.isCompleted(); diff --git a/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java b/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java index 28886b06c..d0f462987 100644 --- a/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java @@ -134,14 +134,14 @@ public class UpdateAdapter extends CursorAdapter { } public static void readUserActivityProperties(TodorooCursor unionCursor, UserActivity activity) { - activity.setValue(UserActivity.CREATED_AT, unionCursor.getLong(0)); - activity.setValue(UserActivity.UUID, unionCursor.getString(1)); - activity.setValue(UserActivity.ACTION, unionCursor.getString(2)); - activity.setValue(UserActivity.MESSAGE, unionCursor.getString(3)); - activity.setValue(UserActivity.TARGET_ID, unionCursor.getString(4)); - activity.setValue(UserActivity.TARGET_NAME, unionCursor.getString(5)); - activity.setValue(UserActivity.PICTURE, unionCursor.getString(6)); - activity.setValue(UserActivity.USER_UUID, unionCursor.getString(7)); + activity.setCreatedAt(unionCursor.getLong(0)); + activity.setUUID(unionCursor.getString(1)); + activity.setAction(unionCursor.getString(2)); + activity.setMessage(unionCursor.getString(3)); + activity.setTargetId(unionCursor.getString(4)); + activity.setTargetName(unionCursor.getString(5)); + activity.setPicture(unionCursor.getString(6)); + activity.setUserUUID(unionCursor.getString(7)); } /** Helper method to set the contents and visibility of each field */ diff --git a/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmControlSet.java b/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmControlSet.java index 90aa843a7..0216db3ff 100644 --- a/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmControlSet.java @@ -93,7 +93,7 @@ public final class AlarmControlSet extends TaskEditControlSet { } if(AlarmService.getInstance().synchronizeAlarms(task.getId(), alarms)) { - task.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); + task.setModificationDate(DateUtilities.now()); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java b/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java index 4a93678e7..c0d530db7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java +++ b/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java @@ -76,7 +76,7 @@ public class AlarmService { ArrayList metadata = new ArrayList<>(); for(Long alarm : alarms) { Metadata item = new Metadata(); - item.setValue(Metadata.KEY, AlarmFields.METADATA_KEY); + item.setKey(AlarmFields.METADATA_KEY); item.setValue(AlarmFields.TIME, alarm); item.setValue(AlarmFields.TYPE, AlarmFields.TYPE_SINGLE); metadata.add(item); diff --git a/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java b/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java index a1f0361f7..e059bdf3a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java +++ b/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java @@ -292,7 +292,7 @@ public class TasksXmlImporter { metadata.clear(); deserializeModel(metadata, Metadata.PROPERTIES); metadata.setId(Metadata.NO_ID); - metadata.setValue(Metadata.TASK, currentTask.getId()); + metadata.setTask(currentTask.getId()); metadataService.save(metadata); // Construct the TagData from Metadata @@ -312,7 +312,7 @@ public class TasksXmlImporter { tagdata.clear(); tagdata.setId(TagData.NO_ID); tagdata.setUuid(uuid); - tagdata.setValue(TagData.NAME, name); + tagdata.setName(name); tagdataService.save(tagdata); } } finally { @@ -470,7 +470,7 @@ public class TasksXmlImporter { String listId = strtok.nextToken(); Metadata metadata = new Metadata(); - metadata.setValue(Metadata.TASK, currentTask.getId()); + metadata.setTask(currentTask.getId()); metadata.setValue(Metadata.VALUE1, (listId)); metadata.setValue(Metadata.VALUE2, (taskSeriesId)); metadata.setValue(Metadata.VALUE3, (taskId)); @@ -537,9 +537,9 @@ public class TasksXmlImporter { if(upgradeNotes != null) { if(task.containsValue(Task.NOTES) && task.getNotes().length() > 0) { - task.setValue(Task.NOTES, task.getNotes() + "\n" + upgradeNotes); + task.setNotes(task.getNotes() + "\n" + upgradeNotes); } else { - task.setValue(Task.NOTES, upgradeNotes); + task.setNotes(upgradeNotes); } upgradeNotes = null; } @@ -557,25 +557,25 @@ public class TasksXmlImporter { // ignore break; case LegacyTaskModel.NAME: - task.setValue(Task.TITLE, value); + task.setTitle(value); break; case LegacyTaskModel.NOTES: - task.setValue(Task.NOTES, value); + task.setNotes(value); break; case LegacyTaskModel.PROGRESS_PERCENTAGE: // ignore break; case LegacyTaskModel.IMPORTANCE: - task.setValue(Task.IMPORTANCE, LegacyImportance.valueOf(value).ordinal()); + task.setImportance(LegacyImportance.valueOf(value).ordinal()); break; case LegacyTaskModel.ESTIMATED_SECONDS: - task.setValue(Task.ESTIMATED_SECONDS, Integer.parseInt(value)); + task.setEstimatedSeconds(Integer.parseInt(value)); break; case LegacyTaskModel.ELAPSED_SECONDS: - task.setValue(Task.ELAPSED_SECONDS, Integer.parseInt(value)); + task.setELAPSED_SECONDS(Integer.parseInt(value)); break; case LegacyTaskModel.TIMER_START: - task.setValue(Task.TIMER_START, + task.setTimerStart( BackupDateUtilities.getDateFromIso8601String(value).getTime()); break; case LegacyTaskModel.DEFINITE_DUE_DATE: @@ -585,7 +585,7 @@ public class TasksXmlImporter { upgradeNotes = "Project Deadline: " + DateUtilities.getDateString(preferredDate); } - task.setValue(Task.DUE_DATE, + task.setDueDate( BackupDateUtilities.getTaskDueDateFromIso8601String(value).getTime()); break; case LegacyTaskModel.PREFERRED_DUE_DATE: @@ -593,39 +593,39 @@ public class TasksXmlImporter { if (definite != null) { // handled above } else { - task.setValue(Task.DUE_DATE, + task.setDueDate( BackupDateUtilities.getTaskDueDateFromIso8601String(value).getTime()); } break; case LegacyTaskModel.HIDDEN_UNTIL: - task.setValue(Task.HIDE_UNTIL, + task.setHideUntil( BackupDateUtilities.getDateFromIso8601String(value).getTime()); break; case LegacyTaskModel.BLOCKING_ON: // ignore break; case LegacyTaskModel.POSTPONE_COUNT: - task.setValue(Task.POSTPONE_COUNT, Integer.parseInt(value)); + task.setPostponeCount(Integer.parseInt(value)); break; case LegacyTaskModel.NOTIFICATIONS: - task.setValue(Task.REMINDER_PERIOD, Integer.parseInt(value) * 1000L); + task.setReminderPeriod(Integer.parseInt(value) * 1000L); break; case LegacyTaskModel.CREATION_DATE: - task.setValue(Task.CREATION_DATE, + task.setCreationDate( BackupDateUtilities.getDateFromIso8601String(value).getTime()); break; case LegacyTaskModel.COMPLETION_DATE: String completion = xpp.getAttributeValue(null, LegacyTaskModel.PROGRESS_PERCENTAGE); if ("100".equals(completion)) { - task.setValue(Task.COMPLETION_DATE, + task.setCompletionDate( BackupDateUtilities.getDateFromIso8601String(value).getTime()); } break; case LegacyTaskModel.NOTIFICATION_FLAGS: - task.setValue(Task.REMINDER_FLAGS, Integer.parseInt(value)); + task.setReminderFlags(Integer.parseInt(value)); break; case LegacyTaskModel.LAST_NOTIFIED: - task.setValue(Task.REMINDER_LAST, + task.setReminderLast( BackupDateUtilities.getDateFromIso8601String(value).getTime()); break; case "repeat_interval": @@ -638,7 +638,7 @@ public class TasksXmlImporter { LegacyRepeatInterval interval = LegacyRepeatInterval.valueOf(repeatInterval); LegacyRepeatInfo repeatInfo = new LegacyRepeatInfo(interval, repeatValue); RRule rrule = repeatInfo.toRRule(); - task.setValue(Task.RECURRENCE, rrule.toIcal()); + task.setRecurrence(rrule.toIcal()); } break; case LegacyTaskModel.FLAGS: diff --git a/astrid/src/main/java/com/todoroo/astrid/calls/MissedCallActivity.java b/astrid/src/main/java/com/todoroo/astrid/calls/MissedCallActivity.java index 3e0227dcb..9bbf38eeb 100644 --- a/astrid/src/main/java/com/todoroo/astrid/calls/MissedCallActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/calls/MissedCallActivity.java @@ -195,8 +195,8 @@ public class MissedCallActivity extends Activity { public void snoozeForTime(long time) { Task newTask = new Task(); - newTask.setValue(Task.TITLE, taskTitle); - newTask.setValue(Task.DUE_DATE, time); + newTask.setTitle(taskTitle); + newTask.setDueDate(time); taskService.save(newTask); finish(); diff --git a/astrid/src/main/java/com/todoroo/astrid/core/OldTaskPreferences.java b/astrid/src/main/java/com/todoroo/astrid/core/OldTaskPreferences.java index 7d2e5dfa4..2458a7a5f 100644 --- a/astrid/src/main/java/com/todoroo/astrid/core/OldTaskPreferences.java +++ b/astrid/src/main/java/com/todoroo/astrid/core/OldTaskPreferences.java @@ -162,7 +162,7 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { cursor.close(); } Task template = new Task(); - template.setValue(Task.DELETION_DATE, + template.setDeletionDate( DateUtilities.now()); int result = taskService.update( Task.COMPLETION_DATE.gt(0), template); @@ -242,7 +242,7 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { // mass update the CALENDAR_URI here, // since the GCalHelper doesnt save it due to performance-reasons Task template = new Task(); - template.setValue(Task.CALENDAR_URI, ""); //$NON-NLS-1$ + template.setCalendarUri(""); //$NON-NLS-1$ taskService.update( Criterion.and(Task.COMPLETION_DATE.gt(0), Task.CALENDAR_URI.isNotNull()), template); @@ -284,7 +284,7 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { // mass update the CALENDAR_URI here, // since the GCalHelper doesnt save it due to performance-reasons Task template = new Task(); - template.setValue(Task.CALENDAR_URI, ""); //$NON-NLS-1$ + template.setCalendarUri(""); //$NON-NLS-1$ taskService.update( Task.CALENDAR_URI.isNotNull(), template); diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/MetadataDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/MetadataDao.java index da61d870f..cbfaaa49a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/MetadataDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/MetadataDao.java @@ -81,7 +81,7 @@ public class MetadataDao extends DatabaseDao { Criterion metadataCriteria) { HashSet newMetadataValues = new HashSet<>(); for(Metadata metadatum : metadata) { - metadatum.setValue(Metadata.TASK, taskId); + metadatum.setTask(taskId); metadatum.clearValue(Metadata.ID); newMetadataValues.add(metadatum.getMergedValues()); } @@ -121,7 +121,7 @@ public class MetadataDao extends DatabaseDao { @Override public boolean persist(Metadata item) { if(!item.containsValue(Metadata.CREATION_DATE)) { - item.setValue(Metadata.CREATION_DATE, DateUtilities.now()); + item.setCreationDate(DateUtilities.now()); } boolean state = super.persist(item); diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java index ee90d6379..adfc18876 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java @@ -26,7 +26,7 @@ public class RemoteModelDao extends DatabaseDao { } catch (JSONException e) { // } - tagData.setValue(TagData.MEMBERS, ""); //$NON-NLS-1$ + tagData.setMembers(""); //$NON-NLS-1$ PluginServices.getTagDataDao().saveExisting(tagData); } diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java index 70d456570..b10ad0ed7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java @@ -185,19 +185,19 @@ public class TaskDao extends RemoteModelDao { @Override public boolean createNew(Task item) { if(!item.containsValue(Task.CREATION_DATE)) { - item.setValue(Task.CREATION_DATE, DateUtilities.now()); + item.setCreationDate(DateUtilities.now()); } - item.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); + item.setModificationDate(DateUtilities.now()); // set up task defaults if(!item.containsValue(Task.IMPORTANCE)) { - item.setValue(Task.IMPORTANCE, Preferences.getIntegerFromString( + item.setImportance(Preferences.getIntegerFromString( R.string.p_default_importance_key, Task.IMPORTANCE_SHOULD_DO)); } if(!item.containsValue(Task.DUE_DATE)) { int setting = Preferences.getIntegerFromString(R.string.p_default_urgency_key, Task.URGENCY_NONE); - item.setValue(Task.DUE_DATE, Task.createDueDate(setting, 0)); + item.setDueDate(Task.createDueDate(setting, 0)); } createDefaultHideUntil(item); @@ -216,7 +216,7 @@ public class TaskDao extends RemoteModelDao { if(!item.containsValue(Task.HIDE_UNTIL)) { int setting = Preferences.getIntegerFromString(R.string.p_default_hideUntil_key, Task.HIDE_UNTIL_NONE); - item.setValue(Task.HIDE_UNTIL, item.createHideUntil(setting, 0)); + item.setHideUntil(item.createHideUntil(setting, 0)); } } @@ -225,7 +225,7 @@ public class TaskDao extends RemoteModelDao { */ public static void setDefaultReminders(Task item) { if(!item.containsValue(Task.REMINDER_PERIOD)) { - item.setValue(Task.REMINDER_PERIOD, DateUtilities.ONE_HOUR * + item.setReminderPeriod(DateUtilities.ONE_HOUR * Preferences.getIntegerFromString(R.string.p_rmd_default_random_hours, 0)); } @@ -233,7 +233,7 @@ public class TaskDao extends RemoteModelDao { int reminder_flags = Preferences.getIntegerFromString(R.string.p_default_reminders_key, Task.NOTIFY_AT_DEADLINE | Task.NOTIFY_AFTER_DEADLINE) | Preferences.getIntegerFromString(R.string.p_default_reminders_mode_key, 0); - item.setValue(Task.REMINDER_FLAGS, reminder_flags); + item.setReminderFlags(reminder_flags); } } @@ -244,9 +244,9 @@ public class TaskDao extends RemoteModelDao { return false; } if(!TaskApiDao.insignificantChange(values)) { - item.setValue(Task.DETAILS, null); + item.setDetails(null); if(!values.containsKey(Task.MODIFICATION_DATE.name)) { - item.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); + item.setModificationDate(DateUtilities.now()); } } boolean result = super.saveExisting(item); @@ -318,7 +318,7 @@ public class TaskDao extends RemoteModelDao { } if (!match) { if (existing.getCreationDate().equals(newConflict.getCreationDate())) { - newConflict.setValue(Task.CREATION_DATE, newConflict.getCreationDate() + 1000L); + newConflict.setCreationDate(newConflict.getCreationDate() + 1000L); } newConflict.clearValue(Task.UUID); saveExisting(newConflict); diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/UserActivityDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/UserActivityDao.java index 18de07e47..7638fd58c 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/UserActivityDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/UserActivityDao.java @@ -21,7 +21,7 @@ public class UserActivityDao extends RemoteModelDao { @Override public boolean createNew(UserActivity item) { if (!item.containsValue(UserActivity.CREATED_AT)) { - item.setValue(UserActivity.CREATED_AT, DateUtilities.now()); + item.setCreatedAt(DateUtilities.now()); } return super.createNew(item); } diff --git a/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java b/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java index f0f1d235c..66bf10dd7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java @@ -118,7 +118,7 @@ public class FilesControlSet extends PopupControlSet { if (m.containsNonNullValue(TaskAttachment.FILE_PATH)) { File f = new File(m.getFilePath()); if (!f.exists()) { - m.setValue(TaskAttachment.FILE_PATH, ""); //$NON-NLS-1$ + m.setFilePath(""); //$NON-NLS-1$ if (m.containsNonNullValue(TaskAttachment.URL)) { // We're ok, just the local file was deleted taskAttachmentDao.saveExisting(m); } else { // No local file and no url -- delete the metadata @@ -171,7 +171,7 @@ public class FilesControlSet extends PopupControlSet { @Override public void onClick(DialogInterface d, int which) { if (RemoteModel.isValidUuid(m.getUUID())) { - m.setValue(TaskAttachment.DELETED_AT, DateUtilities.now()); + m.setDeletedAt(DateUtilities.now()); taskAttachmentDao.saveExisting(m); } else { taskAttachmentDao.delete(m.getId()); @@ -233,7 +233,7 @@ public class FilesControlSet extends PopupControlSet { useType = guessedType; } if (!useType.equals(guessedType)) { - m.setValue(TaskAttachment.CONTENT_TYPE, useType); + m.setContentType(useType); m.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true); taskAttachmentDao.saveExisting(m); } diff --git a/astrid/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java b/astrid/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java index 52364e143..fda660fd1 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java +++ b/astrid/src/main/java/com/todoroo/astrid/gcal/CalendarAlarmListCreator.java @@ -46,7 +46,7 @@ public class CalendarAlarmListCreator extends Activity { @Override public void onClick(View v) { TagData tagData = new TagData(); - tagData.setValue(TagData.NAME, tagName); + tagData.setName(tagName); tagDataService.save(tagData); dismissWithAnimation(); } diff --git a/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java b/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java index 2f547bb8b..91a152149 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java @@ -157,7 +157,7 @@ public class GCalControlSet extends PopupControlSet { calendarUri = GCalHelper.createTaskEvent(task, cr, values); if(calendarUri != null) { - task.setValue(Task.CALENDAR_URI, calendarUri.toString()); + task.setCalendarUri(calendarUri.toString()); if (calendarSelector.getSelectedItemPosition() != 0 && !hasEvent) { // pop up the new event diff --git a/astrid/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java b/astrid/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java index 866fdab12..856f0588a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java +++ b/astrid/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java @@ -60,7 +60,7 @@ public class GCalHelper { ContentResolver cr = ContextManager.getContext().getContentResolver(); Uri calendarUri = GCalHelper.createTaskEvent(t, cr, new ContentValues(), deleteEventIfExists); if (calendarUri != null) { - t.setValue(Task.CALENDAR_URI, calendarUri.toString()); + t.setCalendarUri(calendarUri.toString()); } } } @@ -119,14 +119,14 @@ public class GCalHelper { Uri eventUri = Uri.parse(taskUri); String calendarId = getCalendarId(eventUri, cr); if (calendarId == null) { // Bail out, no calendar id - task.setValue(Task.CALENDAR_URI, ""); //$NON-NLS-1$ + task.setCalendarUri(""); //$NON-NLS-1$ return; } ContentValues cv = new ContentValues(); cv.put(CALENDAR_ID_COLUMN, calendarId); Uri uri = createTaskEvent(task, cr, cv, false); - task.setValue(Task.CALENDAR_URI, uri.toString()); + task.setCalendarUri(uri.toString()); } private static String getCalendarId(Uri uri, ContentResolver cr) { @@ -172,7 +172,7 @@ public class GCalHelper { cursor.close(); } - task.setValue(Task.CALENDAR_URI,""); + task.setCalendarUri( ""); } catch (Exception e) { Log.e("astrid-gcal", "error-deleting-calendar-event", e); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListFragment.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListFragment.java index 7cfecf309..642723a92 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListFragment.java @@ -132,7 +132,7 @@ public class GtasksListFragment extends SubtasksListFragment { listId = gtasksMetadataService.getTaskMetadata( t.getId()).getValue(GtasksMetadata.LIST_ID); } - t.setValue(Task.DELETION_DATE, DateUtilities.now()); + t.setDeletionDate(DateUtilities.now()); taskService.save(t); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java index 4168d33e5..4a275b533 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java @@ -54,7 +54,7 @@ public class GtasksMetadata { */ public static Metadata createEmptyMetadata(long taskId) { Metadata metadata = new Metadata(); - metadata.setValue(Metadata.KEY, GtasksMetadata.METADATA_KEY); + metadata.setKey(GtasksMetadata.METADATA_KEY); metadata.setValue(ID, ""); //$NON-NLS-1$ String defaultList = Preferences.getStringValue(GtasksPreferenceService.PREF_DEFAULT_LIST); @@ -67,7 +67,7 @@ public class GtasksMetadata { metadata.setValue(INDENT, 0); metadata.setValue(ORDER, DateUtilities.now()); if(taskId > AbstractModel.NO_ID) { - metadata.setValue(Metadata.TASK, taskId); + metadata.setTask(taskId); } return metadata; } diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncService.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncService.java index f1af37e5a..f563592bd 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncService.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncService.java @@ -301,7 +301,7 @@ public class GtasksSyncService { } } - task.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); + task.setModificationDate(DateUtilities.now()); gtasksMetadata.setValue(GtasksMetadata.LAST_SYNC, DateUtilities.now() + 1000L); metadataService.save(gtasksMetadata); task.putTransitory(SyncFlags.GTASKS_SUPPRESS_SYNC, true); diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java index c73cc5794..364eda7ec 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java @@ -304,22 +304,22 @@ public class GtasksSyncV2Provider extends SyncV2Provider { ArrayList metadata = new ArrayList<>(); - task.setValue(Task.TITLE, remoteTask.getTitle()); - task.setValue(Task.CREATION_DATE, DateUtilities.now()); - task.setValue(Task.COMPLETION_DATE, GtasksApiUtilities.gtasksCompletedTimeToUnixTime(remoteTask.getCompleted())); + task.setTitle(remoteTask.getTitle()); + task.setCreationDate(DateUtilities.now()); + task.setCompletionDate(GtasksApiUtilities.gtasksCompletedTimeToUnixTime(remoteTask.getCompleted())); if (remoteTask.getDeleted() == null || !remoteTask.getDeleted()) { - task.setValue(Task.DELETION_DATE, 0L); + task.setDeletionDate(0L); } else if (remoteTask.getDeleted()) { - task.setValue(Task.DELETION_DATE, DateUtilities.now()); + task.setDeletionDate(DateUtilities.now()); } if (remoteTask.getHidden() != null && remoteTask.getHidden()) { - task.setValue(Task.DELETION_DATE, DateUtilities.now()); + task.setDeletionDate(DateUtilities.now()); } long dueDate = GtasksApiUtilities.gtasksDueTimeToUnixTime(remoteTask.getDue()); long createdDate = Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, dueDate); - task.setValue(Task.DUE_DATE, createdDate); - task.setValue(Task.NOTES, remoteTask.getNotes()); + task.setDueDate(createdDate); + task.setNotes(remoteTask.getNotes()); Metadata gtasksMetadata = GtasksMetadata.createEmptyMetadata(AbstractModel.NO_ID); gtasksMetadata.setValue(GtasksMetadata.ID, remoteTask.getId()); @@ -340,7 +340,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider { mergeDates(task.task, local); } } else { // Set default importance and reminders for remotely created tasks - task.task.setValue(Task.IMPORTANCE, Preferences.getIntegerFromString( + task.task.setImportance(Preferences.getIntegerFromString( R.string.p_default_importance_key, Task.IMPORTANCE_SHOULD_DO)); TaskDao.setDefaultReminders(task.task); } @@ -359,7 +359,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider { newDate.setSeconds(oldDate.getSeconds()); long setDate = Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, newDate.getTime()); - remote.setValue(Task.DUE_DATE, setDate); + remote.setDueDate(setDate); } } } diff --git a/astrid/src/main/java/com/todoroo/astrid/notes/EditNoteActivity.java b/astrid/src/main/java/com/todoroo/astrid/notes/EditNoteActivity.java index ad0b8a26b..84e530c9a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/notes/EditNoteActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/notes/EditNoteActivity.java @@ -365,16 +365,16 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene message = " "; } UserActivity userActivity = new UserActivity(); - userActivity.setValue(UserActivity.MESSAGE, message); - userActivity.setValue(UserActivity.ACTION, actionCode); - userActivity.setValue(UserActivity.USER_UUID, Task.USER_ID_SELF); - userActivity.setValue(UserActivity.TARGET_ID, uuid); - userActivity.setValue(UserActivity.TARGET_NAME, title); - userActivity.setValue(UserActivity.CREATED_AT, DateUtilities.now()); + userActivity.setMessage(message); + userActivity.setAction(actionCode); + userActivity.setUserUUID(Task.USER_ID_SELF); + userActivity.setTargetId(uuid); + userActivity.setTargetName(title); + userActivity.setCreatedAt(DateUtilities.now()); if (usePicture && pendingCommentPicture != null) { JSONObject pictureJson = RemoteModel.PictureHelper.savePictureJson(activity, pendingCommentPicture); if (pictureJson != null) { - userActivity.setValue(UserActivity.PICTURE, pictureJson.toString()); + userActivity.setPicture(pictureJson.toString()); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java b/astrid/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java index 59e47ed76..ba486cfc5 100644 --- a/astrid/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java +++ b/astrid/src/main/java/com/todoroo/astrid/provider/Astrid2TaskProvider.java @@ -255,19 +255,19 @@ public class Astrid2TaskProvider extends ContentProvider { // map values if(values.containsKey(NAME)) { - task.setValue(Task.TITLE, values.getAsString(NAME)); + task.setTitle(values.getAsString(NAME)); } if(values.containsKey(PREFERRED_DUE_DATE)) { - task.setValue(Task.DUE_DATE, values.getAsLong(PREFERRED_DUE_DATE)); + task.setDueDate(values.getAsLong(PREFERRED_DUE_DATE)); } if(values.containsKey(DEFINITE_DUE_DATE)) { - task.setValue(Task.DUE_DATE, values.getAsLong(DEFINITE_DUE_DATE)); + task.setDueDate(values.getAsLong(DEFINITE_DUE_DATE)); } if(values.containsKey(IMPORTANCE)) { - task.setValue(Task.IMPORTANCE, values.getAsInteger(IMPORTANCE)); + task.setImportance(values.getAsInteger(IMPORTANCE)); } if(values.containsKey(COMPLETED)) { - task.setValue(Task.COMPLETION_DATE, values.getAsBoolean(COMPLETED) ? DateUtilities.now() : 0); + task.setCompletionDate(values.getAsBoolean(COMPLETED) ? DateUtilities.now() : 0); } // map selection criteria diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java b/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java index 66bb2bdcd..d4f90ff9c 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java @@ -190,8 +190,8 @@ public class Notifications extends BroadcastReceiver { int ringTimes = nonstopMode ? -1 : (ringFiveMode ? 5 : 1); // update last reminder time - task.setValue(Task.REMINDER_LAST, DateUtilities.now()); - task.setValue(Task.SOCIAL_REMINDER, Task.REMINDER_SOCIAL_UNSEEN); + task.setReminderLast(DateUtilities.now()); + task.setSocialReminder(Task.REMINDER_SOCIAL_UNSEEN); taskDao.saveExisting(task); Context context = ContextManager.getContext(); diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderDialog.java b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderDialog.java index 7eb29c8a1..d31fe7847 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderDialog.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderDialog.java @@ -49,7 +49,7 @@ public class ReminderDialog extends Dialog { public void snoozeForTime(long time) { Task task = new Task(); task.setId(taskId); - task.setValue(Task.REMINDER_SNOOZE, time); + task.setReminderSnooze(time); PluginServices.getTaskService().save(task); dismiss(); } diff --git a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java index f8efd7301..88fe22c3d 100644 --- a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java @@ -369,8 +369,8 @@ public class RepeatControlSet extends PopupControlSet { { task.putTransitory(TaskService.TRANS_REPEAT_CHANGED, true); } - task.setValue(Task.RECURRENCE, result); - task.setValue(Task.REPEAT_UNTIL, repeatUntilValue); + task.setRecurrence(result); + task.setRepeatUntil(repeatUntilValue); if(task.repeatAfterCompletion()) { type.setSelection(1); diff --git a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java index f9f177634..1b1c30db7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java +++ b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java @@ -101,9 +101,9 @@ public class RepeatTaskCompleteListener extends BroadcastReceiver { hideUntil += newDueDate - task.getDueDate(); } - task.setValue(Task.COMPLETION_DATE, 0L); - task.setValue(Task.DUE_DATE, newDueDate); - task.setValue(Task.HIDE_UNTIL, hideUntil); + task.setCompletionDate(0L); + task.setDueDate(newDueDate); + task.setHideUntil(hideUntil); task.putTransitory(TaskService.TRANS_REPEAT_COMPLETE, true); ContentResolver cr = ContextManager.getContext().getContentResolver(); diff --git a/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java b/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java index 14ab83e09..b05f59d6c 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java @@ -104,7 +104,7 @@ public class MetadataService { boolean dirty = false; HashSet newMetadataValues = new HashSet<>(); for(Metadata metadatum : metadata) { - metadatum.setValue(Metadata.TASK, taskId); + metadatum.setTask(taskId); metadatum.clearValue(Metadata.CREATION_DATE); metadatum.clearValue(Metadata.ID); @@ -152,7 +152,7 @@ public class MetadataService { // everything that remains shall be written for(ContentValues values : newMetadataValues) { item.clear(); - item.setValue(Metadata.CREATION_DATE, DateUtilities.now()); + item.setCreationDate(DateUtilities.now()); item.mergeWith(values); metadataDao.persist(item); dirty = true; diff --git a/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java b/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java index 535ae7e8a..61000b203 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java @@ -97,9 +97,9 @@ public class TaskService { */ public void setComplete(Task item, boolean completed) { if(completed) { - item.setValue(Task.COMPLETION_DATE, DateUtilities.now()); + item.setCompletionDate(DateUtilities.now()); } else { - item.setValue(Task.COMPLETION_DATE, 0L); + item.setCompletionDate(0L); } taskDao.save(item); @@ -143,7 +143,7 @@ public class TaskService { metadata.setValue(GtasksMetadata.ID, ""); //$NON-NLS-1$ } - metadata.setValue(Metadata.TASK, newId); + metadata.setTask(newId); metadata.clearValue(Metadata.ID); metadataDao.createNew(metadata); } @@ -171,7 +171,7 @@ public class TaskService { item.clear(); item.setId(id); GCalHelper.deleteTaskEvent(item); - item.setValue(Task.DELETION_DATE, DateUtilities.now()); + item.setDeletionDate(DateUtilities.now()); taskDao.save(item); } } @@ -252,7 +252,7 @@ public class TaskService { */ public void clearDetails(Criterion criterion) { Task template = new Task(); - template.setValue(Task.DETAILS_DATE, 0L); + template.setDetailsDate(0L); taskDao.update(criterion, template); } @@ -264,7 +264,7 @@ public class TaskService { TodorooCursor cursor = taskDao.rawQuery(selection, selectionArgs, Task.ID); try { for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) { - taskValues.setValue(Task.ID, cursor.get(Task.ID)); + taskValues.setID(cursor.get(Task.ID)); taskDao.save(taskValues); } return cursor.getCount(); @@ -355,10 +355,10 @@ public class TaskService { if (!Task.USER_ID_SELF.equals(userId) && !ActFmPreferenceService.userId().equals(userId)) { clone.putTransitory(TRANS_ASSIGNED, true); } - clone.setValue(Task.CREATION_DATE, DateUtilities.now()); - clone.setValue(Task.COMPLETION_DATE, 0L); - clone.setValue(Task.DELETION_DATE, 0L); - clone.setValue(Task.CALENDAR_URI, ""); //$NON-NLS-1$ + clone.setCreationDate(DateUtilities.now()); + clone.setCompletionDate(0L); + clone.setDeletionDate(0L); + clone.setCalendarUri(""); //$NON-NLS-1$ GCalHelper.createTaskEventIfEnabled(clone); save(clone); @@ -380,7 +380,7 @@ public class TaskService { */ public static Task createWithValues(Task task, ContentValues values, String title) { if (title != null) { - task.setValue(Task.TITLE, title); + task.setTitle(title); } ArrayList tags = new ArrayList<>(); @@ -425,7 +425,7 @@ public class TaskService { if (forMetadata != null && forMetadata.size() > 0) { Metadata metadata = new Metadata(); - metadata.setValue(Metadata.TASK, task.getId()); + metadata.setTask(task.getId()); metadata.mergeWith(forMetadata); if (TaskToTagMetadata.KEY.equals(metadata.getKey())) { if (metadata.containsNonNullValue(TaskToTagMetadata.TAG_UUID) && !RemoteModel.NO_UUID.equals(metadata.getValue(TaskToTagMetadata.TAG_UUID))) { diff --git a/astrid/src/main/java/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java b/astrid/src/main/java/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java index 841ff5aee..adef0f083 100644 --- a/astrid/src/main/java/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java +++ b/astrid/src/main/java/com/todoroo/astrid/subtasks/AstridOrderedListFragmentHelper.java @@ -250,7 +250,7 @@ public class AstridOrderedListFragmentHelper implements OrderedListFragmen ArrayList chained = chainedCompletions.get(itemId); if(chained != null) { for(String taskId : chained) { - model.setValue(Task.COMPLETION_DATE, completionDate); + model.setCompletionDate(completionDate); taskService.update(Task.UUID.eq(taskId), model); model.clear(); @@ -266,7 +266,7 @@ public class AstridOrderedListFragmentHelper implements OrderedListFragmen @Override public void visitNode(AstridOrderedListUpdater.Node node) { String uuid = node.uuid; - model.setValue(Task.COMPLETION_DATE, completionDate); + model.setCompletionDate(completionDate); taskService.update(Task.UUID.eq(uuid), model); model.clear(); diff --git a/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java b/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java index d7e18c73b..62e0bada6 100644 --- a/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java +++ b/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java @@ -261,7 +261,7 @@ public class OrderedMetadataListFragmentHelper implements OrderedListFragm if(chained != null) { for(Long taskId : chained) { model.setId(taskId); - model.setValue(Task.COMPLETION_DATE, completionDate); + model.setCompletionDate(completionDate); taskService.save(model); model.clear(); @@ -285,7 +285,7 @@ public class OrderedMetadataListFragmentHelper implements OrderedListFragm } model.setId(node.taskId); - model.setValue(Task.COMPLETION_DATE, completionDate); + model.setCompletionDate(completionDate); taskService.save(model); model.clear(); diff --git a/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksFilterUpdater.java b/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksFilterUpdater.java index 58372ae36..6ec752738 100644 --- a/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksFilterUpdater.java +++ b/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksFilterUpdater.java @@ -28,7 +28,7 @@ public class SubtasksFilterUpdater extends SubtasksUpdater { @Override protected void writeSerialization(TaskListMetadata list, String serialized, boolean shouldQueueSync) { if (list != null) { - list.setValue(TaskListMetadata.TASK_IDS, serialized); + list.setTaskIDs(serialized); if (!shouldQueueSync) { list.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true); } diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java b/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java index 08dc31bd3..e347b5cb6 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java @@ -192,7 +192,7 @@ public final class TagService { TagData tagData; if (existingTag.getCount() == 0) { tagData = new TagData(); - tagData.setValue(TagData.NAME, tagName); + tagData.setName(tagName); tagDataService.save(tagData); } else { existingTag.moveToFirst(); @@ -217,8 +217,8 @@ public final class TagService { */ public void deleteLinks(long taskId, String taskUuid, String[] tagUuids) { Metadata deleteTemplate = new Metadata(); - deleteTemplate.setValue(Metadata.TASK, taskId); // Need this for recording changes in outstanding table - deleteTemplate.setValue(Metadata.DELETION_DATE, DateUtilities.now()); + deleteTemplate.setTask(taskId); // Need this for recording changes in outstanding table + deleteTemplate.setDeletionDate(DateUtilities.now()); if (tagUuids != null) { for (String uuid : tagUuids) { // TODO: Right now this is in a loop because each deleteTemplate needs the individual tagUuid in order to record @@ -279,7 +279,7 @@ public final class TagService { TagData tagData = tagDataDao.fetch(uuid, TagData.ID, TagData.UUID, TagData.DELETION_DATE, TagData.MEMBER_COUNT, TagData.USER_ID); Intent tagDeleted = new Intent(AstridApiConstants.BROADCAST_EVENT_TAG_DELETED); if(tagData != null) { - tagData.setValue(TagData.DELETION_DATE, DateUtilities.now()); + tagData.setDeletionDate(DateUtilities.now()); PluginServices.getTagDataService().save(tagData); tagDeleted.putExtra(TagViewFragment.EXTRA_TAG_UUID, tagData.getUuid()); } @@ -332,7 +332,7 @@ public final class TagService { TagData tagData = getTagDataWithCase(tag, TagData.NAME, TagData.UUID); if (tagData == null) { tagData = new TagData(); - tagData.setValue(TagData.NAME, tag); + tagData.setName(tag); tagDataService.save(tagData); } if (existingLinks.contains(tagData.getUUID())) { @@ -392,14 +392,14 @@ public final class TagService { public int deleteTagMetadata(String uuid) { Metadata deleted = new Metadata(); - deleted.setValue(Metadata.DELETION_DATE, DateUtilities.now()); + deleted.setDeletionDate(DateUtilities.now()); return metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TAG_UUID.eq(uuid)), deleted); } public int rename(String uuid, String newName) { TagData template = new TagData(); - template.setValue(TagData.NAME, newName); + template.setName(newName); tagDataDao.update(TagData.UUID.eq(uuid), template); Metadata metadataTemplate = new Metadata(); diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java b/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java index aebd70944..1951606fd 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java @@ -305,7 +305,7 @@ public final class TagsControlSet extends PopupControlSet { TagService.getInstance().synchronizeTags(task.getId(), task.getUUID(), tags); Flags.set(Flags.TAGS_CHANGED); - task.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); + task.setModificationDate(DateUtilities.now()); } @Override diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java b/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java index a92eed773..b5d892692 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java @@ -29,12 +29,12 @@ public class TaskToTagMetadata { */ public static Metadata newTagMetadata(long taskId, String taskUuid, String tagName, String tagUuid) { Metadata link = new Metadata(); - link.setValue(Metadata.KEY, KEY); - link.setValue(Metadata.TASK, taskId); + link.setKey(KEY); + link.setTask(taskId); link.setValue(TAG_NAME, tagName); link.setValue(TASK_UUID, taskUuid); link.setValue(TAG_UUID, tagUuid); - link.setValue(Metadata.DELETION_DATE, 0L); + link.setDeletionDate(0L); return link; } } diff --git a/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java b/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java index cd1492a23..a9c179414 100644 --- a/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java +++ b/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java @@ -58,13 +58,13 @@ public class TimerPlugin extends BroadcastReceiver { if(start) { if(task.getTimerStart() == 0) { - task.setValue(Task.TIMER_START, DateUtilities.now()); + task.setTimerStart(DateUtilities.now()); } } else { if(task.getTimerStart() > 0) { int newElapsed = (int)((DateUtilities.now() - task.getTimerStart()) / 1000L); - task.setValue(Task.TIMER_START, 0L); - task.setValue(Task.ELAPSED_SECONDS, + task.setTimerStart(0L); + task.setELAPSED_SECONDS( task.getElapsedSeconds() + newElapsed); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/DateChangedAlerts.java b/astrid/src/main/java/com/todoroo/astrid/ui/DateChangedAlerts.java index 2bf643506..42b66a7c4 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/DateChangedAlerts.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/DateChangedAlerts.java @@ -156,7 +156,7 @@ public class DateChangedAlerts { @Override public void onDateAndTimeSelected(long date) { d.dismiss(); - task.setValue(Task.REPEAT_UNTIL, date); + task.setRepeatUntil(date); RepeatTaskCompleteListener.rescheduleTask(task, newDueDate); Flags.set(Flags.REFRESH); } @@ -202,11 +202,11 @@ public class DateChangedAlerts { @Override public void onClick(View v) { d.dismiss(); - task.setValue(Task.DUE_DATE, oldDueDate); - task.setValue(Task.COMPLETION_DATE, 0L); + task.setDueDate(oldDueDate); + task.setCompletionDate(0L); long hideUntil = task.getHideUntil(); if (hideUntil > 0) { - task.setValue(Task.HIDE_UNTIL, hideUntil - (newDueDate - oldDueDate)); + task.setHideUntil(hideUntil - (newDueDate - oldDueDate)); } PluginServices.getTaskService().save(task); Flags.set(Flags.REFRESH); diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/DeadlineControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/DeadlineControlSet.java index 0747d9e26..4e8570b77 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/DeadlineControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/DeadlineControlSet.java @@ -121,9 +121,9 @@ public class DeadlineControlSet extends PopupControlSet { long dueDate = dateAndTimePicker.constructDueDate(); if (dueDate != task.getDueDate()) // Clear snooze if due date has changed { - task.setValue(Task.REMINDER_SNOOZE, 0L); + task.setReminderSnooze(0L); } - task.setValue(Task.DUE_DATE, dueDate); + task.setDueDate(dueDate); } private void initializeWithDate(long dueDate) { diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/EditNotesControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/EditNotesControlSet.java index ac6e7735c..191e77ba4 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/EditNotesControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/EditNotesControlSet.java @@ -84,7 +84,7 @@ public class EditNotesControlSet extends PopupControlSet { @Override protected void writeToModelAfterInitialized(Task task) { - task.setValue(Task.NOTES, editText.getText().toString()); + task.setNotes(editText.getText().toString()); } @Override diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/EditTitleControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/EditTitleControlSet.java index 689492749..e0c8ba332 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/EditTitleControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/EditTitleControlSet.java @@ -85,7 +85,7 @@ public class EditTitleControlSet extends TaskEditControlSet implements Importanc @Override protected void writeToModelAfterInitialized(Task task) { - task.setValue(Task.TITLE, editText.getText().toString()); + task.setTitle(editText.getText().toString()); boolean newState = completeBox.isChecked(); if (newState != task.isCompleted()) { taskService.setComplete(task, newState); diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/HideUntilControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/HideUntilControlSet.java index 29e9a7aca..3a38ab495 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/HideUntilControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/HideUntilControlSet.java @@ -273,7 +273,7 @@ public class HideUntilControlSet extends PopupControlSet implements OnItemSelect return; } long value = task.createHideUntil(item.setting, item.date); - task.setValue(Task.HIDE_UNTIL, value); + task.setHideUntil(value); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/ImportanceControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/ImportanceControlSet.java index c66737389..38e9c69a8 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/ImportanceControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/ImportanceControlSet.java @@ -140,7 +140,7 @@ public class ImportanceControlSet extends TaskEditControlSet { @Override protected void writeToModelAfterInitialized(Task task) { if(getImportance() != null) { - task.setValue(Task.IMPORTANCE, getImportance()); + task.setImportance(getImportance()); } } } diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java b/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java index c1a69afe3..56f61493e 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java @@ -258,7 +258,7 @@ public class QuickAddBar extends LinearLayout { Task task = new Task(); if (title != null) { - task.setValue(Task.TITLE, title); // need this for calendar + task.setTitle(title); // need this for calendar } if (repeatControl.isRecurrenceSet()) { @@ -307,7 +307,7 @@ public class QuickAddBar extends LinearLayout { if (!TextUtils.isEmpty(title) && gcalCreateEventEnabled && TextUtils.isEmpty(task.getCalendarURI())) { Uri calendarUri = GCalHelper.createTaskEvent(task, ContextManager.getContext().getContentResolver(), new ContentValues()); - task.setValue(Task.CALENDAR_URI, calendarUri.toString()); + task.setCalendarUri(calendarUri.toString()); task.putTransitory(SyncFlags.GTASKS_SUPPRESS_SYNC, true); PluginServices.getTaskService().save(task); } diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java index 5582ee8d1..ab1fd9dfb 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java @@ -97,9 +97,9 @@ public class RandomReminderControlSet extends TaskEditControlSet { protected void writeToModelAfterInitialized(Task task) { if(settingCheckbox.isChecked()) { int hourValue = hours[periodSpinner.getSelectedItemPosition()]; - task.setValue(Task.REMINDER_PERIOD, hourValue * DateUtilities.ONE_HOUR); + task.setReminderPeriod(hourValue * DateUtilities.ONE_HOUR); } else { - task.setValue(Task.REMINDER_PERIOD, 0L); + task.setReminderPeriod(0L); } } diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java index 9be890ee9..41237f241 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java @@ -158,7 +158,7 @@ public class ReminderControlSet extends PopupControlSet { @Override protected void writeToModelAfterInitialized(Task task) { - task.setValue(Task.REMINDER_FLAGS, getValue()); + task.setReminderFlags(getValue()); randomControlSet.writeToModel(task); alarmControl.writeToModel(task); diff --git a/astrid/src/main/java/com/todoroo/astrid/utility/TitleParser.java b/astrid/src/main/java/com/todoroo/astrid/utility/TitleParser.java index 5c4cf59e9..2da5d82fe 100644 --- a/astrid/src/main/java/com/todoroo/astrid/utility/TitleParser.java +++ b/astrid/src/main/java/com/todoroo/astrid/utility/TitleParser.java @@ -74,7 +74,7 @@ public class TitleParser { } inputText = inputText.substring(0, m.start()) + inputText.substring(m.end()); } - task.setValue(Task.TITLE, inputText.trim()); + task.setTitle(inputText.trim()); } //helper method for priorityHelper. converts the string to a Task Importance @@ -112,7 +112,7 @@ public class TitleParser { Matcher m = importancePattern.matcher(inputText); if(m.find()) { result = true; - task.setValue(Task.IMPORTANCE, strToPriority(m.group(2).trim())); + task.setImportance(strToPriority(m.group(2).trim())); int start = m.start() == 0 ? 0 : m.start() + 1; inputText = inputText.substring(0, start) + inputText.substring(m.end()); @@ -121,7 +121,7 @@ public class TitleParser { } } } - task.setValue(Task.TITLE, inputText.trim()); + task.setTitle(inputText.trim()); return result; } @@ -356,12 +356,12 @@ public class TitleParser { if(cal != null) { //if at least one of the above has been called, write to task. else do nothing. if (!TextUtils.isEmpty(inputText)) { - task.setValue(Task.TITLE, inputText); + task.setTitle(inputText); } if (containsSpecificTime) { - task.setValue(Task.DUE_DATE, Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, cal.getTime().getTime())); + task.setDueDate(Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, cal.getTime().getTime())); } else { - task.setValue(Task.DUE_DATE, Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, cal.getTime().getTime())); + task.setDueDate(Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, cal.getTime().getTime())); } return true; } @@ -403,7 +403,7 @@ public class TitleParser { RRule rrule = new RRule(); rrule.setFreq(rtime); rrule.setInterval(findInterval(inputText)); - task.setValue(Task.RECURRENCE, rrule.toIcal()); + task.setRecurrence(rrule.toIcal()); return true; } } @@ -417,7 +417,7 @@ public class TitleParser { rrule.setFreq(rtime); rrule.setInterval(1); String thing = rrule.toIcal(); - task.setValue(Task.RECURRENCE, thing); + task.setRecurrence(thing); return true; } } diff --git a/astrid/src/test/java/com/todoroo/astrid/reminders/NotifyAtDeadlineTest.java b/astrid/src/test/java/com/todoroo/astrid/reminders/NotifyAtDeadlineTest.java index fe646d730..e1c70b879 100644 --- a/astrid/src/test/java/com/todoroo/astrid/reminders/NotifyAtDeadlineTest.java +++ b/astrid/src/test/java/com/todoroo/astrid/reminders/NotifyAtDeadlineTest.java @@ -2,7 +2,6 @@ package com.todoroo.astrid.reminders; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.test.TodorooRobolectricTestCase; -import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.data.Task; @@ -11,7 +10,6 @@ import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; -import org.tasks.R; import static com.todoroo.astrid.reminders.ReminderService.NO_ALARM; import static org.junit.Assert.assertEquals; @@ -43,8 +41,8 @@ public class NotifyAtDeadlineTest extends TodorooRobolectricTestCase { public void scheduleReminderAtDueTime() { final DateTime dueDate = new DateTime(2014, 1, 24, 19, 23, 57); Task task = new Task() {{ - setValue(Task.DUE_DATE, dueDate.getMillis()); - setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); + setDueDate(dueDate.getMillis()); + setReminderFlags(Task.NOTIFY_AT_DEADLINE); }}; assertEquals(dueDate.getMillis(), service.calculateNextDueDateReminder(task)); } @@ -52,7 +50,7 @@ public class NotifyAtDeadlineTest extends TodorooRobolectricTestCase { @Test public void noReminderWhenNoDueDate() { Task task = new Task() {{ - setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); + setReminderFlags(Task.NOTIFY_AT_DEADLINE); }}; assertEquals(NO_ALARM, service.calculateNextDueDateReminder(task)); } @@ -60,7 +58,7 @@ public class NotifyAtDeadlineTest extends TodorooRobolectricTestCase { @Test public void noReminderWhenNotifyAtDeadlineFlagNotSet() { Task task = new Task() {{ - setValue(Task.DUE_DATE, new DateTime(2014, 1, 24, 19, 23, 57).getMillis()); + setDueDate(new DateTime(2014, 1, 24, 19, 23, 57).getMillis()); }}; assertEquals(NO_ALARM, service.calculateNextDueDateReminder(task)); } @@ -68,9 +66,9 @@ public class NotifyAtDeadlineTest extends TodorooRobolectricTestCase { @Test public void dontNotifyMoreThanOncePerDay() { Task task = new Task() {{ - setValue(Task.DUE_DATE, newDate(2014, 1, 23).getTime()); - setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); - setValue(Task.REMINDER_LAST, new DateTime(2014, 1, 23, 17, 23, 37).getMillis()); + setDueDate(newDate(2014, 1, 23).getTime()); + setReminderFlags(Task.NOTIFY_AT_DEADLINE); + setReminderLast(new DateTime(2014, 1, 23, 17, 23, 37).getMillis()); }}; assertEquals(NO_ALARM, service.calculateNextDueDateReminder(task)); } @@ -79,9 +77,9 @@ public class NotifyAtDeadlineTest extends TodorooRobolectricTestCase { public void notifyIfLastNotificationWasMoreThanOneDayAgo() { final DateTime dueDate = new DateTime(2014, 1, 23, 0, 0, 0, 0); Task task = new Task() {{ - setValue(Task.DUE_DATE, dueDate.getMillis()); - setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); - setValue(Task.REMINDER_LAST, new DateTime(2014, 1, 23, 17, 23, 36).getMillis()); + setDueDate(dueDate.getMillis()); + setReminderFlags(Task.NOTIFY_AT_DEADLINE); + setReminderLast(new DateTime(2014, 1, 23, 17, 23, 36).getMillis()); }}; assertEquals( dueDate.withHourOfDay(18).getMillis(), diff --git a/astrid/src/test/java/com/todoroo/astrid/reminders/ReminderServiceTest.java b/astrid/src/test/java/com/todoroo/astrid/reminders/ReminderServiceTest.java index e80139c8f..57e8f9888 100644 --- a/astrid/src/test/java/com/todoroo/astrid/reminders/ReminderServiceTest.java +++ b/astrid/src/test/java/com/todoroo/astrid/reminders/ReminderServiceTest.java @@ -50,9 +50,9 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { service.setScheduler(new NoAlarmExpected()); Task task = new Task(); - task.setValue(Task.TITLE, "water"); - task.setValue(Task.REMINDER_FLAGS, 0); - task.setValue(Task.REMINDER_PERIOD, 0L); + task.setTitle("water"); + task.setReminderFlags(0); + task.setReminderPeriod(0L); taskDao.save(task); service.scheduleAlarm(task); } @@ -72,13 +72,13 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { // test due date in the past final Task task = new Task(); - task.setValue(Task.TITLE, "water"); - task.setValue(Task.DUE_DATE, DateUtilities.now() - DateUtilities.ONE_DAY); - task.setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); + task.setTitle("water"); + task.setDueDate(DateUtilities.now() - DateUtilities.ONE_DAY); + task.setReminderFlags(Task.NOTIFY_AT_DEADLINE); taskDao.save(task); // test due date in the future - task.setValue(Task.DUE_DATE, DateUtilities.now() + DateUtilities.ONE_DAY); + task.setDueDate(DateUtilities.now() + DateUtilities.ONE_DAY); taskDao.save(task); assertTrue(((AlarmExpected)service.getScheduler()).alarmCreated); } @@ -87,8 +87,8 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { public void testRandom() { // test random final Task task = new Task(); - task.setValue(Task.TITLE, "water"); - task.setValue(Task.REMINDER_PERIOD, DateUtilities.ONE_WEEK); + task.setTitle("water"); + task.setReminderPeriod(DateUtilities.ONE_WEEK); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { @@ -119,13 +119,13 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { } }); final Task task = new Task(); - task.setValue(Task.TITLE, "water"); - task.setValue(Task.DUE_DATE, DateUtilities.now() + DateUtilities.ONE_DAY); - task.setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AFTER_DEADLINE); + task.setTitle("water"); + task.setDueDate(DateUtilities.now() + DateUtilities.ONE_DAY); + task.setReminderFlags(Task.NOTIFY_AFTER_DEADLINE); taskDao.save(task); // test due date in the past - task.setValue(Task.DUE_DATE, DateUtilities.now() - DateUtilities.ONE_DAY); + task.setDueDate(DateUtilities.now() - DateUtilities.ONE_DAY); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { @@ -141,7 +141,7 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { assertTrue(((AlarmExpected)service.getScheduler()).alarmCreated); // test due date in the past, but recently notified - task.setValue(Task.REMINDER_LAST, DateUtilities.now()); + task.setReminderLast(DateUtilities.now()); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { @@ -161,10 +161,10 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { public void testMultipleReminders() { // test due date in the future, enable random final Task task = new Task(); - task.setValue(Task.TITLE, "water"); - task.setValue(Task.DUE_DATE, DateUtilities.now() + DateUtilities.ONE_WEEK); - task.setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); - task.setValue(Task.REMINDER_PERIOD, DateUtilities.ONE_HOUR); + task.setTitle("water"); + task.setDueDate(DateUtilities.now() + DateUtilities.ONE_WEEK); + task.setReminderFlags(Task.NOTIFY_AT_DEADLINE); + task.setReminderPeriod(DateUtilities.ONE_HOUR); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { @@ -180,13 +180,13 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { assertTrue(((AlarmExpected)service.getScheduler()).alarmCreated); // now set the due date in the past - task.setValue(Task.DUE_DATE, DateUtilities.now() - DateUtilities.ONE_WEEK); + task.setDueDate(DateUtilities.now() - DateUtilities.ONE_WEEK); ((AlarmExpected)service.getScheduler()).alarmCreated = false; service.scheduleAlarm(task); assertTrue(((AlarmExpected)service.getScheduler()).alarmCreated); // now set the due date before the random - task.setValue(Task.DUE_DATE, DateUtilities.now() + DateUtilities.ONE_HOUR); + task.setDueDate(DateUtilities.now() + DateUtilities.ONE_HOUR); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { @@ -207,10 +207,10 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { // test due date and snooze in the future final Task task = new Task(); - task.setValue(Task.TITLE, "spacemen"); - task.setValue(Task.DUE_DATE, DateUtilities.now() + 5000L); - task.setValue(Task.REMINDER_FLAGS, Task.NOTIFY_AT_DEADLINE); - task.setValue(Task.REMINDER_SNOOZE, DateUtilities.now() + DateUtilities.ONE_WEEK); + task.setTitle("spacemen"); + task.setDueDate(DateUtilities.now() + 5000L); + task.setReminderFlags(Task.NOTIFY_AT_DEADLINE); + task.setReminderSnooze(DateUtilities.now() + DateUtilities.ONE_WEEK); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { @@ -226,7 +226,7 @@ public class ReminderServiceTest extends TodorooRobolectricTestCase { assertTrue(((AlarmExpected)service.getScheduler()).alarmCreated); // snooze in the past - task.setValue(Task.REMINDER_SNOOZE, DateUtilities.now() - DateUtilities.ONE_WEEK); + task.setReminderSnooze(DateUtilities.now() - DateUtilities.ONE_WEEK); service.setScheduler(new AlarmExpected() { @Override public void createAlarm(Task task, long time, int type) { diff --git a/astrid/src/test/java/com/todoroo/astrid/repeats/AdvancedRepeatTest.java b/astrid/src/test/java/com/todoroo/astrid/repeats/AdvancedRepeatTest.java index 0ebb3a7a5..afc580a17 100644 --- a/astrid/src/test/java/com/todoroo/astrid/repeats/AdvancedRepeatTest.java +++ b/astrid/src/test/java/com/todoroo/astrid/repeats/AdvancedRepeatTest.java @@ -43,7 +43,7 @@ public class AdvancedRepeatTest extends TodorooRobolectricTestCase { public void before() { super.before(); task = new Task(); - task.setValue(Task.COMPLETION_DATE, DateUtilities.now()); + task.setCompletionDate(DateUtilities.now()); rrule = new RRule(); } @@ -55,7 +55,7 @@ public class AdvancedRepeatTest extends TodorooRobolectricTestCase { // test specific day & time long dayWithTime = Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, newDate(2010, 8, 1, 10, 4, 0).getTime()); - task.setValue(Task.DUE_DATE, dayWithTime); + task.setDueDate(dayWithTime); long nextDayWithTime = dayWithTime + DateUtilities.ONE_DAY; nextDueDate = RepeatTaskCompleteListener.computeNextDueDate(task, rrule.toIcal(), false); @@ -68,7 +68,7 @@ public class AdvancedRepeatTest extends TodorooRobolectricTestCase { // test specific day & time long dayWithTime = Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, newDate(2010, 8, 1, 10, 4, 0).getTime()); - task.setValue(Task.DUE_DATE, dayWithTime); + task.setDueDate(dayWithTime); Date todayWithTime = newDate(); todayWithTime.setHours(10); @@ -255,7 +255,7 @@ public class AdvancedRepeatTest extends TodorooRobolectricTestCase { private void setTaskDueDate(int which, int day) { long time = getDate(DateUtilities.now(), which, day); - task.setValue(Task.DUE_DATE, time); + task.setDueDate(time); } private long getDate(long start, int which, int dayOfWeek) { diff --git a/astrid/src/test/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListenerTest.java b/astrid/src/test/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListenerTest.java index f4fa3abc5..685598ad6 100644 --- a/astrid/src/test/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListenerTest.java +++ b/astrid/src/test/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListenerTest.java @@ -36,8 +36,8 @@ public class RepeatTaskCompleteListenerTest { { completionDate = new DateTime(2014, 1, 7, 17, 17, 32, 900).getMillis(); dueDate = new DateTime(2013, 12, 31, 17, 17, 32, 900).getMillis(); - task.setValue(Task.DUE_DATE, dueDate); - task.setValue(Task.COMPLETION_DATE, completionDate); + task.setDueDate(dueDate); + task.setCompletionDate(completionDate); } @Test diff --git a/tests-sync/src/com/todoroo/astrid/gtasks/GtasksNewSyncTest.java b/tests-sync/src/com/todoroo/astrid/gtasks/GtasksNewSyncTest.java index 140500be7..c93d34d92 100644 --- a/tests-sync/src/com/todoroo/astrid/gtasks/GtasksNewSyncTest.java +++ b/tests-sync/src/com/todoroo/astrid/gtasks/GtasksNewSyncTest.java @@ -92,7 +92,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { //Set new title on local task String newTitle = "Astrid task 2 edited"; - localTask.setValue(Task.TITLE, newTitle); + localTask.setTITLE(newTitle); taskService.save(localTask); whenInvokeSync(); @@ -146,7 +146,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { //Set new due date on local task long newDueDate = Task.createDueDate(Task.URGENCY_SPECIFIC_DAY, new Date(116, 1, 8).getTime()); - localTask.setValue(Task.DUE_DATE, newDueDate); + localTask.setDUE_DATE(newDueDate); taskService.save(localTask); whenInvokeSync(); @@ -219,7 +219,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { AndroidUtilities.sleepDeep(TIME_BETWEEN_SYNCS); - localTask.setValue(Task.DUE_DATE, newLocalDate); + localTask.setDUE_DATE(newLocalDate); taskService.save(localTask); whenInvokeSync(); @@ -252,7 +252,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { long newLocalDate = new Date(128, 5, 11).getTime(); long newRemoteDate = new Date(121, 5, 25).getTime(); - localTask.setValue(Task.DUE_DATE, newLocalDate); + localTask.setDUE_DATE(newLocalDate); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_BETWEEN_SYNCS); @@ -279,7 +279,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { date.setMinutes(0); date.setSeconds(0); long dueDate = date.getTime(); - localTask.setValue(Task.DUE_DATE, dueDate); + localTask.setDUE_DATE(dueDate); taskService.save(localTask); return localTask; @@ -300,7 +300,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { AndroidUtilities.sleepDeep(TIME_BETWEEN_SYNCS); String newNote = "New local note"; - localTask.setValue(Task.NOTES, newNote); + localTask.setNOTES(newNote); taskService.save(localTask); whenInvokeSync(); @@ -354,7 +354,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { String newLocalNote = "New local note"; String newRemoteNote = "New remote note"; - localTask.setValue(Task.NOTES, newLocalNote); + localTask.setNOTES(newLocalNote); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_BETWEEN_SYNCS); @@ -373,7 +373,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { private Task createLocalTaskForNoteTests(String addToTitle) { Task localTask = createNewLocalTask("Note will change" + addToTitle); String note = "Original note"; - localTask.setValue(Task.NOTES, note); + localTask.setNOTES(note); taskService.save(localTask); return localTask; @@ -394,7 +394,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { AndroidUtilities.sleepDeep(TIME_BETWEEN_SYNCS); long completion = DateUtilities.now(); - localTask.setValue(Task.COMPLETION_DATE, completion); + localTask.setCompletionDate(completion); taskService.save(localTask); whenInvokeSync(); @@ -489,7 +489,7 @@ public class GtasksNewSyncTest extends DatabaseTestCase { //Create a new Astrid task and save it to the database private Task createNewLocalTask(String title) { Task task = new Task(); - task.setValue(Task.TITLE, title); + task.setTITLE(title); taskService.save(task); return task; } diff --git a/tests-sync/src/com/todoroo/astrid/gtasks/GtasksSyncOnSaveTest.java b/tests-sync/src/com/todoroo/astrid/gtasks/GtasksSyncOnSaveTest.java index 4fcc22cc0..956cab5ec 100644 --- a/tests-sync/src/com/todoroo/astrid/gtasks/GtasksSyncOnSaveTest.java +++ b/tests-sync/src/com/todoroo/astrid/gtasks/GtasksSyncOnSaveTest.java @@ -67,7 +67,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase { private Task setupLocalTaskModel(String title) { Task localTask = new Task(); - localTask.setValue(Task.TITLE, title); + localTask.setTITLE(title); return localTask; } @@ -84,7 +84,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase { Task localTask = performBasicCreation("-title will change"); String newTitle = "Title has changed!"; - localTask.setValue(Task.TITLE, newTitle); + localTask.setTITLE(newTitle); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_TO_WAIT); @@ -98,7 +98,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase { Task localTask = performBasicCreation("-due date will change"); long dueDate = new Date(115, 2, 14).getTime(); - localTask.setValue(Task.DUE_DATE, dueDate); + localTask.setDUE_DATE(dueDate); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_TO_WAIT); @@ -112,7 +112,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase { Task localTask = performBasicCreation("-notes will change"); String notes = "Noted!"; - localTask.setValue(Task.NOTES, notes); + localTask.setNOTES(notes); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_TO_WAIT); @@ -126,7 +126,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase { Task localTask = performBasicCreation("-will be completed"); long completionDate = (DateUtilities.now() / 1000L) * 1000L; - localTask.setValue(Task.COMPLETION_DATE, completionDate); + localTask.setCompletionDate(completionDate); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_TO_WAIT); @@ -141,7 +141,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase { Task localTask = performBasicCreation("-will be deleted"); long deletionDate = DateUtilities.now(); - localTask.setValue(Task.DELETION_DATE, deletionDate); + localTask.setDELETION_DATE(deletionDate); taskService.save(localTask); AndroidUtilities.sleepDeep(TIME_TO_WAIT); diff --git a/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java b/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java index 98a3a1133..58651c5f9 100644 --- a/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java +++ b/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java @@ -86,7 +86,7 @@ abstract public class AbstractSyncRepeatTests extends DatabaseTest protected long setCompletionDate(boolean completeBefore, Task t, REMOTE_MODEL remoteModel, long dueDate) { long completionDate = DateUtilities.now(); - t.setValue(Task.COMPLETION_DATE, completionDate); + t.setCompletionDate(completionDate); saveAndTriggerRepeatListener(t); return completionDate; } @@ -103,10 +103,10 @@ abstract public class AbstractSyncRepeatTests extends DatabaseTest public void testNoRepeat() { Task t = new Task(); - t.setValue(Task.TITLE, "no repeat"); + t.setTITLE("no repeat"); taskDao.save(t); - t.setValue(Task.COMPLETION_DATE, DateUtilities.now()); + t.setCompletionDate(DateUtilities.now()); saveAndTriggerRepeatListener(t); TodorooCursor cursor = taskDao.query(Query.select(Task.ID)); @@ -120,11 +120,11 @@ abstract public class AbstractSyncRepeatTests extends DatabaseTest protected void testRepeating(boolean completeBefore, boolean fromCompletion, RRule rrule, Frequency frequency, String title) { Task t = new Task(); - t.setValue(Task.TITLE, title); + t.setTITLE(title); long dueDate = DateUtilities.now() + ((completeBefore ? -1 : 1) * DateUtilities.ONE_DAY * 3); dueDate = Task.createDueDate(Task.URGENCY_SPECIFIC_DAY_TIME, (dueDate / 1000L) * 1000L); // Strip milliseconds - t.setValue(Task.DUE_DATE, dueDate); + t.setDUE_DATE(dueDate); if (rrule == null) { rrule = new RRule(); @@ -137,7 +137,7 @@ abstract public class AbstractSyncRepeatTests extends DatabaseTest if (fromCompletion) result = result + ";FROM=COMPLETION"; - t.setValue(Task.RECURRENCE, rrule.toIcal()); + t.setRECURRENCE(rrule.toIcal()); taskDao.save(t); waitAndSync();