package linenux.model;

import java.time.LocalDateTime;
import java.util.ArrayList;

/**
 * Represents a task in the schedule.
 * Only taskName is a required field and cannot be an empty string.
 */
public class Task {
    private String taskName;
    private boolean isDone;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private ArrayList<Reminder> reminderList;

    /**
     * Constructor for tasks with no deadlines or predetermined time slots.
     */
    public Task(String taskName) {
        this.taskName = taskName;
        this.isDone = false;
        this.startTime = null;
        this.endTime = null;
        this.reminderList = new ArrayList<Reminder>();
    }

    /**
     * Constructor for tasks with deadlines only.
     */
    public Task(String taskName, LocalDateTime endTime) {
        this.taskName = taskName;
        this.isDone = false;
        this.startTime = null;
        this.endTime = endTime;
        this.reminderList = new ArrayList<Reminder>();
    }

    /**
     * Constructor for tasks with predetermined time slots.
     */
    public Task(String taskName, LocalDateTime startTime, LocalDateTime endTime) {
        this.taskName = taskName;
        this.isDone = false;
        this.startTime = startTime;
        this.endTime = endTime;
        this.reminderList = new ArrayList<Reminder>();
    }

    @Override
    public String toString() {
        return this.taskName;
    }

    /* Getters */

    public String getTaskName() {
        return this.taskName;
    }

    public boolean isDone() {
        return this.isDone;
    }

    public LocalDateTime getStartTime() {
        return this.startTime;
    }

    public LocalDateTime getEndTime() {
        return this.endTime;
    }

    public ArrayList<Reminder> getReminderList() {
        return this.reminderList;
    }

    /* Setters */

     public void setTaskName(String taskName) {
         this.taskName = taskName;
     }

     public void markAsDone() {
         this.isDone = true;
     }

     public void setStartTime(LocalDateTime startTime) {
         this.startTime = startTime;
     }

     public void setEndTime(LocalDateTime endTime) {
         this.endTime = endTime;
     }
}

@@ -381,20 +381,17 @@
 reminder
-List
+s
 ;%0A%0A    /
@@ -648,36 +648,33 @@
    this.reminder
-List
+s
  = new ArrayList
@@ -957,36 +957,33 @@
    this.reminder
-List
+s
  = new ArrayList
@@ -1314,20 +1314,17 @@
 reminder
-List
+s
  = new A
@@ -1787,20 +1787,17 @@
 Reminder
-List
+s
 () %7B%0A   
@@ -1821,20 +1821,17 @@
 reminder
-List
+s
 ;%0A    %7D%0A

Change name of reminderList