public void addJournalEntryTO(JournalEntryTO journalEntryTO) { if (ObjectStatus.ACTIVE.equals(journalEntryTO.getObjectStatus())) { HashSet<JournalEntryDetailTO> nonDeletedJournalEntryDetails = Sets.newHashSet(); for (JournalEntryDetailTO singleJournalEntryDetail : journalEntryTO.getJournalEntryDetails()) { if (ObjectStatus.ACTIVE.equals(singleJournalEntryDetail.getObjectStatus())) { nonDeletedJournalEntryDetails.add(singleJournalEntryDetail); } } journalEntryTO.setJournalEntryDetails(nonDeletedJournalEntryDetails); journalEntries.add(journalEntryTO); } }
public void addTask(String group, TaskTO task) { if (ObjectStatus.ACTIVE.equals(task.getObjectStatus())) { ArrayList<TaskTO> taskList = taskMap.get(group); if (null == taskList) { taskList = new ArrayList<TaskTO>(); taskMap.put(group, taskList); } if (!taskList.contains(task)) { taskList.add(task); } } }