java.lang.Object
no.ntnu.principes.dto.TaskAssignmentDto
A Data Transfer Object (DTO) for representing task assignments, including details such as
the task, member assigned, assignment times, status, and completion information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTask()Retrieves the task associated with this task assignment.booleanChecks if the task assignment has a status indicating it has been cancelled.booleanChecks if the task associated with this TaskAssignmentDTO is completed.booleanChecks if the task assignment is currently pending.
-
Constructor Details
-
TaskAssignmentDto
public TaskAssignmentDto()
-
-
Method Details
-
getTask
Retrieves the task associated with this task assignment. If the task is not set (i.e.,null), returns a defaultTaskDTOinstance with placeholder values.The placeholder task can be identified by the
invalid reference
TaskDto#getId()== -1L- Returns:
- the associated
TaskDTOif present, or a defaultTaskDTOwith placeholder values if the task isnull.
-
isCompleted
public boolean isCompleted()Checks if the task associated with this TaskAssignmentDTO is completed.- Returns:
trueif the task's status isTaskStatus.DONE, otherwisefalse.
-
isPending
public boolean isPending()Checks if the task assignment is currently pending.- Returns:
trueif the task assignment's status isTaskStatus.TODO;falseotherwise.
-
isCancelled
public boolean isCancelled()Checks if the task assignment has a status indicating it has been cancelled.- Returns:
trueif the task assignment status isTaskStatus.CANCELLED;falseotherwise.
-