Package ntnu.team1.backend.objects
Class Task
java.lang.Object
ntnu.team1.backend.objects.Task
- All Implemented Interfaces:
Serializable
A class that represents a main task
Inherits from the abstract super class Task
- See Also:
- Serialized Form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquals method for the objectintGets the category IDGets descriptionGets end dateintgetID()Gets the IDgetName()Gets nameintGets priorityGets start datebooleanChecks if the task has a categorybooleanisDone()Checks if task is donevoidsetCategoryId(int categoryId)Updates the category IDvoidsetDescription(String description)Sets descriptionvoidsetDone(boolean done)Sets task as donevoidsetEndDate(LocalDate endDate)Sets end datevoidSets namevoidsetPriority(int priority)Sets priorityvoidsetStartDate(LocalDate startDate)Sets start datetoString()ToString for the object
-
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 taskstartDate- A LocalDate object representing the start date of the TaskendDate- A LocalDate object representing the end date of the Taskname- A string representing the name of the Taskdescription- A String representing the description of the Taskpriority- An integer representing the priority of the TaskcategoryId- 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
Gets start date- Returns:
- A Local Date Object
-
setStartDate
Sets start date- Parameters:
startDate- Start date of the task
-
getEndDate
Gets end date- Returns:
- A Local Date Object
-
setEndDate
Sets end date- Parameters:
endDate- A Local Date Object
-
getName
Gets name- Returns:
- A String
-
setName
Sets name- Parameters:
name- Name of the task
-
getDescription
Gets description- Returns:
- Description of the task
-
setDescription
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
Equals method for the object -
toString
ToString for the object
-