Class TaskAssignmentDto

java.lang.Object
no.ntnu.principes.dto.TaskAssignmentDto

public class TaskAssignmentDto extends Object
A Data Transfer Object (DTO) for representing task assignments, including details such as the task, member assigned, assignment times, status, and completion information.
  • Constructor Details

    • TaskAssignmentDto

      public TaskAssignmentDto()
  • Method Details

    • getTask

      public TaskDto getTask()
      Retrieves the task associated with this task assignment. If the task is not set (i.e., null), returns a default TaskDTO instance with placeholder values.

      The placeholder task can be identified by the

      invalid reference
      TaskDto#getId()
      == -1L

      Returns:
      the associated TaskDTO if present, or a default TaskDTO with placeholder values if the task is null.
    • isCompleted

      public boolean isCompleted()
      Checks if the task associated with this TaskAssignmentDTO is completed.
      Returns:
      true if the task's status is TaskStatus.DONE, otherwise false.
    • isPending

      public boolean isPending()
      Checks if the task assignment is currently pending.
      Returns:
      true if the task assignment's status is TaskStatus.TODO; false otherwise.
    • isCancelled

      public boolean isCancelled()
      Checks if the task assignment has a status indicating it has been cancelled.
      Returns:
      true if the task assignment status is TaskStatus.CANCELLED; false otherwise.