Class Task

java.lang.Object
ntnu.team1.backend.objects.Task
All Implemented Interfaces:
Serializable

public class Task extends Object implements Serializable
A class that represents a main task Inherits from the abstract super class Task
See Also:
Serialized Form
  • Constructor Details

    • Task

      public Task(int ID, String name, String description, LocalDate startDate, LocalDate endDate, int priority, int categoryId)
      Constructor of the objects
      Parameters:
      ID - an Integer representing the ID of a main task
      startDate - A LocalDate object representing the start date of the Task
      endDate - A LocalDate object representing the end date of the Task
      name - A string representing the name of the Task
      description - A String representing the description of the Task
      priority - An integer representing the priority of the Task
      categoryId - An Integer representing the ID of a category
  • Method Details

    • getCategoryId

      public int getCategoryId()
      Gets the category ID
      Returns:
      returns category ID
    • hasCategory

      public boolean hasCategory()
      Checks if the task has a category
      Returns:
      returns true if the main task has a category, false if not.
    • setCategoryId

      public void setCategoryId(int categoryId)
      Updates the category ID
      Parameters:
      categoryId - Id of the category
    • getID

      public int getID()
      Gets the ID
      Returns:
      an int
    • getStartDate

      public LocalDate getStartDate()
      Gets start date
      Returns:
      A Local Date Object
    • setStartDate

      public void setStartDate(LocalDate startDate)
      Sets start date
      Parameters:
      startDate - Start date of the task
    • getEndDate

      public LocalDate getEndDate()
      Gets end date
      Returns:
      A Local Date Object
    • setEndDate

      public void setEndDate(LocalDate endDate)
      Sets end date
      Parameters:
      endDate - A Local Date Object
    • getName

      public String getName()
      Gets name
      Returns:
      A String
    • setName

      public void setName(String name)
      Sets name
      Parameters:
      name - Name of the task
    • getDescription

      public String getDescription()
      Gets description
      Returns:
      Description of the task
    • setDescription

      public void setDescription(String description)
      Sets description
      Parameters:
      description - Description as a String
    • getPriority

      public int getPriority()
      Gets priority
      Returns:
      Priority as an int
    • setPriority

      public void setPriority(int priority)
      Sets priority
      Parameters:
      priority - Priority as an int
    • isDone

      public boolean isDone()
      Checks if task is done
      Returns:
      A boolean indicating if the task is done
    • setDone

      public void setDone(boolean done)
      Sets task as done
      Parameters:
      done - a boolean indicating if the task is done
    • equals

      public boolean equals(Object o)
      Equals method for the object
      Overrides:
      equals in class Object
      Parameters:
      o - Object we want to compare with
      Returns:
      A boolean indicating if the objects are equal
    • toString

      public String toString()
      ToString for the object
      Overrides:
      toString in class Object
      Returns:
      returns information about MainTask objects.