Exemple #1
0
 /**
  * Set description for the task
  *
  * @param source from the task that will be edited
  * @param editedTask the task that contains what to edit
  */
 private void setDescriptionBasedOnSpecified(Task source, Task toEditTask, Task editedTask) {
   if (toEditTask.getDescription() == null || toEditTask.getDescription().isEmpty()) {
     editedTask.setDescription(source.getDescription());
   } else {
     editedTask.setDescription(toEditTask.getDescription());
   }
 }
Exemple #2
0
  /**
   * Remove the some day keyword from the description
   *
   * @param toEditTask the task to edit
   * @param someDayKeyWords the keywords for someday
   */
  private void removeSomeDayKeyWord(Task toEditTask, String[] someDayKeyWords) {
    String matchedWord =
        StringHandler.getContainsWord(toEditTask.getDescription(), someDayKeyWords);
    String newDescription =
        StringHandler.removeFirstMatchedWord(toEditTask.getDescription(), matchedWord);

    toEditTask.setDescription(newDescription);
  }