Class TodoTask

java.lang.Object
com.independentsoft.graph.todo.TodoTask
All Implemented Interfaces:
ICreatable, IUpdatable

public class TodoTask extends Object implements ICreatable, IUpdatable
Represents a task in a Microsoft To Do task list.

A TodoTask is a piece of work or a personal item that can be tracked and completed. Tasks belong to a TodoTaskList and can have a due date, reminder, recurrence pattern, importance, and status.

Example usage:

 // Create a new task
 TodoTask task = new TodoTask();
 task.setTitle("Submit expense report");
 task.setImportance(Importance.HIGH);
 
Since:
1.0
See Also:
todoTask resource type, TodoTaskList
  • Constructor Details

    • TodoTask

      public TodoTask()
    • TodoTask

      public TodoTask(JsonObject jsonObject)
  • Method Details

    • toCreateJson

      public String toCreateJson()
      Description copied from interface: ICreatable
      Converts this object to its JSON representation for creation.

      This method generates a JSON string containing all properties needed to create a new instance of this resource in Microsoft Graph. Only properties appropriate for creation should be included (e.g., excluding read-only properties like ID, createdTime, etc.).

      Specified by:
      toCreateJson in interface ICreatable
      Returns:
      JSON string representation for creating this resource
    • toUpdateJson

      public String toUpdateJson()
      Description copied from interface: IUpdatable
      Converts this object to its JSON representation for update.

      This method generates a JSON string containing all modified properties that should be updated in Microsoft Graph. Only writeable properties with non-null values are typically included.

      Specified by:
      toUpdateJson in interface IUpdatable
      Returns:
      JSON string representation for updating this resource
    • toUpdateJson

      public String toUpdateJson(List<String> propertyNames)
      Description copied from interface: IUpdatable
      Converts this object to JSON for update with specific properties.

      This method generates a JSON string containing only the specified properties. This enables partial updates where only certain fields need to be modified, reducing payload size and avoiding unintended changes to other properties.

      Specified by:
      toUpdateJson in interface IUpdatable
      Parameters:
      propertyNames - List of property names to include in the JSON. If null or empty, all modified properties are included.
      Returns:
      JSON string representation for updating specific properties
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getId

      public String getId()
    • setId

      public void setId(String id)
    • getBody

      public ItemBody getBody()
    • setBody

      public void setBody(ItemBody body)
    • getBodyLastModifiedTime

      public Date getBodyLastModifiedTime()
    • getCategories

      public List<String> getCategories()
    • getCompletedTime

      public DateTimeTimeZone getCompletedTime()
    • setCompletedTime

      public void setCompletedTime(DateTimeTimeZone completedTime)
    • getDueTime

      public DateTimeTimeZone getDueTime()
    • setDueTime

      public void setDueTime(DateTimeTimeZone dueTime)
    • hasAttachments

      public boolean hasAttachments()
    • getImportance

      public Importance getImportance()
    • setImportance

      public void setImportance(Importance importance)
    • isReminderOn

      public boolean isReminderOn()
    • setReminderOn

      public void setReminderOn(boolean isReminderOn)
    • getLastModifiedTime

      public Date getLastModifiedTime()
    • getRecurrence

      public Recurrence getRecurrence()
    • setRecurrence

      public void setRecurrence(Recurrence recurrence)
    • getReminderTime

      public DateTimeTimeZone getReminderTime()
    • setReminderTime

      public void setReminderTime(DateTimeTimeZone reminderTime)
    • getStartTime

      public DateTimeTimeZone getStartTime()
    • setStartTime

      public void setStartTime(DateTimeTimeZone startTime)
    • getStatus

      public TodoTaskStatus getStatus()
    • setStatus

      public void setStatus(TodoTaskStatus status)
    • getTitle

      public String getTitle()
    • setTitle

      public void setTitle(String title)