Class Deadline

java.lang.Object
amadeus.workspace.Task
amadeus.workspace.Deadline

public class Deadline extends Task
Represents a task with a specific deadline.

This class extends the Task class and provides functionality specific to deadline tasks.

  • Field Details

    • by

      protected Object by
      The due date/time of the deadline task.
  • Constructor Details

    • Deadline

      public Deadline(String name, Object by)
      Constructs a Deadline task with a name and due date/time.
      Parameters:
      name - the name or description of the task; must not be null.
      by - the deadline by which the task must be completed; must not be null.
    • Deadline

      public Deadline(String name, boolean done, Object by)
      Constructs a Deadline task with a name, completion status, and due date/time.
      Parameters:
      name - the name or description of the task; must not be null.
      done - a boolean indicating whether the task is completed (true) or not (false).
      by - the deadline by which the task must be completed; must not be null.
  • Method Details

    • getBy

      public Object getBy()
      Returns the due date/time of the deadline task.
      Returns:
      The due date/time of the deadline task.
    • getDetails

      public String getDetails()
      Returns the details of the Deadline task, including the due date/time.
      Specified by:
      getDetails in class Task
      Returns:
      the details of the deadline as a formatted string.
    • toString

      public String toString()
      Returns a string representation of the Deadline, including its name and due date/time.
      Overrides:
      toString in class Task
      Returns:
      a formatted string representing the deadline details.
    • toFileFormat

      public String toFileFormat()
      Converts the Deadline task to a file-friendly format.

      The format is: D | <isDone> | <description> | <by>.

      Specified by:
      toFileFormat in class Task
      Returns:
      a string representation of the Deadline task in a format suitable for saving to a file.