Class TaskListItemModel

java.lang.Object
io.meeds.task.mcp.model.TaskListItemModel

public class TaskListItemModel extends Object
A task in a list: what tells the card apart on its board, as a search result does, with its assignee, due date, creation date, priority and comments count, without its description, coworkers or other dates, which get_task_by_id returns. The creation date tells apart the tasks created since a date; the date of the latest comment tells apart those nobody has commented on since. On request, the description as cut plain text.
  • Constructor Details

    • TaskListItemModel

      public TaskListItemModel(long id, String title, String link, boolean completed, Long projectId, String projectName, ProjectStatus status, List<ProjectLabel> labels, TaskAssigneeModel assignee, String dueDate, String createdDate, Integer daysOverdue, Priority priority, int commentsCount, List<TaskChange> changes)
      A list item without its latest comment, which setLastComment(String, TaskAssigneeModel) adds, nor its description, which setPlainTextDescription(String) adds on request.
      Parameters:
      id - the task
      title - its title
      link - its link
      completed - whether it is completed
      projectId - its project, null for a personal task
      projectName - the name of its project
      status - its status
      labels - its labels
      assignee - its assignee
      dueDate - its due date
      createdDate - its creation date
      daysOverdue - its days overdue, null when not overdue
      priority - its priority
      commentsCount - its comments count, replies included
      changes - its changes since a date, null for none
  • Method Details

    • setPlainTextDescription

      public void setPlainTextDescription(String plainText)
      Sets the description from its plain text, cut at TaskDescriptionText.MAX_LENGTH characters, with description_truncated when it was cut.
      Parameters:
      plainText - the description as plain text, null for none
    • setLastComment

      public void setLastComment(String date, TaskAssigneeModel author)
      Sets when and by whom its latest comment was written.
      Parameters:
      date - the date of its latest comment, formatted as created_date
      author - its author